I just touch llvm source code for several days, and I didn’t know the interfaces of the analysises and transformations of LLVM. For exampe, how to backtrace CFG, and whether exits a backtracking interator to do such work?
For a novice, I also seek for suggestions about how to become familiar with LLVM interfaces as soon as possible. Now I have a plan to write a pass based on LLVM, and my first challenge is how to make the best use of LLVM’s analysis and transformations. Is it the best method to scan the source code, especially the “.h” files?
I just touch llvm source code for several days, and I didn't know the
interfaces of the analysises and transformations of LLVM. For exampe,
how to backtrace CFG, and whether exits a backtracking interator to do
such work?
For a novice, I also seek for suggestions about how to become familiar
with LLVM interfaces as soon as possible. Now I have a plan to write a
pass based on LLVM, and my first challenge is how to make the best use
of LLVM's analysis and transformations. Is it the best method to scan
the source code, especially the ".h" files?
Withe Best Regards!
novice
See the doc: Writing an LLVM Pass.
Understand the source in lib/Transforms and lib/Analysis
What LLVM interfaces you should learn mostly depends upon what you want
to do with LLVM.
Hi, Dear LLVMers
I just touch llvm source code for several days, and I didn't know the
interfaces of the analysises and transformations of LLVM. For exampe,
how to backtrace CFG, and whether exits a backtracking interator to do
such work?
For a novice, I also seek for suggestions about how to become familiar
with LLVM interfaces as soon as possible. Now I have a plan to write a
pass based on LLVM, and my first challenge is how to make the best use
of LLVM's analysis and transformations. Is it the best method to scan
the source code, especially the ".h" files?
Withe Best Regards!
novice
Understand the source in lib/Transforms and lib/Analysis
Sanjiv, do you mean that he should read some of the code in lib/Transforms and lib/Analysis as examples of LLVM passes? While I think examining a few LLVM passes as examples is good, I wouldn't recommend reading *all* of the source code in lib/Transforms and lib/Analysis. That is more than necessary.
What I would recommend is to read the doxygen documentation when you want to know the specific interfaces of a class (http://llvm.org/doxygen/). Doxygen can help narrow your code reading down to that code which you really need to read. For example, if you need dominator information, you can look up the DominatorTree class in doxygen to see what methods it provides.