Fix DbgStopPointInst->getFileName/getDirectory, broken by the MDNodification in
[oota-llvm.git] / lib / Analysis / ValueTracking.cpp
index cb2d624a9099adaaa09f6465d90f8ebe42a4c8e6..aa71f1dc678ec000f271f93d706c3593b269086a 100644 (file)
@@ -1058,6 +1058,11 @@ 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.