diff options
Diffstat (limited to 'Driver.cc')
| -rw-r--r-- | Driver.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Driver.cc b/Driver.cc new file mode 100644 index 0000000..3fefd8c --- /dev/null +++ b/Driver.cc @@ -0,0 +1,21 @@ +#include "Driver.hh" + +namespace pcc { +Driver::Driver(Context* context) + : context_(context) {} + +Driver::~Driver() {} + +void Driver::Parse(const std::string& filename) { + if (StartLexer(filename) != 0) { + return; + } + Parser parser(*this); + parser.parse(); + StopLexer(); +} + +llvm::Module* Driver::GetModule() { return &context_->module_; } + +llvm::IRBuilder<>* Driver::GetBuilder() { return &context_->builder_; } +} // namespace pcc |
