mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-05 12:31:33 +00:00
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:
parent
58421d7d08
commit
ca0dc56742
@ -615,6 +615,12 @@ bool CompileUnitDesc::classof(const DebugInfoDesc *D) {
|
|||||||
void CompileUnitDesc::ApplyToFields(DIVisitor *Visitor) {
|
void CompileUnitDesc::ApplyToFields(DIVisitor *Visitor) {
|
||||||
AnchoredDesc::ApplyToFields(Visitor);
|
AnchoredDesc::ApplyToFields(Visitor);
|
||||||
|
|
||||||
|
// Handle cases out of sync with compiler.
|
||||||
|
if (getVersion() == 0) {
|
||||||
|
unsigned DebugVersion;
|
||||||
|
Visitor->Apply(DebugVersion);
|
||||||
|
}
|
||||||
|
|
||||||
Visitor->Apply(Language);
|
Visitor->Apply(Language);
|
||||||
Visitor->Apply(FileName);
|
Visitor->Apply(FileName);
|
||||||
Visitor->Apply(Directory);
|
Visitor->Apply(Directory);
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
|
#include "llvm/CodeGen/MachineDebugInfo.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
@ -59,12 +60,16 @@ Value *DbgInfoIntrinsic::StripCast(Value *C) {
|
|||||||
///
|
///
|
||||||
|
|
||||||
std::string DbgStopPointInst::getFileName() const {
|
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());
|
GlobalVariable *GV = cast<GlobalVariable>(getContext());
|
||||||
ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
|
ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
|
||||||
return CS->getOperand(3)->getStringValue();
|
return CS->getOperand(3)->getStringValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string DbgStopPointInst::getDirectory() const {
|
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());
|
GlobalVariable *GV = cast<GlobalVariable>(getContext());
|
||||||
ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
|
ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
|
||||||
return CS->getOperand(4)->getStringValue();
|
return CS->getOperand(4)->getStringValue();
|
||||||
|
Loading…
Reference in New Issue
Block a user