probinson added a comment.

Philosophically, mangled names and DWARF information serve different purposes, 
and I don't think you will find one true solution where both of them can yield 
the same name that everyone will be happy with.  Mangled names exist to provide 
unique and reproducible identifiers for the "same" entity across compilation 
units.  They are carefully specified (for example) to allow a linker to 
associate a reference in one object file to a definition in a different object 
file, and be guaranteed that the association is correct.  A demangled name is a 
necessarily context-free translation of the mangled name into something that 
has a closer relationship to how a human would think of or write the name of 
the thing, but isn't necessarily the only way to write the name of the thing.

DWARF names are (deliberately not carefully specified) strings that ought to 
bear some relationship to how source code would name the thing, but you 
probably don't want to attach semantic significance to those names.  This is 
rather emphatically true for names containing template parameters.  Typedefs 
(and their recent offspring, 'using' aliases) are your sworn enemy here.  
Enums, as you have found, are also a problem.

Basically, the type of an entity does not have a unique name, and trying to 
coerce different representations of the type into having the same unique name 
is a losing battle.


https://reviews.llvm.org/D39622



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to