I try to understand LLVM program high level structure. I read in the book that "programs are composed of modules ,each of which correspons to tranlation unit".Can someone explain me in more details the above and what is the diffrenece between modules and translation units(if any). I am also interested to know which part of the code is called when translation unit starts and completes debugging information encoding?
相关问题
- Pass custom debug information to Microsoft bot fra
- How do I identify what code is generating “ '&
- CMakeList file to generate LLVM bitcode file from
- Monodevelop: `Waiting for debugger`
- LLVM OPT not giving optimised file as output.
相关文章
- How do I get to see DbgPrint output from my kernel
- Advanced profiling is unavailable for the selected
- Can't Inspect Variables When Debugging .NET As
- What is the difference between glibc's MALLOC_
- Embedding a program's source code into its bin
- How to execute another python script from your scr
- How do I debug errors that have no error message?
- Any way in Visual Studio to not break on throwing
Translation unit is term from language standard. For example, this is from C (c99 iso draft)
So, translation unit is the single source file (
file.c
) after preprocessing (all#include
d*.h
files instantiated, all macro are expanded, all comments are skipped, and file is ready for tokenizing).Translation unit is a unit of compiling, because it didn't depend on any external resource until linking step. All headers are within TU.
Term module is not defined in the language standard, but it AFAIK refers to
translation unit
at deeper translation phases.LLVM describes it as: http://llvm.org/docs/ProgrammersManual.html
About this part of your question:
This depends on how LLVM is used. LLVM itself is a library and can be used in various ways.
For clang/LLVM (C/C++ complier build on libclang and LLVM) the translation unit created after preprocessing stage. It will be parsed into AST, then into LLVM assembly and saved in Module.
For tutorial example, here is a creation of Modules http://llvm.org/releases/2.6/docs/tutorial/JITTutorial1.html