summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-26 20:40:54 +0000
committerChris Lattner <sabre@nondot.org>2010-01-26 20:40:54 +0000
commitff234e09b9058b04bb1e699e3d4a82d2c8263439 (patch)
treeac3b9097ab0ad2ca483f4e14524d42383faefa77 /llvm/lib
parentf0ed69cb5b5e436d61f24683ce658e861592a366 (diff)
downloadbcm5719-llvm-ff234e09b9058b04bb1e699e3d4a82d2c8263439.tar.gz
bcm5719-llvm-ff234e09b9058b04bb1e699e3d4a82d2c8263439.zip
Eliminate SetDirective, and replace it with HasSetDirective.
Default HasSetDirective to true, since most targets have it. The targets that claim to not have it probably do, or it is spelled differently. These include Blackfin, Mips, Alpha, and PIC16. All of these except pic16 are normal ELF targets, so they almost certainly have it. llvm-svn: 94585
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp10
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp4
-rw-r--r--llvm/lib/MC/MCAsmInfo.cpp2
-rw-r--r--llvm/lib/MC/MCAsmInfoCOFF.cpp1
-rw-r--r--llvm/lib/MC/MCAsmInfoDarwin.cpp1
-rw-r--r--llvm/lib/Target/ARM/ARMMCAsmInfo.cpp1
-rw-r--r--llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp4
-rw-r--r--llvm/lib/Target/Alpha/AlphaMCAsmInfo.cpp1
-rw-r--r--llvm/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp1
-rw-r--r--llvm/lib/Target/CellSPU/SPUMCAsmInfo.cpp1
-rw-r--r--llvm/lib/Target/MSP430/MSP430MCAsmInfo.cpp1
-rw-r--r--llvm/lib/Target/Mips/MipsMCAsmInfo.cpp1
-rw-r--r--llvm/lib/Target/PIC16/PIC16MCAsmInfo.cpp2
-rw-r--r--llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp1
-rw-r--r--llvm/lib/Target/Sparc/SparcMCAsmInfo.cpp1
-rw-r--r--llvm/lib/Target/SystemZ/SystemZMCAsmInfo.cpp1
-rw-r--r--llvm/lib/Target/X86/X86MCAsmInfo.cpp1
-rw-r--r--llvm/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp2
-rw-r--r--llvm/lib/Target/XCore/XCoreMCAsmInfo.cpp1
19 files changed, 15 insertions, 22 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 42bf35213e3..d2c1721012a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -318,7 +318,7 @@ bool AsmPrinter::doFinalization(Module &M) {
}
}
- if (MAI->getSetDirective()) {
+ if (MAI->hasSetDirective()) {
OutStreamer.AddBlankLine();
for (Module::const_alias_iterator I = M.alias_begin(), E = M.alias_end();
I != E; ++I) {
@@ -336,7 +336,7 @@ bool AsmPrinter::doFinalization(Module &M) {
printVisibility(Name, I->getVisibility());
- O << MAI->getSetDirective() << ' ' << *Name << ", " << *Target << '\n';
+ O << "\t.set\t" << *Name << ", " << *Target << '\n';
}
}
@@ -516,7 +516,7 @@ void AsmPrinter::EmitJumpTableInfo(MachineFunction &MF) {
// .set directive for each unique entry. This reduces the number of
// relocations the assembler will generate for the jump table.
if (MJTI->getEntryKind() == MachineJumpTableInfo::EK_LabelDifference32 &&
- MAI->getSetDirective()) {
+ MAI->hasSetDirective()) {
SmallPtrSet<const MachineBasicBlock*, 16> EmittedSets;
const TargetLowering *TLI = TM.getTargetLowering();
const MCExpr *Base = TLI->getPICJumpTableRelocBaseExpr(&MF, JTI,
@@ -525,7 +525,7 @@ void AsmPrinter::EmitJumpTableInfo(MachineFunction &MF) {
const MachineBasicBlock *MBB = JTBBs[ii];
if (!EmittedSets.insert(MBB)) continue;
- O << MAI->getSetDirective() << ' '
+ O << "\t.set\t"
<< *GetJTSetSymbol(JTI, MBB->getNumber()) << ','
<< *MBB->getSymbol(OutContext) << '-' << *Base << '\n';
}
@@ -584,7 +584,7 @@ void AsmPrinter::EmitJumpTableEntry(const MachineJumpTableInfo *MJTI,
// If we have emitted set directives for the jump table entries, print
// them rather than the entries themselves. If we're emitting PIC, then
// emit the table entries as differences between two text section labels.
- if (MAI->getSetDirective()) {
+ if (MAI->hasSetDirective()) {
// If we used .set, reference the .set's symbol.
Value = MCSymbolRefExpr::Create(GetJTSetSymbol(UID, MBB->getNumber()),
OutContext);
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
index 28e0d97ae71..f659c51908b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
@@ -200,7 +200,7 @@ void DwarfPrinter::EmitReference(const MCSymbol *Sym, bool IsPCRelative,
void DwarfPrinter::EmitDifference(const char *TagHi, unsigned NumberHi,
const char *TagLo, unsigned NumberLo,
bool IsSmall) {
- if (MAI->getSetDirective() != 0) {
+ if (MAI->hasSetDirective()) {
O << "\t.set\t";
PrintLabelName("set", SetCounter, Flavor);
O << ",";
@@ -231,7 +231,7 @@ void DwarfPrinter::EmitSectionOffset(const char* Label, const char* Section,
else
printAbsolute = MAI->isAbsoluteDebugSectionOffsets();
- if (MAI->getSetDirective() != 0 && useSet) {
+ if (MAI->hasSetDirective() && useSet) {
O << "\t.set\t";
PrintLabelName("set", SetCounter, Flavor);
O << ",";
diff --git a/llvm/lib/MC/MCAsmInfo.cpp b/llvm/lib/MC/MCAsmInfo.cpp
index 12d2fcbadc6..74bacfc9d3f 100644
--- a/llvm/lib/MC/MCAsmInfo.cpp
+++ b/llvm/lib/MC/MCAsmInfo.cpp
@@ -49,7 +49,7 @@ MCAsmInfo::MCAsmInfo() {
TextAlignFillValue = 0;
GPRel32Directive = 0;
GlobalDirective = "\t.globl\t";
- SetDirective = 0;
+ HasSetDirective = true;
HasLCOMMDirective = false;
COMMDirectiveAlignmentIsInBytes = true;
HasDotTypeDotSizeDirective = true;
diff --git a/llvm/lib/MC/MCAsmInfoCOFF.cpp b/llvm/lib/MC/MCAsmInfoCOFF.cpp
index ab8a585480f..ace7ba1e793 100644
--- a/llvm/lib/MC/MCAsmInfoCOFF.cpp
+++ b/llvm/lib/MC/MCAsmInfoCOFF.cpp
@@ -25,7 +25,6 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() {
PrivateGlobalPrefix = "L"; // Prefix for private global symbols
WeakRefDirective = "\t.weak\t";
LinkOnceDirective = "\t.linkonce same_size\n";
- SetDirective = "\t.set\t";
// Doesn't support visibility:
HiddenVisibilityAttr = ProtectedVisibilityAttr = MCSA_Invalid;
diff --git a/llvm/lib/MC/MCAsmInfoDarwin.cpp b/llvm/lib/MC/MCAsmInfoDarwin.cpp
index e84131f5990..da865ad9dc7 100644
--- a/llvm/lib/MC/MCAsmInfoDarwin.cpp
+++ b/llvm/lib/MC/MCAsmInfoDarwin.cpp
@@ -36,7 +36,6 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
HasMachoZeroFillDirective = true; // Uses .zerofill
HasStaticCtorDtorReferenceInStaticMode = true;
- SetDirective = "\t.set";
HiddenVisibilityAttr = MCSA_PrivateExtern;
// Doesn't support protected visibility.
diff --git a/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp b/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp
index 911a71fbdd8..ccd6addd82b 100644
--- a/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp
@@ -62,7 +62,6 @@ ARMELFMCAsmInfo::ARMELFMCAsmInfo() {
AbsoluteDebugSectionOffsets = true;
PrivateGlobalPrefix = ".L";
WeakRefDirective = "\t.weak\t";
- SetDirective = "\t.set\t";
HasLCOMMDirective = true;
DwarfRequiresFrameSection = false;
diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
index bb6fc2f2dfa..2b0b77acdb7 100644
--- a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
@@ -939,14 +939,14 @@ void ARMAsmPrinter::printJTBlockOperand(const MachineInstr *MI, int OpNum) {
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
const std::vector<MachineBasicBlock*> &JTBBs = JT[JTI].MBBs;
- bool UseSet= MAI->getSetDirective() && TM.getRelocationModel() == Reloc::PIC_;
+ bool UseSet= MAI->hasSetDirective() && TM.getRelocationModel() == Reloc::PIC_;
SmallPtrSet<MachineBasicBlock*, 8> JTSets;
for (unsigned i = 0, e = JTBBs.size(); i != e; ++i) {
MachineBasicBlock *MBB = JTBBs[i];
bool isNew = JTSets.insert(MBB);
if (UseSet && isNew) {
- O << MAI->getSetDirective() << ' '
+ O << "\t.set\t"
<< *GetARMSetPICJumpTableLabel2(JTI, MO2.getImm(), MBB) << ','
<< *MBB->getSymbol(OutContext) << '-' << *JTISymbol << '\n';
}
diff --git a/llvm/lib/Target/Alpha/AlphaMCAsmInfo.cpp b/llvm/lib/Target/Alpha/AlphaMCAsmInfo.cpp
index 0e63582faca..c67c6a235b1 100644
--- a/llvm/lib/Target/Alpha/AlphaMCAsmInfo.cpp
+++ b/llvm/lib/Target/Alpha/AlphaMCAsmInfo.cpp
@@ -19,4 +19,5 @@ AlphaMCAsmInfo::AlphaMCAsmInfo(const Target &T, const StringRef &TT) {
PrivateGlobalPrefix = "$";
GPRel32Directive = ".gprel32";
WeakRefDirective = "\t.weak\t";
+ HasSetDirective = false;
}
diff --git a/llvm/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp b/llvm/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp
index 6d0f66cd7a5..31470fb35b9 100644
--- a/llvm/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp
+++ b/llvm/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp
@@ -18,4 +18,5 @@ using namespace llvm;
BlackfinMCAsmInfo::BlackfinMCAsmInfo(const Target &T, const StringRef &TT) {
GlobalPrefix = "_";
CommentString = "//";
+ HasSetDirective = false;
}
diff --git a/llvm/lib/Target/CellSPU/SPUMCAsmInfo.cpp b/llvm/lib/Target/CellSPU/SPUMCAsmInfo.cpp
index c10b460e733..5ef3c6b24de 100644
--- a/llvm/lib/Target/CellSPU/SPUMCAsmInfo.cpp
+++ b/llvm/lib/Target/CellSPU/SPUMCAsmInfo.cpp
@@ -16,7 +16,6 @@ using namespace llvm;
SPULinuxMCAsmInfo::SPULinuxMCAsmInfo(const Target &T, const StringRef &TT) {
ZeroDirective = "\t.space\t";
- SetDirective = "\t.set";
Data64bitsDirective = "\t.quad\t";
AlignmentIsInBytes = false;
HasLCOMMDirective = true;
diff --git a/llvm/lib/Target/MSP430/MSP430MCAsmInfo.cpp b/llvm/lib/Target/MSP430/MSP430MCAsmInfo.cpp
index 516eacb5356..cfb499d1323 100644
--- a/llvm/lib/Target/MSP430/MSP430MCAsmInfo.cpp
+++ b/llvm/lib/Target/MSP430/MSP430MCAsmInfo.cpp
@@ -17,7 +17,6 @@ using namespace llvm;
MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, const StringRef &TT) {
PrivateGlobalPrefix = ".L";
WeakRefDirective ="\t.weak\t";
- SetDirective = "\t.set\t";
PCSymbol=".";
CommentString = ";";
diff --git a/llvm/lib/Target/Mips/MipsMCAsmInfo.cpp b/llvm/lib/Target/Mips/MipsMCAsmInfo.cpp
index c5356f0e23a..89e3e11b0a7 100644
--- a/llvm/lib/Target/Mips/MipsMCAsmInfo.cpp
+++ b/llvm/lib/Target/Mips/MipsMCAsmInfo.cpp
@@ -23,4 +23,5 @@ MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, const StringRef &TT) {
CommentString = "#";
ZeroDirective = "\t.space\t";
GPRel32Directive = "\t.gpword\t";
+ HasSetDirective = false;
}
diff --git a/llvm/lib/Target/PIC16/PIC16MCAsmInfo.cpp b/llvm/lib/Target/PIC16/PIC16MCAsmInfo.cpp
index 827315e13b7..b08054270ce 100644
--- a/llvm/lib/Target/PIC16/PIC16MCAsmInfo.cpp
+++ b/llvm/lib/Target/PIC16/PIC16MCAsmInfo.cpp
@@ -37,7 +37,7 @@ PIC16MCAsmInfo::PIC16MCAsmInfo(const Target &T, const StringRef &TT) {
RomData8bitsDirective = " dw ";
RomData16bitsDirective = " rom_di ";
RomData32bitsDirective = " rom_dl ";
-
+ HasSetDirective = false;
// Set it to false because we weed to generate c file name and not bc file
// name.
diff --git a/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp b/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp
index c61627ec533..b0d04e46e09 100644
--- a/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp
+++ b/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp
@@ -49,7 +49,6 @@ PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
AbsoluteEHSectionOffsets = false;
ZeroDirective = "\t.space\t";
- SetDirective = "\t.set";
Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
HasLCOMMDirective = true;
AssemblerDialect = 0; // Old-Style mnemonics.
diff --git a/llvm/lib/Target/Sparc/SparcMCAsmInfo.cpp b/llvm/lib/Target/Sparc/SparcMCAsmInfo.cpp
index 923181d7e44..53a9bde9252 100644
--- a/llvm/lib/Target/Sparc/SparcMCAsmInfo.cpp
+++ b/llvm/lib/Target/Sparc/SparcMCAsmInfo.cpp
@@ -29,7 +29,6 @@ SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, const StringRef &TT) {
UsesELFSectionDirectiveForBSS = true;
WeakRefDirective = "\t.weak\t";
- SetDirective = "\t.set\t";
PrivateGlobalPrefix = ".L";
}
diff --git a/llvm/lib/Target/SystemZ/SystemZMCAsmInfo.cpp b/llvm/lib/Target/SystemZ/SystemZMCAsmInfo.cpp
index 52d4d5149c6..1a0920609b1 100644
--- a/llvm/lib/Target/SystemZ/SystemZMCAsmInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZMCAsmInfo.cpp
@@ -18,7 +18,6 @@ using namespace llvm;
SystemZMCAsmInfo::SystemZMCAsmInfo(const Target &T, const StringRef &TT) {
PrivateGlobalPrefix = ".L";
WeakRefDirective = "\t.weak\t";
- SetDirective = "\t.set\t";
PCSymbol = ".";
}
diff --git a/llvm/lib/Target/X86/X86MCAsmInfo.cpp b/llvm/lib/Target/X86/X86MCAsmInfo.cpp
index c0cab869794..d3b00521aa0 100644
--- a/llvm/lib/Target/X86/X86MCAsmInfo.cpp
+++ b/llvm/lib/Target/X86/X86MCAsmInfo.cpp
@@ -72,7 +72,6 @@ X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &Triple) {
PrivateGlobalPrefix = ".L";
WeakRefDirective = "\t.weak\t";
- SetDirective = "\t.set\t";
PCSymbol = ".";
// Set up DWARF directives
diff --git a/llvm/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp b/llvm/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
index e955ef96ee0..15b454861e3 100644
--- a/llvm/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
+++ b/llvm/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
@@ -106,7 +106,7 @@ void XCoreAsmPrinter::emitArrayBound(const MCSymbol *Sym,
cast<PointerType>(GV->getType())->getElementType())) {
O << MAI->getGlobalDirective() << *Sym;
O << ".globound" << "\n";
- O << MAI->getSetDirective() << *Sym;
+ O << "\t.set\t" << *Sym;
O << ".globound" << "," << ATy->getNumElements() << "\n";
if (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()) {
// TODO Use COMDAT groups for LinkOnceLinkage
diff --git a/llvm/lib/Target/XCore/XCoreMCAsmInfo.cpp b/llvm/lib/Target/XCore/XCoreMCAsmInfo.cpp
index dffdda9a1fd..bf785755db4 100644
--- a/llvm/lib/Target/XCore/XCoreMCAsmInfo.cpp
+++ b/llvm/lib/Target/XCore/XCoreMCAsmInfo.cpp
@@ -22,7 +22,6 @@ XCoreMCAsmInfo::XCoreMCAsmInfo(const Target &T, const StringRef &TT) {
AscizDirective = ".asciiz";
WeakDefDirective = "\t.weak\t";
WeakRefDirective = "\t.weak\t";
- SetDirective = "\t.set\t";
// Debug
HasLEB128 = true;
OpenPOWER on IntegriCloud