in the  tutorial of official llvm doc, chapter 3, it deals with arguement of function as follow:<br><br>for (Function::arg_iterator AI = F->arg_begin(); Idx != Args.size();<br>       ++AI, ++Idx) {<br>    AI->setName(Args[Idx]);<br>
    <br>    // NamedValues is map<string, Value*> <br>    NamedValues[Args[Idx]] = AI;<br><br>and when it try to get the value of arguement, it simply does:<br><br>Value *VariableExprAST::Codegen() {<br>  Value *V = NamedValues[Name];<br>
  return V ? V : ErrorV("Unknown variable name");<br>}<br><br>It means that we can access value of arguement directly.<br><br>However, in <a href="http://llvm.org/demo">llvm.org/demo</a> and the chapter 6 of tutorial, it deals with arguemnt:<br>
1. allocate memory for arguement<br>2. then store the arguemnt into the memory.<br>3. CreateLoad() to load the arguement when accessing the value of arguement.<br><br>I have several problems:<br>Which way should I follow to get the vale of arguement?<br>
<br>When I tried to use CreateLoad(arguement), the program gives a segmentation error.<br>Does this result from the wrong type of argument, unsuitable to be the params of CreateLoad()? <br>If it is, what's the type of Function->arg_begin() ? (The source code is too nested for me to find the original type of that)<br>
<br>