summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-11-15 22:59:36 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-11-15 22:59:36 +0000
commit86a33487376848a606fdc629ffce2a581ae45653 (patch)
treec572ce5877bd5e81a09c01b7aed3ee5fb1f03ce3 /lib/CodeGen/AsmPrinter
parentef1b87a1adab4e1c0e47377668513d4d1a2e4946 (diff)
downloadllvm-86a33487376848a606fdc629ffce2a581ae45653.tar.gz
llvm-86a33487376848a606fdc629ffce2a581ae45653.tar.bz2
llvm-86a33487376848a606fdc629ffce2a581ae45653.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 1120279fe7..93de0185e4 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -99,11 +99,11 @@ int64_t CompileUnit::getDefaultLowerBound() const {
}
/// 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 MDNode *N) {
/// 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) const {
/// 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;
}