Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F5337818
intrinsics.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 21, 7:12 AM
Size
1 KB
Mime Type
text/x-c++
Expires
Mon, Nov 23, 7:12 AM (19 h, 45 m)
Engine
blob
Format
Raw Data
Handle
316589
Attached To
rXR Xreate
intrinsics.cpp
View Options
//March 2020
#include "compilation/intrinsics.h"
#include "analysis/utils.h"
#include "llvmlayer.h"
using namespace std;
namespace xreate{ namespace compilation{
llvm::Value*
IntrinsicCompiler::compile(const Expression& e, const Context& context, const std::string& hintAlias){
switch ((IntrinsicFn) e.getValueDouble()){
case IntrinsicFn::ARR_INIT:{
return nullptr;
// const ExpandedType& typAggr = context.pass->man->root->getType(e);
// llvm::Type* typAggrRaw = context.pass->man->llvm->toLLVMType(typAggr);
// llvm::Value* lengthRaw = context.scope->process(e.operands.at(0));
//
// ContainerInst engine(context);
// return engine.array_init(lengthRaw, typAggrRaw);
}
default: break;
}
assert(false);
return nullptr;
}
Expression
IntrinsicCompiler::interpret(const Expression& e){
switch ((IntrinsicFn) e.getValueDouble()){
case IntrinsicFn::REC_FIELDS: {
return rec_fields(e);
}
default: break;
}
assert(false);
return Expression();
}
Expression
IntrinsicCompiler::rec_fields(const Expression& e){
TypesHelper helper(__man->llvm);
assert(e.operands.size() == 1);
const Expression argTypeE = e.operands.at(0);
assert(argTypeE.__state == Expression::STRING);
const string& argTypeS = argTypeE.getValueString();
const ExpandedType argTypeT = __man->root->findType(argTypeS);
const auto& fields = helper.getRecordFields(argTypeT);
return analysis::representVecStr(fields);
}
}}
Event Timeline
Log In to Comment