void CodeGenVisitor::visit(AssignmentExpression* e) { value_ = 0; e->getExpr()->accept(this); if (value_ == 0) { throw "error creating expression"; } builder_->CreateStore(value_, getNamedValue(e->getId())); }
void CodeGenVisitor::visit(LoadExpression *e) { llvm::Value* v = getNamedValue(e->getId()); if (!v) { throw "unknown variable name"; } value_ = builder_->CreateLoad(v, e->getId()); }
inline void checkAndEatHeader(std::istream& inStream){ int version = getNamedValue(inStream, "MD5Version"); if(version != MD5_SUPPORTED_VERSION){ fatalError("MD5 data has wrong version."); } //get 'commandline' string //we don't use it but it must be present findNextToken(inStream); std::string token; std::getline(inStream, token, ' '); if(token != "commandline") fatalError("MD5 data must contain 'commandline' variable in its header."); findNextToken(inStream); //find " character inStream.ignore(50, '"'); //ignore commanline data inStream.ignore(10000, '"'); }