Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(710)

Unified Diff: lib/Target/ARM/MCTargetDesc/ARMAsmBackendNaClELF.h

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp ('k') | lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Target/ARM/MCTargetDesc/ARMAsmBackendNaClELF.h
diff --git a/lib/Target/ARM/MCTargetDesc/ARMAsmBackendNaClELF.h b/lib/Target/ARM/MCTargetDesc/ARMAsmBackendNaClELF.h
new file mode 100644
index 0000000000000000000000000000000000000000..c2caf15bd16ceaab0a2c46959944d1d4c573e23c
--- /dev/null
+++ b/lib/Target/ARM/MCTargetDesc/ARMAsmBackendNaClELF.h
@@ -0,0 +1,47 @@
+//===-- ARMAsmBackendNaClELF.h ARM Asm Backend NaCl ELF --------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIB_TARGET_ARM_ARMASMBACKENDNACLELF_H
+#define LLVM_LIB_TARGET_ARM_ARMASMBACKENDNACLELF_H
+
+// This whole file is a @LOCALMOD
+#include "MCTargetDesc/ARMAsmBackendELF.h"
+#include "MCTargetDesc/ARMMCNaCl.h"
+
+using namespace llvm;
+
+namespace {
+class ARMAsmBackendNaClELF : public ARMAsmBackendELF {
+public:
+ ARMAsmBackendNaClELF(const Target &T, const StringRef TT, uint8_t _OSABI,
+ bool isLittle)
+ : ARMAsmBackendELF(T, TT, _OSABI, isLittle),
+ STI(ARM_MC::createARMMCSubtargetInfo(TT, "", "")) {
+ assert(isLittle && "NaCl only supports little-endian");
+ State.SaveCount = 0;
+ State.I = 0;
+ State.RecursiveCall = false;
+ }
+
+ ~ARMAsmBackendNaClELF() override {}
+
+ bool CustomExpandInst(const MCInst &Inst, MCStreamer &Out) override {
+ return CustomExpandInstNaClARM(*STI, Inst, Out, State);
+ }
+
+private:
+ // TODO(jfb) When upstreaming this class we can drop STI since ARMAsmBackend
+ // already has one. It's unfortunately private so we recreate one
+ // here to avoid the extra localmod.
+ std::unique_ptr<MCSubtargetInfo> STI;
+ ARMMCNaClSFIState State;
+};
+} // end anonymous namespace
+
+#endif
« no previous file with comments | « lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp ('k') | lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698