[PATCH] Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Tue Feb 4 09:44:09 PST 2014


  This is certainly going on the right direction. Thank you so much for working on this!


================
Comment at: include/llvm/MC/MCSubtargetInfo.h:74
@@ -70,1 +73,3 @@
 
+  /// useIntegratedInlineAs - Return true if the inline assembly should be
+  /// parsed.
----------------
Don't duplicate the name on the comment.

================
Comment at: lib/MC/MCSubtargetInfo.cpp:136
@@ +135,3 @@
+  // This should be kept in sync with clang
+  if (Trip.getArch() == llvm::Triple::aarch64 ||
+      Trip.getArch() == llvm::Triple::arm ||
----------------
The clang logic has more cases. For example, I think the ppc assembler is used on some BSDs.
This is probably fine for now. Just change the FIXME to say that this version should be synced with clang and clang changed to use this so that we have a single implementation.

================
Comment at: include/llvm/MC/MCSubtargetInfo.h:48
@@ -47,1 +47,3 @@
 
+  bool UseIntegratedInlineAs; // Should we use the integrated assembler for
+                              // inline assembly on this subtarget.
----------------
Why MCSubtargeInfo? I have the impression that MCAsmInfo might be a better match. Its initialization structure is a bit more verbose, but being split among the targets matches what clang does a bit better and should allow each target to change the rules for when they use the integrated assembler without touching common code.


================
Comment at: lib/MC/MCSubtargetInfo.cpp:22
@@ +21,3 @@
+static cl::opt<bool>                                                              
+NoIntegratedInlineAs("no-integrated-inline-as", cl::Hidden,             
+                     cl::desc("Disable integrated assembly of inline asm"));
----------------
If going with MCasmInfo, I would suggest adding a set method to it. That way the constructor set the default and LLVMTargetMachine::initAsmInfo can call the setter if -no-integrated-inline-as is passed.


http://llvm-reviews.chandlerc.com/D2686



More information about the llvm-commits mailing list