X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FIntrinsicInst.cpp;h=84addcc0aa9bbe6a37924b11e71eef940b00e3ff;hb=e81561909d128c6e2d8033cb5465a49b2596b26a;hp=9c2efc3881686aa6aa0529a04073a28830b83f3d;hpb=ca0dc56742986df05f9a7e0b425e2e798eaa2f92;p=oota-llvm.git diff --git a/lib/VMCore/IntrinsicInst.cpp b/lib/VMCore/IntrinsicInst.cpp index 9c2efc38816..84addcc0aa9 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; //===----------------------------------------------------------------------===// @@ -39,7 +37,7 @@ using namespace llvm; static Value *CastOperand(Value *C) { if (ConstantExpr *CE = dyn_cast(C)) - if (CE->getOpcode() == Instruction::Cast) + if (CE->isCast()) return CE->getOperand(0); return NULL; } @@ -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(getContext()); + if (!GV->hasInitializer()) return ""; ConstantStruct *CS = cast(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(getContext()); + if (!GV->hasInitializer()) return ""; ConstantStruct *CS = cast(GV->getInitializer()); return CS->getOperand(4)->getStringValue(); }