[PATCH] D21066: Pass MCSubtargetInfo instead of CPU and Triple to createMCAsmBackend

Andrey Turetskiy via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 7 04:59:32 PDT 2016


aturetsk created this revision.
aturetsk added reviewers: bruno, echristo, ahatanak, RKSimon.
aturetsk added a subscriber: cfe-commits.
Herald added a subscriber: mehdi_amini.

Pass MCSubtargetInfo instead of CPU and Triple to AsmBackend in order to be able to reach feature bits there (e.g. for ckecking of long nop support).
CPU and Triple are taken from MCSubtargetInfo.

http://reviews.llvm.org/D21066

Files:
  tools/driver/cc1as_main.cpp

Index: tools/driver/cc1as_main.cpp
===================================================================
--- tools/driver/cc1as_main.cpp
+++ tools/driver/cc1as_main.cpp
@@ -381,7 +381,7 @@
     MCAsmBackend *MAB = nullptr;
     if (Opts.ShowEncoding) {
       CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx);
-      MAB = TheTarget->createMCAsmBackend(*MRI, Opts.Triple, Opts.CPU);
+      MAB = TheTarget->createMCAsmBackend(*STI, *MRI);
     }
     auto FOut = llvm::make_unique<formatted_raw_ostream>(*Out);
     Str.reset(TheTarget->createAsmStreamer(
@@ -398,8 +398,8 @@
     }
 
     MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx);
-    MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*MRI, Opts.Triple,
-                                                      Opts.CPU);
+    MCAsmBackend *MAB =
+        TheTarget->createMCAsmBackend(*STI, *MRI);
     Triple T(Opts.Triple);
     Str.reset(TheTarget->createMCObjectStreamer(
         T, Ctx, *MAB, *Out, CE, *STI, Opts.RelaxAll,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21066.59865.patch
Type: text/x-patch
Size: 1012 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160607/ccefcc61/attachment.bin>


More information about the cfe-commits mailing list