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

Unified Diff: lib/MC/MCAsmStreamer.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/MC/CMakeLists.txt ('k') | lib/MC/MCAssembler.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 84eb093776562dfdf0709f4dbacf5cdda58478cb..17a81926083b4b80a01866d54de9ad5f65ae497f 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -52,6 +52,9 @@ private:
unsigned IsVerboseAsm : 1;
unsigned ShowInst : 1;
unsigned UseDwarfDirectory : 1;
+ // @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;
void EmitRegisterName(int64_t Register);
void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) override;
@@ -65,7 +68,8 @@ public:
: MCStreamer(Context), OS(os), MAI(Context.getAsmInfo()),
InstPrinter(printer), Emitter(emitter), AsmBackend(asmbackend),
CommentStream(CommentToEmit), IsVerboseAsm(isVerboseAsm),
- ShowInst(showInst), UseDwarfDirectory(useDwarfDirectory) {
+ ShowInst(showInst), UseDwarfDirectory(useDwarfDirectory),
+ BundleAlignmentEnabled(0) {
if (InstPrinter && IsVerboseAsm)
InstPrinter->setCommentStream(CommentStream);
}
@@ -1243,6 +1247,12 @@ void MCAsmStreamer::EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &S
assert(getCurrentSection().first &&
"Cannot emit contents before setting section!");
+ // @LOCALMOD-START
+ if (BundleAlignmentEnabled && AsmBackend &&
+ AsmBackend->CustomExpandInst(Inst, *this)) {
+ return;
+ }
+ // @LOCALMOD-END
// Show the encoding in a comment if we have a code emitter.
if (Emitter)
AddEncodingComment(Inst, STI);
@@ -1263,6 +1273,7 @@ void MCAsmStreamer::EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &S
void MCAsmStreamer::EmitBundleAlignMode(unsigned AlignPow2) {
OS << "\t.bundle_align_mode " << AlignPow2;
+ BundleAlignmentEnabled = AlignPow2 > 0; // @LOCALMOD
EmitEOL();
}
« no previous file with comments | « lib/MC/CMakeLists.txt ('k') | lib/MC/MCAssembler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698