From: Jim Laskey Date: Mon, 19 Jun 2006 12:54:15 +0000 (+0000) Subject: Handle versioning of compile unit. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ca0dc56742986df05f9a7e0b425e2e798eaa2f92;p=oota-llvm.git Handle versioning of compile unit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28855 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp index 97fecb482ba..706beb8a8c3 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 2f3ade34c13..9c2efc38816 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(getContext()); 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"); GlobalVariable *GV = cast(getContext()); ConstantStruct *CS = cast(GV->getInitializer()); return CS->getOperand(4)->getStringValue();