mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-30 04:56:49 +00:00
Add the source language into the compile unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151143 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e2dc9336d1
commit
438b092a4b
@ -32,8 +32,9 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
/// CompileUnit - Compile unit constructor.
|
/// CompileUnit - Compile unit constructor.
|
||||||
CompileUnit::CompileUnit(unsigned I, DIE *D, AsmPrinter *A, DwarfDebug *DW)
|
CompileUnit::CompileUnit(unsigned I, unsigned L, DIE *D, AsmPrinter *A,
|
||||||
: ID(I), CUDie(D), Asm(A), DD(DW), IndexTyDie(0) {
|
DwarfDebug *DW)
|
||||||
|
: ID(I), Language(L), CUDie(D), Asm(A), DD(DW), IndexTyDie(0) {
|
||||||
DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1);
|
DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,10 @@ class CompileUnit {
|
|||||||
///
|
///
|
||||||
unsigned ID;
|
unsigned ID;
|
||||||
|
|
||||||
|
/// Language - The DW_AT_language of the compile unit
|
||||||
|
///
|
||||||
|
unsigned Language;
|
||||||
|
|
||||||
/// Die - Compile unit debug information entry.
|
/// Die - Compile unit debug information entry.
|
||||||
///
|
///
|
||||||
const OwningPtr<DIE> CUDie;
|
const OwningPtr<DIE> CUDie;
|
||||||
@ -76,11 +80,12 @@ class CompileUnit {
|
|||||||
DenseMap<DIE *, const MDNode *> ContainingTypeMap;
|
DenseMap<DIE *, const MDNode *> ContainingTypeMap;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CompileUnit(unsigned I, DIE *D, AsmPrinter *A, DwarfDebug *DW);
|
CompileUnit(unsigned I, unsigned L, DIE *D, AsmPrinter *A, DwarfDebug *DW);
|
||||||
~CompileUnit();
|
~CompileUnit();
|
||||||
|
|
||||||
// Accessors.
|
// Accessors.
|
||||||
unsigned getID() const { return ID; }
|
unsigned getID() const { return ID; }
|
||||||
|
unsigned getLanguage() const { return Language; }
|
||||||
DIE* getCUDie() const { return CUDie.get(); }
|
DIE* getCUDie() const { return CUDie.get(); }
|
||||||
const StringMap<DIE*> &getGlobalTypes() const { return GlobalTypes; }
|
const StringMap<DIE*> &getGlobalTypes() const { return GlobalTypes; }
|
||||||
|
|
||||||
|
@ -550,7 +550,7 @@ CompileUnit *DwarfDebug::constructCompileUnit(const MDNode *N) {
|
|||||||
unsigned ID = GetOrCreateSourceID(FN, CompilationDir);
|
unsigned ID = GetOrCreateSourceID(FN, CompilationDir);
|
||||||
|
|
||||||
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
|
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
|
||||||
CompileUnit *NewCU = new CompileUnit(ID, Die, Asm, this);
|
CompileUnit *NewCU = new CompileUnit(ID, DIUnit.getLanguage(), Die, Asm, this);
|
||||||
NewCU->addString(Die, dwarf::DW_AT_producer, DIUnit.getProducer());
|
NewCU->addString(Die, dwarf::DW_AT_producer, DIUnit.getProducer());
|
||||||
NewCU->addUInt(Die, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
|
NewCU->addUInt(Die, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
|
||||||
DIUnit.getLanguage());
|
DIUnit.getLanguage());
|
||||||
|
Loading…
Reference in New Issue
Block a user