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/Mips | |
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/Mips')
-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 |
3 files changed, 21 insertions, 7 deletions
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; } |