Do better with physical reg operands (typically, from inline asm)
[oota-llvm.git] / lib / Analysis / DbgInfoPrinter.cpp
index 2bbe2e0ecb4f77f8682b7f259683d66b8c95ddf5..b90a996d820c9b5d984093473073611a45175833 100644 (file)
@@ -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"
@@ -35,7 +34,7 @@ PrintDirectory("print-fullpath",
                cl::Hidden);
 
 namespace {
-  class VISIBILITY_HIDDEN PrintDbgInfo : public FunctionPass {
+  class PrintDbgInfo : public FunctionPass {
     raw_ostream &Out;
     void printStopPoint(const DbgStopPointInst *DSI);
     void printFuncStart(const DbgFuncStartInst *FS);
@@ -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) {