aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-28 23:41:32 +0000
committerChris Lattner <sabre@nondot.org>2009-12-28 23:41:32 +0000
commitdcf0657604692cafafdd6ff729087344271c2ace (patch)
tree9d5ea8aa8a5f0b166334346e372f143b832b9d03 /lib/Analysis/DebugInfo.cpp
parent67268e2168534252b20d27ab57f648ba663ae35d (diff)
downloadexternal_llvm-dcf0657604692cafafdd6ff729087344271c2ace.zip
external_llvm-dcf0657604692cafafdd6ff729087344271c2ace.tar.gz
external_llvm-dcf0657604692cafafdd6ff729087344271c2ace.tar.bz2
This is a major cleanup of the instruction metadata interfaces that
I asked Devang to do back on Sep 27. Instead of going through the MetadataContext class with methods like getMD() and getMDs(), just ask the instruction directly for its metadata with getMetadata() and getAllMetadata(). This includes a variety of other fixes and improvements: previously all Value*'s were bloated because the HasMetadata bit was thrown into value, adding a 9th bit to a byte. Now this is properly sunk down to the Instruction class (the only place where it makes sense) and it will be folded away somewhere soon. This also fixes some confusion in getMDs and its clients about whether the returned list is indexed by the MDID or densely packed. This is now returned sorted and densely packed and the comments make this clear. This introduces a number of fixme's which I'll follow up on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92235 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r--lib/Analysis/DebugInfo.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 3732818..256a7d1 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -1117,9 +1117,7 @@ Instruction *DIFactory::InsertDbgValueIntrinsic(Value *V, Value *Offset,
/// processModule - Process entire module and collect debug info.
void DebugInfoFinder::processModule(Module &M) {
-
- MetadataContext &TheMetadata = M.getContext().getMetadata();
- unsigned MDDbgKind = TheMetadata.getMDKindID("dbg");
+ unsigned MDDbgKind = M.getContext().getMetadata().getMDKindID("dbg");
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
for (Function::iterator FI = (*I).begin(), FE = (*I).end(); FI != FE; ++FI)
@@ -1127,7 +1125,7 @@ void DebugInfoFinder::processModule(Module &M) {
++BI) {
if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI))
processDeclare(DDI);
- else if (MDNode *L = TheMetadata.getMD(MDDbgKind, BI))
+ else if (MDNode *L = BI->getMetadata(MDDbgKind))
processLocation(DILocation(L));
}