summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Analysis/DbgInfoPrinter.cpp17
-rw-r--r--lib/Analysis/ValueTracking.cpp5
2 files changed, 7 insertions, 15 deletions
diff --git a/lib/Analysis/DbgInfoPrinter.cpp b/lib/Analysis/DbgInfoPrinter.cpp
index ab92e3f9bd..b90a996d82 100644
--- a/lib/Analysis/DbgInfoPrinter.cpp
+++ b/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) {
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp
index 22c6e3b6f1..acd3119abe 100644
--- a/lib/Analysis/ValueTracking.cpp
+++ b/lib/Analysis/ValueTracking.cpp
@@ -1369,11 +1369,6 @@ bool llvm::GetConstantStringInfo(Value *V, std::string &Str, uint64_t Offset,
StopAtNul);
}
- if (MDString *MDStr = dyn_cast<MDString>(V)) {
- Str = MDStr->getString();
- return true;
- }
-
// The GEP instruction, constant or instruction, must reference a global
// variable that is a constant and is initialized. The referenced constant
// initializer is the array that we'll use for optimization.