[LLVMdev] Global Variable Recall

Rasha Omar rasha.sala7 at gmail.com
Tue Sep 10 11:50:59 PDT 2013


Hi All,

I need to call global variable by its name from the following code

 for(Function::iterator i=F->begin();i!=F->end();++i)
      {
    BasicBlock*Bb =&*i;
    GlobalVariable* GV = new GlobalVariable(type,false,
F->getLinkage(),0,  "F$"+Bb->getName());
    GV->setInitializer(Constant::getNullValue (typ));
    GList.push_back(GV);
      }

Could I solve that by mapping the global variables in Stringmap?
I need to identify the global variable with its name in the IR to be able
to load and store its values.

Thanks


-- 
*     Rasha Salah Omar
     Msc Student at E-JUST
     Demonestrator  at Faculty of Computers and Informatics
     Benha University*

*     e-mail: rasha.omar at ejust.edu.eg*
 P* Please consider the environment before printing this email.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130910/2a041dd5/attachment.html>


More information about the llvm-dev mailing list