kobe James
2011-Jul-13 23:16 UTC
[LLVMdev] Is it possible to store some info and use it after emitting the bitcode file?
Hi All, Specifically, the problem is that I want to insert a string into the source code. When the source code is compiled by the compiler into bitcode file such info will be extracted and stored somewhere else, and the compiler only compiles the original source code. An example is like: a1.cpp: int main() { int a = 0; cout << a << endl; } I'd like to insert one string a2.cpp: int main() { CheckSthHere; int a = 0; cout << a << endl; } I hope to extract such information out a2.cpp and compile only a1.cpp. After compiling a1.cpp into bitcode file I can still get that string information back and do some analysis. Is this possible? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110714/e9540c7c/attachment.html>
Devang Patel
2011-Jul-14 17:29 UTC
[LLVMdev] Is it possible to store some info and use it after emitting the bitcode file?
On Jul 13, 2011, at 4:16 PM, kobe James wrote:> Hi All, > > Specifically, the problem is that I want to insert a string into the source code. When the source code is compiled by the compiler into bitcode file such info will be extracted and stored somewhere else, and the compiler only compiles the original source code. > An example is like: > a1.cpp: > int main() > { > int a = 0; > cout << a << endl; > } > > I'd like to insert one string > a2.cpp: > int main() > { > CheckSthHere; > int a = 0; > cout << a << endl; > } > > I hope to extract such information out a2.cpp and compile only a1.cpp. After compiling a1.cpp into bitcode file I can still get that string information back and do some analysis. > > Is this possible?See if http://llvm.org/docs/LangRef.html#int_annotation helps. - Devang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110714/3b3d5566/attachment.html>