diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/MachineDebugInfo.cpp | 6 | ||||
-rw-r--r-- | lib/VMCore/IntrinsicInst.cpp | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp index 97fecb482b..706beb8a8c 100644 --- a/lib/CodeGen/MachineDebugInfo.cpp +++ b/lib/CodeGen/MachineDebugInfo.cpp @@ -614,6 +614,12 @@ bool CompileUnitDesc::classof(const DebugInfoDesc *D) { /// void CompileUnitDesc::ApplyToFields(DIVisitor *Visitor) { AnchoredDesc::ApplyToFields(Visitor); + + // Handle cases out of sync with compiler. + if (getVersion() == 0) { + unsigned DebugVersion; + Visitor->Apply(DebugVersion); + } Visitor->Apply(Language); Visitor->Apply(FileName); diff --git a/lib/VMCore/IntrinsicInst.cpp b/lib/VMCore/IntrinsicInst.cpp index 2f3ade34c1..9c2efc3881 100644 --- a/lib/VMCore/IntrinsicInst.cpp +++ b/lib/VMCore/IntrinsicInst.cpp @@ -29,6 +29,7 @@ #include "llvm/Constants.h" #include "llvm/GlobalVariable.h" +#include "llvm/CodeGen/MachineDebugInfo.h" using namespace llvm; @@ -59,12 +60,16 @@ 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"); GlobalVariable *GV = cast<GlobalVariable>(getContext()); 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"); GlobalVariable *GV = cast<GlobalVariable>(getContext()); ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer()); return CS->getOperand(4)->getStringValue(); |