[llvm] r194871 - DwarfCompileUnit: Push DIDescriptor usage out from isShareableAcrossCUs
David Blaikie
dblaikie at gmail.com
Fri Nov 15 14:59:36 PST 2013
Author: dblaikie
Date: Fri Nov 15 16:59:36 2013
New Revision: 194871
URL: http://llvm.org/viewvc/llvm-project?rev=194871&view=rev
Log:
DwarfCompileUnit: Push DIDescriptor usage out from isShareableAcrossCUs
This is the first of a few similar patches. We'll see how far it
goes/makes sense.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=194871&r1=194870&r2=194871&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Fri Nov 15 16:59:36 2013
@@ -99,11 +99,11 @@ int64_t CompileUnit::getDefaultLowerBoun
}
/// Check whether the DIE for this MDNode can be shared across CUs.
-static bool isShareableAcrossCUs(const MDNode *N) {
+static bool isShareableAcrossCUs(DIDescriptor D) {
// When the MDNode can be part of the type system, the DIE can be
// shared across CUs.
- return DIDescriptor(N).isType() ||
- (DIDescriptor(N).isSubprogram() && !DISubprogram(N).isDefinition());
+ return D.isType() ||
+ (D.isSubprogram() && !DISubprogram(D).isDefinition());
}
/// getDIE - Returns the debug information entry map slot for the
@@ -111,7 +111,7 @@ static bool isShareableAcrossCUs(const M
/// when the DIE for this MDNode can be shared across CUs. The mappings
/// will be kept in DwarfDebug for shareable DIEs.
DIE *CompileUnit::getDIE(const MDNode *N) const {
- if (isShareableAcrossCUs(N))
+ if (isShareableAcrossCUs(DIDescriptor(N)))
return DD->getDIE(N);
return MDNodeToDieMap.lookup(N);
}
@@ -120,7 +120,7 @@ DIE *CompileUnit::getDIE(const MDNode *N
/// when the DIE for this MDNode can be shared across CUs. The mappings
/// will be kept in DwarfDebug for shareable DIEs.
void CompileUnit::insertDIE(const MDNode *N, DIE *D) {
- if (isShareableAcrossCUs(N)) {
+ if (isShareableAcrossCUs(DIDescriptor(N))) {
DD->insertDIE(N, D);
return;
}
More information about the llvm-commits
mailing list