[llvm] r195262 - CR feedback for r195166: Add comments regarding type unit mapping and type units disabling cross-CU sharing.
David Blaikie
dblaikie at gmail.com
Wed Nov 20 10:40:16 PST 2013
Author: dblaikie
Date: Wed Nov 20 12:40:16 2013
New Revision: 195262
URL: http://llvm.org/viewvc/llvm-project?rev=195262&view=rev
Log:
CR feedback for r195166: Add comments regarding type unit mapping and type units disabling cross-CU sharing.
Changes suggested by Manman Ren.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=195262&r1=195261&r2=195262&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Wed Nov 20 12:40:16 2013
@@ -112,8 +112,13 @@ int64_t CompileUnit::getDefaultLowerBoun
/// Check whether the DIE for this MDNode can be shared across CUs.
static bool isShareableAcrossCUs(DIDescriptor D) {
- // When the MDNode can be part of the type system, the DIE can be
- // shared across CUs.
+ // When the MDNode can be part of the type system, the DIE can be shared
+ // across CUs.
+ // Combining type units and cross-CU DIE sharing is lower value (since
+ // cross-CU DIE sharing is used in LTO and removes type redundancy at that
+ // level already) but may be implementable for some value in projects
+ // building multiple independent libraries with LTO and then linking those
+ // together.
return (D.isType() ||
(D.isSubprogram() && !DISubprogram(D).isDefinition())) &&
!GenerateTypeUnits;
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=195262&r1=195261&r2=195262&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Wed Nov 20 12:40:16 2013
@@ -443,7 +443,11 @@ class DwarfDebug {
ImportedEntityMap;
ImportedEntityMap ScopesWithImportedEntities;
- // Holder for types that are going to be extracted out into a type unit.
+ // Map from type MDNodes to a pair used as a union. If the pointer is
+ // non-null, proxy DIEs in CUs meant to reference this type should be stored
+ // in the vector. The hash will be added to these DIEs once it is computed. If
+ // the pointer is null, the hash is immediately available in the uint64_t and
+ // should be directly used for proxy DIEs.
DenseMap<const MDNode *, std::pair<uint64_t, SmallVectorImpl<DIE*>* > > TypeUnits;
// Whether to emit the pubnames/pubtypes sections.
More information about the llvm-commits
mailing list