diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-19 22:42:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-19 22:42:28 +0000 |
commit | c7b8814bb4f2e6052060d6118d3bc3b66f5c5b0b (patch) | |
tree | 8ea6af8d6d1776b8e40c0feed7d63c85f182ae57 /lib/Target | |
parent | 67847538148ed956aaa14a07a77902fb991445f2 (diff) | |
download | llvm-c7b8814bb4f2e6052060d6118d3bc3b66f5c5b0b.tar.gz llvm-c7b8814bb4f2e6052060d6118d3bc3b66f5c5b0b.tar.bz2 llvm-c7b8814bb4f2e6052060d6118d3bc3b66f5c5b0b.tar.xz |
give MCAsmInfo a 'has little endian' bit. This is unfortunate, but
I really want clients of the streamer to be able to say "emit this
64-bit integer" and have it get broken down right by the streamer.
I may change this in the future, we'll see how it works out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ARM/ARMMCAsmInfo.cpp | 4 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaMCAsmInfo.cpp | 3 | ||||
-rw-r--r-- | lib/Target/Blackfin/BlackfinMCAsmInfo.cpp | 3 | ||||
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 4 | ||||
-rw-r--r-- | lib/Target/CellSPU/SPUMCAsmInfo.cpp | 3 | ||||
-rw-r--r-- | lib/Target/MSP430/MSP430MCAsmInfo.cpp | 3 | ||||
-rw-r--r-- | lib/Target/Mips/MipsMCAsmInfo.cpp | 3 | ||||
-rw-r--r-- | lib/Target/Mips/MipsMCAsmInfo.h | 18 | ||||
-rw-r--r-- | lib/Target/Mips/MipsTargetMachine.cpp | 7 | ||||
-rw-r--r-- | lib/Target/PIC16/PIC16MCAsmInfo.cpp | 3 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCMCAsmInfo.cpp | 4 | ||||
-rw-r--r-- | lib/Target/Sparc/SparcMCAsmInfo.cpp | 3 | ||||
-rw-r--r-- | lib/Target/SystemZ/SystemZMCAsmInfo.cpp | 3 | ||||
-rw-r--r-- | lib/Target/X86/X86MCAsmInfo.cpp | 12 | ||||
-rw-r--r-- | lib/Target/XCore/XCoreMCAsmInfo.cpp | 3 |
15 files changed, 51 insertions, 25 deletions
diff --git a/lib/Target/ARM/ARMMCAsmInfo.cpp b/lib/Target/ARM/ARMMCAsmInfo.cpp index 0ff65d2af8..a3499fa3cb 100644 --- a/lib/Target/ARM/ARMMCAsmInfo.cpp +++ b/lib/Target/ARM/ARMMCAsmInfo.cpp @@ -40,7 +40,7 @@ static const char *const arm_asm_table[] = { 0,0 }; -ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin() { +ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin() : MCAsmInfoDarwin(true) { AsmTransCBE = arm_asm_table; Data64bitsDirective = 0; CommentString = "@"; @@ -52,7 +52,7 @@ ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin() { AbsoluteEHSectionOffsets = false; } -ARMELFMCAsmInfo::ARMELFMCAsmInfo() { +ARMELFMCAsmInfo::ARMELFMCAsmInfo() : MCAsmInfo(true) { AlignmentIsInBytes = false; Data64bitsDirective = 0; CommentString = "@"; diff --git a/lib/Target/Alpha/AlphaMCAsmInfo.cpp b/lib/Target/Alpha/AlphaMCAsmInfo.cpp index b652a5305a..25443cc0c6 100644 --- a/lib/Target/Alpha/AlphaMCAsmInfo.cpp +++ b/lib/Target/Alpha/AlphaMCAsmInfo.cpp @@ -14,7 +14,8 @@ #include "AlphaMCAsmInfo.h" using namespace llvm; -AlphaMCAsmInfo::AlphaMCAsmInfo(const Target &T, const StringRef &TT) { +AlphaMCAsmInfo::AlphaMCAsmInfo(const Target &T, const StringRef &TT) + : MCAsmInfo(true) { AlignmentIsInBytes = false; PrivateGlobalPrefix = "$"; PICJumpTableDirective = ".gprel32"; diff --git a/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp b/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp index 6d0f66cd7a..368cd50ed9 100644 --- a/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp +++ b/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp @@ -15,7 +15,8 @@ using namespace llvm; -BlackfinMCAsmInfo::BlackfinMCAsmInfo(const Target &T, const StringRef &TT) { +BlackfinMCAsmInfo::BlackfinMCAsmInfo(const Target &T, const StringRef &TT) +: MCAsmInfo(true) { GlobalPrefix = "_"; CommentString = "//"; } diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 5015d1bcce..1feadd2a93 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -60,7 +60,7 @@ extern "C" void LLVMInitializeCBackendTarget() { namespace { class CBEMCAsmInfo : public MCAsmInfo { public: - CBEMCAsmInfo() { + CBEMCAsmInfo(bool isLE) : MCAsmInfo(isLE) { GlobalPrefix = ""; PrivateGlobalPrefix = ""; } @@ -1893,7 +1893,7 @@ bool CWriter::doInitialization(Module &M) { if (const Target *Match = TargetRegistry::lookupTarget(Triple, E)) TAsm = Match->createAsmInfo(Triple); #endif - TAsm = new CBEMCAsmInfo(); + TAsm = new CBEMCAsmInfo(TD->isLittleEndian()); Mang = new Mangler(*TAsm); // Keep track of which functions are static ctors/dtors so they can have diff --git a/lib/Target/CellSPU/SPUMCAsmInfo.cpp b/lib/Target/CellSPU/SPUMCAsmInfo.cpp index 1c921ab87f..3b43a7e209 100644 --- a/lib/Target/CellSPU/SPUMCAsmInfo.cpp +++ b/lib/Target/CellSPU/SPUMCAsmInfo.cpp @@ -14,7 +14,8 @@ #include "SPUMCAsmInfo.h" using namespace llvm; -SPULinuxMCAsmInfo::SPULinuxMCAsmInfo(const Target &T, const StringRef &TT) { +SPULinuxMCAsmInfo::SPULinuxMCAsmInfo(const Target &T, const StringRef &TT) + : MCAsmInfo(false) { ZeroDirective = "\t.space\t"; SetDirective = "\t.set"; Data64bitsDirective = "\t.quad\t"; diff --git a/lib/Target/MSP430/MSP430MCAsmInfo.cpp b/lib/Target/MSP430/MSP430MCAsmInfo.cpp index 516eacb535..92adc38169 100644 --- a/lib/Target/MSP430/MSP430MCAsmInfo.cpp +++ b/lib/Target/MSP430/MSP430MCAsmInfo.cpp @@ -14,7 +14,8 @@ #include "MSP430MCAsmInfo.h" using namespace llvm; -MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, const StringRef &TT) { +MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, const StringRef &TT) : + MCAsmInfo(true) { PrivateGlobalPrefix = ".L"; WeakRefDirective ="\t.weak\t"; SetDirective = "\t.set\t"; diff --git a/lib/Target/Mips/MipsMCAsmInfo.cpp b/lib/Target/Mips/MipsMCAsmInfo.cpp index 60ef1c9e4f..9a0c0bfdba 100644 --- a/lib/Target/Mips/MipsMCAsmInfo.cpp +++ b/lib/Target/Mips/MipsMCAsmInfo.cpp @@ -14,7 +14,8 @@ #include "MipsMCAsmInfo.h" using namespace llvm; -MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, const StringRef &TT) { +MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, const StringRef &TT, + bool isLittleEndian) : MCAsmInfo(isLittleEndian) { AlignmentIsInBytes = false; COMMDirectiveTakesAlignment = true; Data16bitsDirective = "\t.half\t"; diff --git a/lib/Target/Mips/MipsMCAsmInfo.h b/lib/Target/Mips/MipsMCAsmInfo.h index 33a4b5edb2..62ef463c0f 100644 --- a/lib/Target/Mips/MipsMCAsmInfo.h +++ b/lib/Target/Mips/MipsMCAsmInfo.h @@ -22,9 +22,23 @@ namespace llvm { class MipsMCAsmInfo : public MCAsmInfo { public: - explicit MipsMCAsmInfo(const Target &T, const StringRef &TT); + explicit MipsMCAsmInfo(const Target &T, const StringRef &TT, + bool isLittleEndian); + }; + + /// Big Endian MAI. + class MipsBEMCAsmInfo : public MipsMCAsmInfo { + public: + MipsBEMCAsmInfo(const Target &T, const StringRef &TT) + : MipsMCAsmInfo(T, TT, false) {} + }; + + /// Little Endian MAI. + class MipsLEMCAsmInfo : public MipsMCAsmInfo { + public: + MipsLEMCAsmInfo(const Target &T, const StringRef &TT) + : MipsMCAsmInfo(T, TT, true) {} }; - } // namespace llvm #endif diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp index 4724ff7d34..1168fef66e 100644 --- a/lib/Target/Mips/MipsTargetMachine.cpp +++ b/lib/Target/Mips/MipsTargetMachine.cpp @@ -22,8 +22,8 @@ extern "C" void LLVMInitializeMipsTarget() { // Register the target. RegisterTargetMachine<MipsTargetMachine> X(TheMipsTarget); RegisterTargetMachine<MipselTargetMachine> Y(TheMipselTarget); - RegisterAsmInfo<MipsMCAsmInfo> A(TheMipsTarget); - RegisterAsmInfo<MipsMCAsmInfo> B(TheMipselTarget); + RegisterAsmInfo<MipsBEMCAsmInfo> A(TheMipsTarget); + RegisterAsmInfo<MipsLEMCAsmInfo> B(TheMipselTarget); } // DataLayout --> Big-endian, 32-bit pointer/ABI/alignment @@ -60,8 +60,7 @@ MipselTargetMachine(const Target &T, const std::string &TT, // Install an instruction selector pass using // the ISelDag to gen Mips code. bool MipsTargetMachine:: -addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel) -{ +addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel) { PM.add(createMipsISelDag(*this)); return false; } diff --git a/lib/Target/PIC16/PIC16MCAsmInfo.cpp b/lib/Target/PIC16/PIC16MCAsmInfo.cpp index 827315e13b..a6331e64cc 100644 --- a/lib/Target/PIC16/PIC16MCAsmInfo.cpp +++ b/lib/Target/PIC16/PIC16MCAsmInfo.cpp @@ -20,7 +20,8 @@ #include "PIC16ISelLowering.h" using namespace llvm; -PIC16MCAsmInfo::PIC16MCAsmInfo(const Target &T, const StringRef &TT) { +PIC16MCAsmInfo::PIC16MCAsmInfo(const Target &T, const StringRef &TT) +: MCAsmInfo(true) { CommentString = ";"; GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL); GlobalDirective = "\tglobal\t"; diff --git a/lib/Target/PowerPC/PPCMCAsmInfo.cpp b/lib/Target/PowerPC/PPCMCAsmInfo.cpp index ee6deb5c50..12de9427f4 100644 --- a/lib/Target/PowerPC/PPCMCAsmInfo.cpp +++ b/lib/Target/PowerPC/PPCMCAsmInfo.cpp @@ -14,7 +14,7 @@ #include "PPCMCAsmInfo.h" using namespace llvm; -PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) { +PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) : MCAsmInfoDarwin(false) { PCSymbol = "."; CommentString = ";"; ExceptionsType = ExceptionHandling::Dwarf; @@ -25,7 +25,7 @@ PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) { SupportsDebugInformation= true; // Debug information. } -PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) { +PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) : MCAsmInfo(false) { CommentString = "#"; GlobalPrefix = ""; PrivateGlobalPrefix = ".L"; diff --git a/lib/Target/Sparc/SparcMCAsmInfo.cpp b/lib/Target/Sparc/SparcMCAsmInfo.cpp index b67537c178..cb6da961b8 100644 --- a/lib/Target/Sparc/SparcMCAsmInfo.cpp +++ b/lib/Target/Sparc/SparcMCAsmInfo.cpp @@ -15,7 +15,8 @@ #include "llvm/ADT/SmallVector.h" using namespace llvm; -SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, const StringRef &TT) { +SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, const StringRef &TT) + : MCAsmInfo(/*isLittleEndian*/ false) { Data16bitsDirective = "\t.half\t"; Data32bitsDirective = "\t.word\t"; Data64bitsDirective = 0; // .xword is only supported by V9. diff --git a/lib/Target/SystemZ/SystemZMCAsmInfo.cpp b/lib/Target/SystemZ/SystemZMCAsmInfo.cpp index 8ea11c95b2..c17535f4e2 100644 --- a/lib/Target/SystemZ/SystemZMCAsmInfo.cpp +++ b/lib/Target/SystemZ/SystemZMCAsmInfo.cpp @@ -14,7 +14,8 @@ #include "SystemZMCAsmInfo.h" using namespace llvm; -SystemZMCAsmInfo::SystemZMCAsmInfo(const Target &T, const StringRef &TT) { +SystemZMCAsmInfo::SystemZMCAsmInfo(const Target &T, const StringRef &TT) +: MCAsmInfo(false) { AlignmentIsInBytes = true; PrivateGlobalPrefix = ".L"; diff --git a/lib/Target/X86/X86MCAsmInfo.cpp b/lib/Target/X86/X86MCAsmInfo.cpp index 001ce80728..bba36e86ca 100644 --- a/lib/Target/X86/X86MCAsmInfo.cpp +++ b/lib/Target/X86/X86MCAsmInfo.cpp @@ -43,7 +43,8 @@ static const char *const x86_asm_table[] = { "{cc}", "cc", 0,0}; -X86MCAsmInfoDarwin::X86MCAsmInfoDarwin(const Triple &Triple) { +X86MCAsmInfoDarwin::X86MCAsmInfoDarwin(const Triple &Triple) + : MCAsmInfoDarwin(true /*islittleendian*/) { AsmTransCBE = x86_asm_table; AssemblerDialect = AsmWriterFlavor; @@ -68,7 +69,8 @@ X86MCAsmInfoDarwin::X86MCAsmInfoDarwin(const Triple &Triple) { AbsoluteEHSectionOffsets = false; } -X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &Triple) { +X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &Triple) + : MCAsmInfo(true /*islittleendian*/) { AsmTransCBE = x86_asm_table; AssemblerDialect = AsmWriterFlavor; @@ -93,13 +95,15 @@ X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &Triple) { NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits"; } -X86MCAsmInfoCOFF::X86MCAsmInfoCOFF(const Triple &Triple) { +X86MCAsmInfoCOFF::X86MCAsmInfoCOFF(const Triple &Triple) + : MCAsmInfoCOFF(true /*islittleendian*/) { AsmTransCBE = x86_asm_table; AssemblerDialect = AsmWriterFlavor; } -X86WinMCAsmInfo::X86WinMCAsmInfo(const Triple &Triple) { +X86WinMCAsmInfo::X86WinMCAsmInfo(const Triple &Triple) + : MCAsmInfo(true /*islittleendian*/) { AsmTransCBE = x86_asm_table; AssemblerDialect = AsmWriterFlavor; diff --git a/lib/Target/XCore/XCoreMCAsmInfo.cpp b/lib/Target/XCore/XCoreMCAsmInfo.cpp index dffdda9a1f..b6c0cfccf9 100644 --- a/lib/Target/XCore/XCoreMCAsmInfo.cpp +++ b/lib/Target/XCore/XCoreMCAsmInfo.cpp @@ -10,7 +10,8 @@ #include "XCoreMCAsmInfo.h" using namespace llvm; -XCoreMCAsmInfo::XCoreMCAsmInfo(const Target &T, const StringRef &TT) { +XCoreMCAsmInfo::XCoreMCAsmInfo(const Target &T, const StringRef &TT) +: MCAsmInfo(true) { SupportsDebugInformation = true; Data16bitsDirective = "\t.short\t"; Data32bitsDirective = "\t.long\t"; |