Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F2729557
xreatemanager-decorators.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
Fri, Mar 13, 3:19 AM
Size
1 KB
Mime Type
text/x-c++
Expires
Sun, Mar 15, 3:19 AM (1 d, 1 h)
Engine
blob
Format
Raw Data
Handle
243073
Attached To
rXR Xreate
xreatemanager-decorators.cpp
View Options
/*
* xreatemanager-decorators.cpp
*
* Author: pgess <v.melnychenko@xreate.org>
* Created on July 16, 2017, 4:40 PM
*/
#include "aux/xreatemanager-decorators.h"
#include "main/Parser.h"
#include "pass/compilepass.h"
#include "pass/adhocpass.h"
#include "pass/cfapass.h"
#include "pass/dfapass.h"
#include "pass/interpretationpass.h"
#include "pass/versionspass.h"
namespace xreate {
void
XreateManagerDecoratorBase::prepareCode(std::string&& code){
grammar::main::Scanner scanner(reinterpret_cast<const unsigned char*>(code.c_str()), code.size());
grammar::main::Parser parser(&scanner);
parser.Parse();
assert(!parser.errors->count && "Parser errors");
PassManager::prepare(parser.root->finalize());
}
void
XreateManagerDecoratorBase::prepareCode(FILE* code){
grammar::main::Scanner scanner(code);
grammar::main::Parser parser(&scanner);
parser.Parse();
assert(!parser.errors->count && "Parser errors");
PassManager::prepare(parser.root->finalize());
}
void
XreateManagerDecoratorBase::analyse(){
CompilePass::prepareQueries(clasp);
clasp->run();
}
void
XreateManagerDecoratorFull::initPasses(){
cfa::CFAPass* passCFG = new cfa::CFAPass(this);
//TODO is it really DFGPass needs CFGpass?
registerPass(new dfa::DFAPass(this), PassId::DFGPass, passCFG);
registerPass(passCFG, PassId::CFGPass);
this->registerPass(new adhoc::AdhocPass(this), PassId::AdhocPass);
this->registerPass(new interpretation::InterpretationPass(this), PassId::InterpretationPass);
this->registerPass(new versions::VersionsPass(this), PassId::VersionsPass);
}
void*
XreateManagerDecoratorFull::run() {
std::unique_ptr<CompilePass> compiler(new compilation::CompilePassCustomDecorators<>(this));
compiler->run();
llvm->print();
llvm->initJit();
return llvm->getFunctionPointer(compiler->getEntryFunction());
}
} //namespace xreate
Event Timeline
Log In to Comment