aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-08-26 23:50:38 +0000
committerEric Christopher <echristo@gmail.com>2013-08-26 23:50:38 +0000
commit7b87895a6c7307a0ee809659abdaefe4a48b6bc6 (patch)
tree6244a0e5fd4ddbc6233a124538db34f8b677ab57 /lib
parente3e5f77d77e7ccc5c966e242f0cd0ccf6d3dae7f (diff)
downloadexternal_llvm-7b87895a6c7307a0ee809659abdaefe4a48b6bc6.zip
external_llvm-7b87895a6c7307a0ee809659abdaefe4a48b6bc6.tar.gz
external_llvm-7b87895a6c7307a0ee809659abdaefe4a48b6bc6.tar.bz2
Remove the language parameter and variable from the compile unit. We
can get it via the MDNode that's passed in. Save that instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp12
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.h10
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp10
3 files changed, 16 insertions, 16 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 2c21142..8cef3e2 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -33,10 +33,10 @@
using namespace llvm;
/// CompileUnit - Compile unit constructor.
-CompileUnit::CompileUnit(unsigned UID, unsigned L, DIE *D, const MDNode *N,
- AsmPrinter *A, DwarfDebug *DW, DwarfUnits *DWU)
- : UniqueID(UID), Language(L), CUDie(D), Asm(A), DD(DW), DU(DWU),
- IndexTyDie(0), DebugInfoOffset(0) {
+CompileUnit::CompileUnit(unsigned UID, DIE *D, const MDNode *N, AsmPrinter *A,
+ DwarfDebug *DW, DwarfUnits *DWU)
+ : UniqueID(UID), Node(N), CUDie(D), Asm(A), DD(DW), DU(DWU), IndexTyDie(0),
+ DebugInfoOffset(0) {
DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1);
insertDIE(N, D);
}
@@ -57,7 +57,7 @@ DIEEntry *CompileUnit::createDIEEntry(DIE *Entry) {
/// getDefaultLowerBound - Return the default lower bound for an array. If the
/// DWARF version doesn't handle the language, return -1.
int64_t CompileUnit::getDefaultLowerBound() const {
- switch (Language) {
+ switch (DICompileUnit(Node).getLanguage()) {
default:
break;
@@ -971,6 +971,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
}
// Add prototype flag if we're dealing with a C language and the
// function has been prototyped.
+ uint16_t Language = DICompileUnit(Node).getLanguage();
if (isPrototyped &&
(Language == dwarf::DW_LANG_C89 ||
Language == dwarf::DW_LANG_C99 ||
@@ -1244,6 +1245,7 @@ DIE *CompileUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
// Add the prototype if we have a prototype and we have a C like
// language.
+ uint16_t Language = DICompileUnit(Node).getLanguage();
if (SP.isPrototyped() &&
(Language == dwarf::DW_LANG_C89 ||
Language == dwarf::DW_LANG_C99 ||
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
index 92c56db..7713c02 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
@@ -39,9 +39,8 @@ class CompileUnit {
///
unsigned UniqueID;
- /// Language - The DW_AT_language of the compile unit
- ///
- unsigned Language;
+ /// Node - MDNode for the compile unit.
+ const MDNode *Node;
/// Die - Compile unit debug information entry.
///
@@ -96,13 +95,14 @@ class CompileUnit {
int64_t getDefaultLowerBound() const;
public:
- CompileUnit(unsigned UID, unsigned L, DIE *D, const MDNode *N, AsmPrinter *A,
+ CompileUnit(unsigned UID, DIE *D, const MDNode *N, AsmPrinter *A,
DwarfDebug *DW, DwarfUnits *DWU);
~CompileUnit();
// Accessors.
unsigned getUniqueID() const { return UniqueID; }
- unsigned getLanguage() const { return Language; }
+ uint16_t getLanguage() const { return DICompileUnit(Node).getLanguage(); }
+ const MDNode *getNode() const { return Node; }
DIE* getCUDie() const { return CUDie.get(); }
unsigned getDebugInfoOffset() const { return DebugInfoOffset; }
const StringMap<DIE*> &getGlobalNames() const { return GlobalNames; }
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 600e233..6d1f5af 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -696,9 +696,8 @@ CompileUnit *DwarfDebug::constructCompileUnit(const MDNode *N) {
CompilationDir = DIUnit.getDirectory();
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
- CompileUnit *NewCU = new CompileUnit(GlobalCUIndexCount++,
- DIUnit.getLanguage(), Die, N, Asm,
- this, &InfoHolder);
+ CompileUnit *NewCU =
+ new CompileUnit(GlobalCUIndexCount++, Die, N, Asm, this, &InfoHolder);
FileIDCUMap[NewCU->getUniqueID()] = 0;
// Call this to emit a .file directive if it wasn't emitted for the source
@@ -2691,9 +2690,8 @@ CompileUnit *DwarfDebug::constructSkeletonCU(const MDNode *N) {
CompilationDir = DIUnit.getDirectory();
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
- CompileUnit *NewCU = new CompileUnit(GlobalCUIndexCount++,
- DIUnit.getLanguage(), Die, N, Asm,
- this, &SkeletonHolder);
+ CompileUnit *NewCU =
+ new CompileUnit(GlobalCUIndexCount++, Die, N, Asm, this, &SkeletonHolder);
NewCU->addLocalString(Die, dwarf::DW_AT_GNU_dwo_name,
DIUnit.getSplitDebugFilename());