[LLVMdev] replacing a global variable by a constant

neda 8664 neda8664 at gmail.com
Tue Oct 4 23:30:47 PDT 2011


hi
i want  replacing a global variable by a constant  value for erase
instruction. i had seen the code that as follows

for (llvm::GlobalVariable::use_iterator U = gv->use_begin(); U !=
gv->use_end();--U ) {
    llvm::Instruction *I = llvm::cast<llvm::Instruction>(U);
    I->replaceAllUsesWith(constPtr);
    I->eraseFromParent();
}

but i dont know how can declare constptr.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111005/35b8a0c8/attachment.html>


More information about the llvm-dev mailing list