summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-30 19:40:05 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-30 19:40:05 +0000
commitab659fb3d03005114e176cb86449636e0635f16a (patch)
tree8382ab9e3536192f4e3e815e6ff85a6dbb89a687 /llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
parent364266663bc16789c0fd07fe6ed5e5e8049573f4 (diff)
downloadbcm5719-llvm-ab659fb3d03005114e176cb86449636e0635f16a.tar.gz
bcm5719-llvm-ab659fb3d03005114e176cb86449636e0635f16a.zip
IR: Use the new DebugLoc API, NFC
Update lib/IR and lib/Bitcode to use the new `DebugLoc` API. Added an explicit conversion to `bool` (avoiding a conversion to `MDLocation`), since a couple of these use cases need to handle broken code. llvm-svn: 233585
Diffstat (limited to 'llvm/lib/Bitcode/Writer/ValueEnumerator.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/ValueEnumerator.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
index 549e94fc96a..a450f697f20 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -373,12 +373,10 @@ ValueEnumerator::ValueEnumerator(const Module &M)
for (unsigned i = 0, e = MDs.size(); i != e; ++i)
EnumerateMetadata(MDs[i].second);
- if (!I.getDebugLoc().isUnknown()) {
- MDNode *Scope, *IA;
- I.getDebugLoc().getScopeAndInlinedAt(Scope, IA, I.getContext());
- if (Scope) EnumerateMetadata(Scope);
- if (IA) EnumerateMetadata(IA);
- }
+ // Don't enumerate the location directly -- it has a special record
+ // type -- but enumerate its operands.
+ if (MDLocation *L = I.getDebugLoc())
+ EnumerateMDNodeOperands(L);
}
}
OpenPOWER on IntegriCloud