aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/IntrinsicInst.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/IntrinsicInst.cpp')
-rw-r--r--lib/VMCore/IntrinsicInst.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VMCore/IntrinsicInst.cpp b/lib/VMCore/IntrinsicInst.cpp
index a85d9a4b22..5c43b6f5e1 100644
--- a/lib/VMCore/IntrinsicInst.cpp
+++ b/lib/VMCore/IntrinsicInst.cpp
@@ -26,11 +26,9 @@
//===----------------------------------------------------------------------===//
#include "llvm/IntrinsicInst.h"
-
#include "llvm/Constants.h"
#include "llvm/GlobalVariable.h"
#include "llvm/CodeGen/MachineDebugInfo.h"
-
using namespace llvm;
//===----------------------------------------------------------------------===//
@@ -63,6 +61,7 @@ std::string DbgStopPointInst::getFileName() const {
// Once the operand indices are verified, update this assert
assert(LLVMDebugVersion == (5 << 16) && "Verify operand indices");
GlobalVariable *GV = cast<GlobalVariable>(getContext());
+ if (!GV->hasInitializer()) return "";
ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
return CS->getOperand(3)->getStringValue();
}
@@ -71,6 +70,7 @@ std::string DbgStopPointInst::getDirectory() const {
// Once the operand indices are verified, update this assert
assert(LLVMDebugVersion == (5 << 16) && "Verify operand indices");
GlobalVariable *GV = cast<GlobalVariable>(getContext());
+ if (!GV->hasInitializer()) return "";
ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
return CS->getOperand(4)->getStringValue();
}