The information about access and type sizes is necessary for producing TBAA metadata in the new size-aware format. With this patch, D39955 and D39956 in place we should be able to change CodeGenTBAA::createScalarTypeNode() and CodeGenTBAA::getBaseTypeInfo() to generate metadata in the new format under the -new-struct-path-tbaa command-line option. For now, this new information remains unused.
Details
- Reviewers
rjmccall hfinkel - Commits
- rG4e50e707bfd9: [CodeGen] Collect information about sizes of accesses and access types for TBAA
rC319012: [CodeGen] Collect information about sizes of accesses and access types for TBAA
rL319012: [CodeGen] Collect information about sizes of accesses and access types for TBAA
Diff Detail
Event Timeline
lib/CodeGen/CGClass.cpp | ||
---|---|---|
2426–2427 | Now that type and access descriptors include information about sizes, the function needs to know the type of the virtual table pointer to access. | |
lib/CodeGen/CodeGenModule.cpp | ||
139 | To clarify why we pass the module instead of LLVM context: we need it to compute the size of virtual table pointers as their types are llvm::Type types and not clang::Type or QualType ones. | |
585 | getAccessTagInfo() will raise an assertion failure if such an access descriptor is passed to it. This way we explicitly claim that generating access tags for incomplete objects is not allowed. |
Alright, I guess this all makes sense. We do have some extensions that are playing around with v-table pointers, so it's probably fair to require the v-table pointer type to be passed down instead of assuming it's just the generic pointer size.
Now that type and access descriptors include information about sizes, the function needs to know the type of the virtual table pointer to access.