X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FIntrinsicInst.cpp;h=5c43b6f5e1d9a724343159e9edfe39f5f1f59f88;hb=b83eb6447ba155342598f0fabe1f08f5baa9164a;hp=8bdb944373a463c7d5ec7e4820b2e6ad627a1034;hpb=0bd135db5942c4cbd5bef11cf21814bf5d1d1037;p=oota-llvm.git diff --git a/lib/VMCore/IntrinsicInst.cpp b/lib/VMCore/IntrinsicInst.cpp index 8bdb944373a..5c43b6f5e1d 100644 --- a/lib/VMCore/IntrinsicInst.cpp +++ b/lib/VMCore/IntrinsicInst.cpp @@ -26,10 +26,9 @@ //===----------------------------------------------------------------------===// #include "llvm/IntrinsicInst.h" - #include "llvm/Constants.h" #include "llvm/GlobalVariable.h" - +#include "llvm/CodeGen/MachineDebugInfo.h" using namespace llvm; //===----------------------------------------------------------------------===// @@ -45,13 +44,13 @@ static Value *CastOperand(Value *C) { Value *DbgInfoIntrinsic::StripCast(Value *C) { if (Value *CO = CastOperand(C)) { - return StripCast(CO); + C = StripCast(CO); } else if (GlobalVariable *GV = dyn_cast(C)) { if (GV->hasInitializer()) if (Value *CO = CastOperand(GV->getInitializer())) - return StripCast(CO); + C = StripCast(CO); } - return C; + return dyn_cast(C); } //===----------------------------------------------------------------------===// @@ -59,15 +58,23 @@ Value *DbgInfoIntrinsic::StripCast(Value *C) { /// std::string DbgStopPointInst::getFileName() const { + // Once the operand indices are verified, update this assert + 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(); + return CS->getOperand(3)->getStringValue(); } std::string DbgStopPointInst::getDirectory() const { + // Once the operand indices are verified, update this assert + assert(LLVMDebugVersion == (5 << 16) && "Verify operand indices"); GlobalVariable *GV = cast(getContext()); + if (!GV->hasInitializer()) return ""; ConstantStruct *CS = cast(GV->getInitializer()); - return CS->getOperand(5)->getStringValue(); + return CS->getOperand(4)->getStringValue(); } //===----------------------------------------------------------------------===// +/// Ensure that users of IntrinsicInst.h will link with this module. +DEFINING_FILE_FOR(IntrinsicInst)