Handle versioning of compile unit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28855 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Laskey 2006-06-19 12:54:15 +00:00
parent 58421d7d08
commit ca0dc56742
2 changed files with 11 additions and 0 deletions

View File

@ -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);

View File

@ -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();