diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-15 19:34:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-15 19:34:20 +0000 |
commit | a3aef788ec802875e26fc014a4040a024eb2b506 (patch) | |
tree | 92471879e0ce8bdb3c16b125ca8fcd0928d50021 /llvm/lib/Analysis/DbgInfoPrinter.cpp | |
parent | 38c4f4b5d12789311d41ad1f1bccbaf2f84d148c (diff) | |
download | bcm5719-llvm-a3aef788ec802875e26fc014a4040a024eb2b506.tar.gz bcm5719-llvm-a3aef788ec802875e26fc014a4040a024eb2b506.zip |
Fix GetConstantStringInfo to not look into MDString (it works on
real data, not metadata) and fix DbgInfoPrinter to not abuse
GetConstantStringInfo.
llvm-svn: 91444
Diffstat (limited to 'llvm/lib/Analysis/DbgInfoPrinter.cpp')
-rw-r--r-- | llvm/lib/Analysis/DbgInfoPrinter.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/lib/Analysis/DbgInfoPrinter.cpp b/llvm/lib/Analysis/DbgInfoPrinter.cpp index ab92e3f9bd5..b90a996d820 100644 --- a/llvm/lib/Analysis/DbgInfoPrinter.cpp +++ b/llvm/lib/Analysis/DbgInfoPrinter.cpp @@ -22,7 +22,6 @@ #include "llvm/Assembly/Writer.h" #include "llvm/Analysis/DebugInfo.h" #include "llvm/Analysis/Passes.h" -#include "llvm/Analysis/ValueTracking.h" #include "llvm/Support/CFG.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/raw_ostream.h" @@ -75,18 +74,16 @@ void PrintDbgInfo::printVariableDeclaration(const Value *V) { } void PrintDbgInfo::printStopPoint(const DbgStopPointInst *DSI) { - if (PrintDirectory) { - std::string dir; - GetConstantStringInfo(DSI->getDirectory(), dir); - Out << dir << "/"; - } + if (PrintDirectory) + if (MDString *Str = dyn_cast<MDString>(DSI->getDirectory())) + Out << Str->getString() << '/'; - std::string file; - GetConstantStringInfo(DSI->getFileName(), file); - Out << file << ":" << DSI->getLine(); + if (MDString *Str = dyn_cast<MDString>(DSI->getFileName())) + Out << Str->getString(); + Out << ':' << DSI->getLine(); if (unsigned Col = DSI->getColumn()) - Out << ":" << Col; + Out << ':' << Col; } void PrintDbgInfo::printFuncStart(const DbgFuncStartInst *FS) { |