[llvm-bugs] [Bug 35513] New: Inconsistencies between BuiltinType::getName and CGDebugInfo::CreateType
llvm-bugs at lists.llvm.org
Mon Dec 4 01:28:51 PST 2017
Bug ID: 35513
Summary: Inconsistencies between BuiltinType::getName and
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: gebhard at absint.com
CC: llvm-bugs at lists.llvm.org
Created attachment 19514
Example source code
I have noticed a minor inconsistency between how BuildinType are printing
opposing to what is exported in DWARF debug info.
This appears to affect long integer types only.
In "StringRef BuiltinType::getName(const PrintingPolicy &Policy) const",
Type.cpp:2580ff (https://clang.llvm.org/doxygen/Type_8cpp_source.html), long
integer types are printed as:
return "long long";
return "unsigned long";
return "unsigned long long";
where is in the DWARF debug info emitter, i.e., "llvm::DIType
CGDebugInfo::CreateType(const BuiltinType *BT)", CGDebugInfo.cpp:686ff (see
https://clang.llvm.org/doxygen/CGDebugInfo_8cpp_source.html), long integer
types are exported as:
BTName = "long int";
BTName = "long long int";
BTName = "long unsigned int";
BTName = "long long unsigned int";
This leads to problems when mapping class types printed via (Class is of type
'const clang::CXXRecordDecl *'):
and mapping that to the information we get from DWARF debug info as we can see
in the attached example.
Here, clang will print the pointer type of "ptr" as "Container<long>" whereas
in the debug info we get "Container<long int>".
Without additional post-processing to map DWARF debug information to the way
clang print types it is not possible to map both type names to each other.
Is it possible to unify this behavior to make clang in itself consistent?
Or is there some other way to achieve that behavior?
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs