For PR950:
[oota-llvm.git] / lib / VMCore / IntrinsicInst.cpp
index 9c2efc3881686aa6aa0529a04073a28830b83f3d..5c43b6f5e1d9a724343159e9edfe39f5f1f59f88 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #include "llvm/IntrinsicInst.h"
-
 #include "llvm/Constants.h"
 #include "llvm/GlobalVariable.h"
 #include "llvm/CodeGen/MachineDebugInfo.h"
-
 using namespace llvm;
 
 //===----------------------------------------------------------------------===//
@@ -61,16 +59,18 @@ Value *DbgInfoIntrinsic::StripCast(Value *C) {
 
 std::string DbgStopPointInst::getFileName() const {
   // Once the operand indices are verified, update this assert
-  assert(LLVMDebugVersion == (4 << 16) && "Verify operand indices");
+  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();
 }
 
 std::string DbgStopPointInst::getDirectory() const {
   // Once the operand indices are verified, update this assert
-  assert(LLVMDebugVersion == (4 << 16) && "Verify operand indices");
+  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();
 }