search for: namedvalues

Displaying 6 results from an estimated 6 matches for "namedvalues".

2012 Apr 22
2
[LLVMdev] Problem about the type of Function's arguement in llvm
in the tutorial of official llvm doc, chapter 3, it deals with arguement of function as follow: for (Function::arg_iterator AI = F->arg_begin(); Idx != Args.size(); ++AI, ++Idx) { AI->setName(Args[Idx]); // NamedValues is map<string, Value*> NamedValues[Args[Idx]] = AI; and when it try to get the value of arguement, it simply does: Value *VariableExprAST::Codegen() { Value *V = NamedValues[Name]; return V ? V : ErrorV("Unknown variable name"); } It means that we can access value of argu...
2012 Apr 22
0
[LLVMdev] Problem about the type of Function's arguement in llvm
...fei258 at gmail.com> wrote: > in the  tutorial of official llvm doc, chapter 3, it deals with arguement of > function as follow: > > for (Function::arg_iterator AI = F->arg_begin(); Idx != Args.size(); >        ++AI, ++Idx) { >     AI->setName(Args[Idx]); > >     // NamedValues is map<string, Value*> >     NamedValues[Args[Idx]] = AI; > > and when it try to get the value of arguement, it simply does: > > Value *VariableExprAST::Codegen() { >   Value *V = NamedValues[Name]; >   return V ? V : ErrorV("Unknown variable name"); > } >...
2012 Apr 23
1
[LLVMdev] Problem about the type of Function's arguement in llvm
...he tutorial of official llvm doc, chapter 3, it deals with > arguement of > > function as follow: > > > > for (Function::arg_iterator AI = F->arg_begin(); Idx != Args.size(); > > ++AI, ++Idx) { > > AI->setName(Args[Idx]); > > > > // NamedValues is map<string, Value*> > > NamedValues[Args[Idx]] = AI; > > > > and when it try to get the value of arguement, it simply does: > > > > Value *VariableExprAST::Codegen() { > > Value *V = NamedValues[Name]; > > return V ? V : ErrorV("Unknow...
2010 Feb 17
2
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...----------------------------------------------------------------------===// // Code Generation //===----------------------------------------------------------------------===// static Module *TheModule; static IRBuilder<> Builder(getGlobalContext()); static std::map<std::string, Value*> NamedValues; static FunctionPassManager *TheFPM; Value *ErrorV(const char *Str) { Error(Str); return 0; } Value *NumberExprAST::Codegen() { return ConstantFP::get(getGlobalContext(), APFloat(Val)); } Value *VariableExprAST::Codegen() { // Look this variable up in the function. Value *V = NamedValues[N...
2010 Feb 17
0
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...------------------------------------===// > // Code Generation > > //===----------------------------------------------------------------------===// > > static Module *TheModule; > static IRBuilder<> Builder(getGlobalContext()); > static std::map<std::string, Value*> NamedValues; > static FunctionPassManager *TheFPM; > > Value *ErrorV(const char *Str) { Error(Str); return 0; } > > Value *NumberExprAST::Codegen() { > return ConstantFP::get(getGlobalContext(), APFloat(Val)); > } > > Value *VariableExprAST::Codegen() { > // Look this variable u...
2010 Feb 17
1
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...--------===// >> // Code Generation >> >> //===----------------------------------------------------------------------===// >> >> static Module *TheModule; >> static IRBuilder<> Builder(getGlobalContext()); >> static std::map<std::string, Value*> NamedValues; >> static FunctionPassManager *TheFPM; >> >> Value *ErrorV(const char *Str) { Error(Str); return 0; } >> >> Value *NumberExprAST::Codegen() { >>  return ConstantFP::get(getGlobalContext(), APFloat(Val)); >> } >> >> Value *VariableExprAST::Codeg...