From c821f8794df9b634935ed33abe30f70ca5c3efd3 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 2 Nov 2014 07:11:55 +0000 Subject: [PATCH] Sink DwarfUnit::addExpr into DwarfCompileUnit git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221090 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 7 +++++++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 3 +++ lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 7 ------- lib/CodeGen/AsmPrinter/DwarfUnit.h | 3 --- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index b925929f9cd..630982aa514 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -820,4 +820,11 @@ void DwarfCompileUnit::applyVariableAttributes(const DbgVariable &Var, if (Var.isArtificial()) addFlag(VariableDie, dwarf::DW_AT_artificial); } + +/// Add a Dwarf expression attribute data and value. +void DwarfCompileUnit::addExpr(DIELoc &Die, dwarf::Form Form, + const MCExpr *Expr) { + DIEValue *Value = new (DIEValueAllocator) DIEExpr(Expr); + Die.addValue((dwarf::Attribute)0, Form, Value); +} } // end llvm namespace diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index 31d80364c61..1052ef92327 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -211,6 +211,9 @@ public: /// Add a Dwarf loclistptr attribute data and value. void addLocationList(DIE &Die, dwarf::Attribute Attribute, unsigned Index); void applyVariableAttributes(const DbgVariable &Var, DIE &VariableDie); + + /// Add a Dwarf expression attribute data and value. + void addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr); }; } // end llvm namespace diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 0062616d61f..986be9c37f4 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -225,13 +225,6 @@ void DwarfUnit::addLocalString(DIE &Die, dwarf::Attribute Attribute, Die.addValue(Attribute, dwarf::DW_FORM_strp, Str); } -/// addExpr - Add a Dwarf expression attribute data and value. -/// -void DwarfUnit::addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr) { - DIEValue *Value = new (DIEValueAllocator) DIEExpr(Expr); - Die.addValue((dwarf::Attribute)0, Form, Value); -} - /// addLabel - Add a Dwarf label attribute data and value. /// void DwarfUnit::addLabel(DIE &Die, dwarf::Attribute Attribute, dwarf::Form Form, diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.h b/lib/CodeGen/AsmPrinter/DwarfUnit.h index 5274108533c..cc9ae6fe6b3 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.h @@ -213,9 +213,6 @@ public: void addLocalString(DIE &Die, dwarf::Attribute Attribute, StringRef Str); - /// addExpr - Add a Dwarf expression attribute data and value. - void addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr); - /// addLabel - Add a Dwarf label attribute data and value. void addLabel(DIE &Die, dwarf::Attribute Attribute, dwarf::Form Form, const MCSymbol *Label); -- 2.34.1