From: David Blaikie Date: Wed, 20 Nov 2013 18:40:16 +0000 (+0000) Subject: CR feedback for r195166: Add comments regarding type unit mapping and type units... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=89cadbe6b075f77f14544e1d93ceab6d9fe6e41c;p=oota-llvm.git CR feedback for r195166: Add comments regarding type unit mapping and type units disabling cross-CU sharing. Changes suggested by Manman Ren. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195262 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 2489002f7fd..688791e04ff 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -112,8 +112,13 @@ int64_t CompileUnit::getDefaultLowerBound() const { /// 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; diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index c3b12997317..5ba7cbf9d73 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -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* > > TypeUnits; // Whether to emit the pubnames/pubtypes sections.