aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp5
-rw-r--r--lib/CodeGen/AsmPrinter/DIE.cpp23
-rw-r--r--lib/CodeGen/AsmPrinter/DIE.h30
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp13
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h6
5 files changed, 5 insertions, 72 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp b/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
index e7418d294b..98a1bf2f1c 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
@@ -177,8 +177,9 @@ void AsmPrinter::EmitReference(const GlobalValue *GV, unsigned Encoding)const{
void AsmPrinter::EmitSectionOffset(const MCSymbol *Label,
const MCSymbol *SectionLabel) const {
// On COFF targets, we have to emit the special .secrel32 directive.
- if (MAI->getDwarfSectionOffsetDirective()) {
- OutStreamer.EmitCOFFSecRel32(Label);
+ if (const char *SecOffDir = MAI->getDwarfSectionOffsetDirective()) {
+ // FIXME: MCize.
+ OutStreamer.EmitRawText(SecOffDir + Twine(Label->getName()));
return;
}
diff --git a/lib/CodeGen/AsmPrinter/DIE.cpp b/lib/CodeGen/AsmPrinter/DIE.cpp
index ff3c6da084..21396ca37f 100644
--- a/lib/CodeGen/AsmPrinter/DIE.cpp
+++ b/lib/CodeGen/AsmPrinter/DIE.cpp
@@ -277,29 +277,6 @@ void DIELabel::print(raw_ostream &O) {
#endif
//===----------------------------------------------------------------------===//
-// DIESectionOffset Implementation
-//===----------------------------------------------------------------------===//
-
-/// EmitValue - Emit label value.
-///
-void DIESectionOffset::EmitValue(AsmPrinter *AP, unsigned Form) const {
- AP->EmitSectionOffset (Label, Label);
-}
-
-/// SizeOf - Determine size of label value in bytes.
-///
-unsigned DIESectionOffset::SizeOf(AsmPrinter *AP, unsigned Form) const {
- if (Form == dwarf::DW_FORM_data4) return 4;
- return AP->getTargetData().getPointerSize();
-}
-
-#ifndef NDEBUG
-void DIESectionOffset::print(raw_ostream &O) {
- O << "SecRelLbl: " << Label->getName();
-}
-#endif
-
-//===----------------------------------------------------------------------===//
// DIEDelta Implementation
//===----------------------------------------------------------------------===//
diff --git a/lib/CodeGen/AsmPrinter/DIE.h b/lib/CodeGen/AsmPrinter/DIE.h
index bf5768a436..d56c094779 100644
--- a/lib/CodeGen/AsmPrinter/DIE.h
+++ b/lib/CodeGen/AsmPrinter/DIE.h
@@ -333,36 +333,6 @@ namespace llvm {
};
//===--------------------------------------------------------------------===//
- /// DIESectionOffset - A section relative label expression DIE.
- //
- class DIESectionOffset : public DIEValue {
- const MCSymbol *Label;
- public:
- explicit DIESectionOffset(const MCSymbol *L) : DIEValue(isSectionOffset),
- Label(L) {}
-
- /// EmitValue - Emit label value.
- ///
- virtual void EmitValue(AsmPrinter *AP, unsigned Form) const;
-
- /// getValue - Get MCSymbol.
- ///
- const MCSymbol *getValue() const { return Label; }
-
- /// SizeOf - Determine size of label value in bytes.
- ///
- virtual unsigned SizeOf(AsmPrinter *AP, unsigned Form) const;
-
- // Implement isa/cast/dyncast.
- static bool classof(const DIELabel *) { return true; }
- static bool classof(const DIEValue *L) { return L->getType() == isSectionOffset; }
-
-#ifndef NDEBUG
- virtual void print(raw_ostream &O);
-#endif
- };
-
- //===--------------------------------------------------------------------===//
/// DIEDelta - A simple label difference DIE.
///
class DIEDelta : public DIEValue {
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 9678078e76..780fa405ef 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -481,15 +481,6 @@ void DwarfDebug::addLabel(DIE *Die, unsigned Attribute, unsigned Form,
Die->addValue(Attribute, Form, Value);
}
-/// addSectionOffset - Add a Dwarf section relative label attribute data and
-/// value.
-///
-void DwarfDebug::addSectionOffset(DIE *Die, unsigned Attribute, unsigned Form,
- const MCSymbol *Label) {
- DIEValue *Value = new (DIEValueAllocator) DIESectionOffset(Label);
- Die->addValue(Attribute, Form, Value);
-}
-
/// addDelta - Add a label delta attribute data and value.
///
void DwarfDebug::addDelta(DIE *Die, unsigned Attribute, unsigned Form,
@@ -1913,8 +1904,8 @@ void DwarfDebug::constructCompileUnit(const MDNode *N) {
// DW_AT_stmt_list is a offset of line number information for this
// compile unit in debug_line section.
if (Asm->MAI->doesDwarfUsesAbsoluteLabelForStmtList())
- addSectionOffset(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_addr,
- Asm->GetTempSymbol("section_line"));
+ addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_addr,
+ Asm->GetTempSymbol("section_line"));
else
addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 2e920f502a..7df0510fbf 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -280,12 +280,6 @@ private:
void addLabel(DIE *Die, unsigned Attribute, unsigned Form,
const MCSymbol *Label);
- /// addSectionOffset - Add a Dwarf section relative label attribute data and
- /// value.
- ///
- void addSectionOffset(DIE *Die, unsigned Attribute, unsigned Form,
- const MCSymbol *Label);
-
/// addDelta - Add a label delta attribute data and value.
///
void addDelta(DIE *Die, unsigned Attribute, unsigned Form,