summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-26 20:20:43 +0000
committerChris Lattner <sabre@nondot.org>2010-01-26 20:20:43 +0000
commit6a315c358ca35625ffd50fdc74556acb26ec7396 (patch)
tree2b26338011ae895a46df1ec241cda607f2ca8667
parentb3732fbabdab453a17a74f0fcce507d9567b8d6b (diff)
downloadllvm-6a315c358ca35625ffd50fdc74556acb26ec7396.tar.gz
llvm-6a315c358ca35625ffd50fdc74556acb26ec7396.tar.bz2
llvm-6a315c358ca35625ffd50fdc74556acb26ec7396.tar.xz
eliminate MCAsmInfo::NeedsSet: we now just use .set on any platform
that has it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94581 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/MC/MCAsmInfo.h14
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfPrinter.cpp9
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfPrinter.h4
-rw-r--r--lib/MC/MCAsmInfo.cpp1
-rw-r--r--lib/MC/MCAsmInfoDarwin.cpp1
-rw-r--r--lib/Target/CellSPU/SPUMCAsmInfo.cpp1
-rw-r--r--test/CodeGen/X86/aliases.ll2
7 files changed, 6 insertions, 26 deletions
diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h
index c4f15a09e7..614639e5bc 100644
--- a/include/llvm/MC/MCAsmInfo.h
+++ b/include/llvm/MC/MCAsmInfo.h
@@ -47,17 +47,6 @@ namespace llvm {
/// emitted in Static relocation model.
bool HasStaticCtorDtorReferenceInStaticMode; // Default is false.
- /// NeedsSet - True if target asm treats expressions in data directives
- /// as linktime-relocatable. For assembly-time computation, we need to
- /// use a .set. Thus:
- /// .set w, x-y
- /// .long w
- /// is computed at assembly time, while
- /// .long x-y
- /// is relocated if the relative locations of x and y change at linktime.
- /// We want both these things in different places.
- bool NeedsSet; // Defaults to false.
-
/// MaxInstLength - This is the maximum possible length of an instruction,
/// which is needed to compute the size of an inline asm.
unsigned MaxInstLength; // Defaults to 4.
@@ -321,9 +310,6 @@ namespace llvm {
bool hasStaticCtorDtorReferenceInStaticMode() const {
return HasStaticCtorDtorReferenceInStaticMode;
}
- bool needsSet() const {
- return NeedsSet;
- }
unsigned getMaxInstLength() const {
return MaxInstLength;
}
diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
index f2f444a13d..28e0d97ae7 100644
--- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
@@ -195,13 +195,12 @@ void DwarfPrinter::EmitReference(const MCSymbol *Sym, bool IsPCRelative,
if (IsPCRelative) O << "-" << MAI->getPCSymbol();
}
-/// EmitDifference - Emit the difference between two labels. Some assemblers do
-/// not behave with absolute expressions with data directives, so there is an
-/// option (needsSet) to use an intermediary set expression.
+/// EmitDifference - Emit the difference between two labels. If this assembler
+/// supports .set, we emit a .set of a temporary and then use it in the .word.
void DwarfPrinter::EmitDifference(const char *TagHi, unsigned NumberHi,
const char *TagLo, unsigned NumberLo,
bool IsSmall) {
- if (MAI->needsSet()) {
+ if (MAI->getSetDirective() != 0) {
O << "\t.set\t";
PrintLabelName("set", SetCounter, Flavor);
O << ",";
@@ -232,7 +231,7 @@ void DwarfPrinter::EmitSectionOffset(const char* Label, const char* Section,
else
printAbsolute = MAI->isAbsoluteDebugSectionOffsets();
- if (MAI->needsSet() && useSet) {
+ if (MAI->getSetDirective() != 0 && useSet) {
O << "\t.set\t";
PrintLabelName("set", SetCounter, Flavor);
O << ",";
diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.h b/lib/CodeGen/AsmPrinter/DwarfPrinter.h
index 86fe2abc88..31aa69ab09 100644
--- a/lib/CodeGen/AsmPrinter/DwarfPrinter.h
+++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.h
@@ -138,9 +138,7 @@ public:
void EmitReference(const MCSymbol *Sym, bool IsPCRelative = false,
bool Force32Bit = false) const;
- /// EmitDifference - Emit the difference between two labels. Some
- /// assemblers do not behave with absolute expressions with data directives,
- /// so there is an option (needsSet) to use an intermediary set expression.
+ /// EmitDifference - Emit the difference between two labels.
void EmitDifference(const DWLabel &LabelHi, const DWLabel &LabelLo,
bool IsSmall = false) {
EmitDifference(LabelHi.getTag(), LabelHi.getNumber(),
diff --git a/lib/MC/MCAsmInfo.cpp b/lib/MC/MCAsmInfo.cpp
index 796dcc4d33..4a86e1df89 100644
--- a/lib/MC/MCAsmInfo.cpp
+++ b/lib/MC/MCAsmInfo.cpp
@@ -22,7 +22,6 @@ MCAsmInfo::MCAsmInfo() {
HasSubsectionsViaSymbols = false;
HasMachoZeroFillDirective = false;
HasStaticCtorDtorReferenceInStaticMode = false;
- NeedsSet = false;
MaxInstLength = 4;
PCSymbol = "$";
SeparatorChar = ';';
diff --git a/lib/MC/MCAsmInfoDarwin.cpp b/lib/MC/MCAsmInfoDarwin.cpp
index 9902f501e4..2cf982f393 100644
--- a/lib/MC/MCAsmInfoDarwin.cpp
+++ b/lib/MC/MCAsmInfoDarwin.cpp
@@ -21,7 +21,6 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
GlobalPrefix = "_";
PrivateGlobalPrefix = "L";
LinkerPrivateGlobalPrefix = "l";
- NeedsSet = true;
AllowQuotesInName = true;
HasSingleParameterDotFile = false;
HasSubsectionsViaSymbols = true;
diff --git a/lib/Target/CellSPU/SPUMCAsmInfo.cpp b/lib/Target/CellSPU/SPUMCAsmInfo.cpp
index 03cdb2931d..c10b460e73 100644
--- a/lib/Target/CellSPU/SPUMCAsmInfo.cpp
+++ b/lib/Target/CellSPU/SPUMCAsmInfo.cpp
@@ -31,7 +31,6 @@ SPULinuxMCAsmInfo::SPULinuxMCAsmInfo(const Target &T, const StringRef &TT) {
HasDotLocAndDotFile = true;
SupportsDebugInformation = true;
- NeedsSet = true;
// Exception handling is not supported on CellSPU (think about it: you only
// have 256K for code+data. Would you support exception handling?)
diff --git a/test/CodeGen/X86/aliases.ll b/test/CodeGen/X86/aliases.ll
index 0b26859b04..a71aa92222 100644
--- a/test/CodeGen/X86/aliases.ll
+++ b/test/CodeGen/X86/aliases.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mtriple=i686-pc-linux-gnu -asm-verbose=false -o %t
-; RUN: grep set %t | count 7
+; RUN: grep set %t | count 23
; RUN: grep globl %t | count 6
; RUN: grep weak %t | count 1
; RUN: grep hidden %t | count 1