summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-08 23:23:25 +0000
committerChris Lattner <sabre@nondot.org>2010-03-08 23:23:25 +0000
commit27a973245022c0ed4e69b291daf79d6d99c1844f (patch)
treefbda319657b1f794e545e4b182b659b354b69d9d
parentd802615d0cc2444160f3f1130fda87dd0d93f6af (diff)
downloadbcm5719-llvm-27a973245022c0ed4e69b291daf79d6d99c1844f.tar.gz
bcm5719-llvm-27a973245022c0ed4e69b291daf79d6d99c1844f.zip
simplify EmitSectionOffset to always use .set if it is
available, the only thing this affects is that we produce .set in one case we didn't before, which shouldn't harm anything. Make EmitSectionOffset call EmitDifference instead of duplicating it. llvm-svn: 98005
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DIE.cpp4
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DIE.h5
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h2
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp2
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp33
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.h4
-rw-r--r--llvm/test/CodeGen/X86/aliases.ll2
8 files changed, 17 insertions, 39 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DIE.cpp b/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
index cc1027af319..d894ba72c0f 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
@@ -285,7 +285,7 @@ void DIELabel::print(raw_ostream &O) {
///
void DIESectionOffset::EmitValue(DwarfPrinter *D, unsigned Form) const {
bool IsSmall = Form == dwarf::DW_FORM_data4;
- D->EmitSectionOffset(Label, Section, IsSmall, IsEH, UseSet);
+ D->EmitSectionOffset(Label, Section, IsSmall, IsEH);
D->getAsm()->O << '\n'; // FIXME: Necesssary?
}
@@ -299,7 +299,7 @@ unsigned DIESectionOffset::SizeOf(const TargetData *TD, unsigned Form) const {
#ifndef NDEBUG
void DIESectionOffset::print(raw_ostream &O) {
O << "Off: " << Label->getName() << "-" << Section->getName()
- << "-" << IsEH << "-" << UseSet;
+ << "-" << IsEH;
}
#endif
diff --git a/llvm/lib/CodeGen/AsmPrinter/DIE.h b/llvm/lib/CodeGen/AsmPrinter/DIE.h
index b6a7fa89cf3..e08d748dc10 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DIE.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DIE.h
@@ -336,12 +336,11 @@ namespace llvm {
const MCSymbol *Label;
const MCSymbol *Section;
bool IsEH : 1;
- bool UseSet : 1;
public:
DIESectionOffset(const MCSymbol *Lab, const MCSymbol *Sec,
- bool isEH = false, bool useSet = true)
+ bool isEH = false)
: DIEValue(isSectionOffset), Label(Lab), Section(Sec),
- IsEH(isEH), UseSet(useSet) {}
+ IsEH(isEH) {}
/// EmitValue - Emit section offset.
///
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 247a3c57aab..9b50d91183f 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -376,8 +376,8 @@ void DwarfDebug::addLabel(DIE *Die, unsigned Attribute, unsigned Form,
///
void DwarfDebug::addSectionOffset(DIE *Die, unsigned Attribute, unsigned Form,
const MCSymbol *Label,const MCSymbol *Section,
- bool isEH, bool useSet) {
- DIEValue *Value = new DIESectionOffset(Label, Section, isEH, useSet);
+ bool isEH) {
+ DIEValue *Value = new DIESectionOffset(Label, Section, isEH);
DIEValues.push_back(Value);
Die->addValue(Attribute, Form, Value);
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index bd07b25d61c..2abad8aac2c 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -249,7 +249,7 @@ class DwarfDebug : public DwarfPrinter {
///
void addSectionOffset(DIE *Die, unsigned Attribute, unsigned Form,
const MCSymbol *Label, const MCSymbol *Section,
- bool isEH = false, bool useSet = true);
+ bool isEH = false);
/// addDelta - Add a label delta attribute data and value.
///
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
index b5c6bbe7054..6da90bb28c1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -232,7 +232,7 @@ void DwarfException::EmitFDE(const FunctionEHFrameInfo &EHFrameInfo) {
EmitSectionOffset(getDWLabel("eh_frame_begin", EHFrameInfo.Number),
getDWLabel("eh_frame_common",
EHFrameInfo.PersonalityIndex),
- true, true, false);
+ true, true);
EOL("FDE CIE offset");
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
index 23b2158272f..52a4055d157 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
@@ -278,39 +278,18 @@ void DwarfPrinter::EmitDifference(const MCSymbol *TagHi, const MCSymbol *TagLo,
void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label,
const MCSymbol *Section,
- bool IsSmall, bool isEH,
- bool useSet) {
+ bool IsSmall, bool isEH) {
bool printAbsolute = false;
if (isEH)
printAbsolute = MAI->isAbsoluteEHSectionOffsets();
else
printAbsolute = MAI->isAbsoluteDebugSectionOffsets();
- if (MAI->hasSetDirective() && useSet) {
- // FIXME: switch to OutStreamer.EmitAssignment.
- O << "\t.set\t";
- PrintLabelName("set", SetCounter, Flavor);
- O << ",";
- PrintLabelName(Label);
-
- if (!printAbsolute) {
- O << "-";
- PrintLabelName(Section);
- }
-
- O << "\n";
- PrintRelDirective(IsSmall);
- PrintLabelName("set", SetCounter, Flavor);
- ++SetCounter;
- } else {
- PrintRelDirective(IsSmall, true);
- PrintLabelName(Label);
-
- if (!printAbsolute) {
- O << "-";
- PrintLabelName(Section);
- }
- }
+ if (!printAbsolute)
+ return EmitDifference(Label, Section, IsSmall);
+
+ PrintRelDirective(IsSmall, true);
+ PrintLabelName(Label);
}
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.h b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.h
index 016553a6961..5228ca53032 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.h
@@ -139,9 +139,9 @@ public:
/// EmitDifference - Emit the difference between two labels.
void EmitDifference(const MCSymbol *LabelHi, const MCSymbol *LabelLo,
bool IsSmall = false);
+
void EmitSectionOffset(const MCSymbol *Label, const MCSymbol *Section,
- bool IsSmall = false, bool isEH = false,
- bool useSet = true);
+ bool IsSmall = false, bool isEH = false);
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
/// frame.
diff --git a/llvm/test/CodeGen/X86/aliases.ll b/llvm/test/CodeGen/X86/aliases.ll
index 3020eb3c719..753d5d9f6ce 100644
--- a/llvm/test/CodeGen/X86/aliases.ll
+++ b/llvm/test/CodeGen/X86/aliases.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -mtriple=i686-pc-linux-gnu -asm-verbose=false -o %t
; RUN: grep { = } %t | count 7
-; RUN: grep set %t | count 16
+; RUN: grep set %t | count 18
; RUN: grep globl %t | count 6
; RUN: grep weak %t | count 1
; RUN: grep hidden %t | count 1
OpenPOWER on IntegriCloud