OLD | NEW |
(Empty) | |
| 1 //===-- ARMAsmBackendNaClELF.h ARM Asm Backend NaCl ELF --------*- C++ -*-===// |
| 2 // |
| 3 // The LLVM Compiler Infrastructure |
| 4 // |
| 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. |
| 7 // |
| 8 //===----------------------------------------------------------------------===// |
| 9 |
| 10 #ifndef LLVM_LIB_TARGET_ARM_ARMASMBACKENDNACLELF_H |
| 11 #define LLVM_LIB_TARGET_ARM_ARMASMBACKENDNACLELF_H |
| 12 |
| 13 // This whole file is a @LOCALMOD |
| 14 #include "MCTargetDesc/ARMAsmBackendELF.h" |
| 15 #include "MCTargetDesc/ARMMCNaCl.h" |
| 16 |
| 17 using namespace llvm; |
| 18 |
| 19 namespace { |
| 20 class ARMAsmBackendNaClELF : public ARMAsmBackendELF { |
| 21 public: |
| 22 ARMAsmBackendNaClELF(const Target &T, const StringRef TT, uint8_t _OSABI, |
| 23 bool isLittle) |
| 24 : ARMAsmBackendELF(T, TT, _OSABI, isLittle), |
| 25 STI(ARM_MC::createARMMCSubtargetInfo(TT, "", "")) { |
| 26 assert(isLittle && "NaCl only supports little-endian"); |
| 27 State.SaveCount = 0; |
| 28 State.I = 0; |
| 29 State.RecursiveCall = false; |
| 30 } |
| 31 |
| 32 ~ARMAsmBackendNaClELF() override {} |
| 33 |
| 34 bool CustomExpandInst(const MCInst &Inst, MCStreamer &Out) override { |
| 35 return CustomExpandInstNaClARM(*STI, Inst, Out, State); |
| 36 } |
| 37 |
| 38 private: |
| 39 // TODO(jfb) When upstreaming this class we can drop STI since ARMAsmBackend |
| 40 // already has one. It's unfortunately private so we recreate one |
| 41 // here to avoid the extra localmod. |
| 42 std::unique_ptr<MCSubtargetInfo> STI; |
| 43 ARMMCNaClSFIState State; |
| 44 }; |
| 45 } // end anonymous namespace |
| 46 |
| 47 #endif |
OLD | NEW |