Reputation: 1
I searched the source code of LLVM, but I failed to find the exact code slices which show how LLVM generate bitcodes(IR) for structure. I search the keyword 'StructType::create' and 'StructType::get', but there are so many occurrences. Could anyone tell me where to find the exact code slices. My purpose is to change the order of elements in a structure and something else. Thank you.
Upvotes: 0
Views: 192
Reputation: 26868
The component which is responsible for initially generating the IR is called a front-end. The LLVM core itself does not contain any front-ends, but there are many front-ends written that target it, most famously Clang - a C, C++ and Objective-C front-end for LLVM.
So if by "generate bitcode for structure" you mean "generate bitcode for C structure", then the code responsible for it will be in Clang. Specifically, the CGRecordLayout
and CGRecordLayoutBuilder
classes are responsible for creating the LLVM struct type.
Upvotes: 1