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

Unified Diff: lib/Target/X86/X86AsmPrinter.cpp

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/X86/X86AsmPrinter.h ('k') | lib/Target/X86/X86CallingConv.td » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Target/X86/X86AsmPrinter.cpp
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp
index 4e5b7b8804df97ba94379c5be41a6801dedd6d16..92598d0a004bc4e810308fd01eaf1bacd121bed3 100644
--- a/lib/Target/X86/X86AsmPrinter.cpp
+++ b/lib/Target/X86/X86AsmPrinter.cpp
@@ -30,6 +30,7 @@
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
+#include "llvm/MC/MCNaCl.h" // @LOCALMOD
#include "llvm/MC/MCSectionCOFF.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCStreamer.h"
@@ -71,6 +72,35 @@ bool X86AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
return false;
}
+// @LOCALMOD-BEGIN
+bool X86AsmPrinter::UseReadOnlyJumpTables() const {
+ return Subtarget->isTargetNaCl();
+}
+
+unsigned X86AsmPrinter::GetTargetBasicBlockAlign() const {
+ if (Subtarget->isTargetNaCl())
+ return 5;
+ return 0;
+}
+
+unsigned X86AsmPrinter::GetTargetLabelAlign(const MachineInstr *MI) const {
+ if (Subtarget->isTargetNaCl()) {
+ switch (MI->getOpcode()) {
+ default: return 0;
+ // These labels may indicate an indirect entry point that is
+ // externally reachable and hence must be bundle aligned.
+ // Note: these labels appear to be always at basic block beginnings
+ // so it may be possible to simply set the MBB alignment.
+ // However, it is unclear whether this always holds.
+ case TargetOpcode::EH_LABEL:
+ case TargetOpcode::GC_LABEL:
+ return 5;
+ }
+ }
+ return 0;
+}
+// @LOCALMOD-END
+
/// printSymbolOperand - Print a raw symbol reference operand. This handles
/// jump tables, constant pools, global address and external symbols, all of
/// which print to a label with various suffixes for relocation types etc.
@@ -528,6 +558,12 @@ void X86AsmPrinter::EmitStartOfAsmFile(Module &M) {
S, MCConstantExpr::Create(int64_t(1), MMI->getContext()));
}
}
+
+ // @LOCALMOD-BEGIN
+ if (Subtarget->isTargetNaCl())
+ initializeNaClMCStreamer(OutStreamer, OutContext,
+ Subtarget->getTargetTriple());
+ // @LOCALMOD-END
}
static void
« no previous file with comments | « lib/Target/X86/X86AsmPrinter.h ('k') | lib/Target/X86/X86CallingConv.td » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698