search for: variableexprast

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

2010 Feb 17
2
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...ss ExprAST { public: virtual ~ExprAST() {} virtual Value *Codegen() = 0; }; /// NumberExprAST - Expression class for numeric literals like "1.0". class NumberExprAST : public ExprAST { double Val; public: NumberExprAST(double val) : Val(val) {} virtual Value *Codegen(); }; /// VariableExprAST - Expression class for referencing a variable, like "a". class VariableExprAST : public ExprAST { std::string Name; public: VariableExprAST(const std::string &name) : Name(name) {} virtual Value *Codegen(); }; /// BinaryExprAST - Expression class for a binary operator. class Bi...
2010 Feb 17
0
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...tual Value *Codegen() = 0; > }; > > /// NumberExprAST - Expression class for numeric literals like "1.0". > class NumberExprAST : public ExprAST { > double Val; > public: > NumberExprAST(double val) : Val(val) {} > virtual Value *Codegen(); > }; > > /// VariableExprAST - Expression class for referencing a variable, like > "a". > class VariableExprAST : public ExprAST { > std::string Name; > public: > VariableExprAST(const std::string &name) : Name(name) {} > virtual Value *Codegen(); > }; > > /// BinaryExprAST - Express...
2012 Apr 22
2
[LLVMdev] Problem about the type of Function's arguement in llvm
...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 arguement directly. However, in llvm.org/demo and the chapter 6 of tutorial, it deals with arguemnt: 1. allocate memory for arguement 2. then store the a...
2010 Feb 17
1
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...gt; >> /// NumberExprAST - Expression class for numeric literals like "1.0". >> class NumberExprAST : public ExprAST { >>  double Val; >> public: >>  NumberExprAST(double val) : Val(val) {} >>  virtual Value *Codegen(); >> }; >> >> /// VariableExprAST - Expression class for referencing a variable, like >> "a". >> class VariableExprAST : public ExprAST { >>  std::string Name; >> public: >>  VariableExprAST(const std::string &name) : Name(name) {} >>  virtual Value *Codegen(); >> }; >>...
2012 Apr 22
0
[LLVMdev] Problem about the type of Function's arguement in llvm
...erator 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 arguement directly. Yes, it is possible to access the values (virtual registers) direclty, but you may need to construct SSA form...
2012 Apr 23
1
[LLVMdev] Problem about the type of Function's arguement in llvm
...ze(); > > ++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 arguement directly. > Yes, it is possible to access the values (virtual registers) direclty, > but...