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

Unified Diff: lib/MC/MCAsmStreamer.cpp

Issue 1265823002: Auto-sandboxing: Don't expand instructions when in a bundle-locked group (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | lib/MC/MCObjectStreamer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/MC/MCAsmStreamer.cpp
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index b9acf1611d5409f7a4423d78348e996dbe0d1cd6..0d5f123154285bcdd6342d4ea54144c600a871a2 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -54,6 +54,7 @@ class MCAsmStreamer final : public MCStreamer {
// @LOCALMOD: we don't have an MCAssembler object here, so we can't ask it
// if bundle alignment is enabled. Instead, just track the alignment here.
unsigned BundleAlignmentEnabled : 1;
+ unsigned BundleLocked : 1;
void EmitRegisterName(int64_t Register);
void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) override;
@@ -1256,7 +1257,8 @@ void MCAsmStreamer::EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &S
"Cannot emit contents before setting section!");
// @LOCALMOD-START
- if (NaClExpander && NaClExpander->expandInst(Inst, *this, STI))
+ if (NaClExpander && !BundleLocked &&
+ NaClExpander->expandInst(Inst, *this, STI))
return;
if (BundleAlignmentEnabled && AsmBackend &&
@@ -1292,11 +1294,13 @@ void MCAsmStreamer::EmitBundleLock(bool AlignToEnd) {
OS << "\t.bundle_lock";
if (AlignToEnd)
OS << " align_to_end";
+ BundleLocked = true; // @LOCALMOD
EmitEOL();
}
void MCAsmStreamer::EmitBundleUnlock() {
OS << "\t.bundle_unlock";
+ BundleLocked = false; // @LOCALMOD
EmitEOL();
}
« no previous file with comments | « no previous file | lib/MC/MCObjectStreamer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698