[cfe-dev] get source code with LLVM pass

Neng Chen cnisme.cn at gmail.com
Thu Nov 4 22:22:16 PDT 2010


 I wonder if there is any method to get the source code of a program with
LLVM pass in the bytecode file(*.ibc), Recently I have written an LLVM Pass
to iterate through functions, basic blocks and instructions


for (Module::iterator F = M.begin(), ME = M.end(); F != ME; ++F) {

    for (Function::iterator B = F->begin(), FE = F->end(); B != FE; ++B) {

        for (BasicBlock::iterator I = B->begin(), BE = B->end(); I != BE;
I++) {

             //code
             //how can I get the source code here

        }
    }
}


if we can get the source code, and how to get ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101105/cd8936a4/attachment.html>


More information about the cfe-dev mailing list