[PATCH] disabled switching ARM modes in inline asm

Greg Fitzgerald garious at gmail.com
Tue Dec 3 11:12:31 PST 2013


  > The compiler must go back to its own state after inline assembly, and err if the user makes it hard.

  Agreed.  It's easy to detect a missing .arm or .thumb directive.  Not so obvious to me how to detect the missing adr instruction (or equivalent?).  I think a good fix would be to error out if the compiler notices the missing directive (rather than inject it), under the assumption that the missing directive suggests the adr instruction is missing as well.


  > The compiler must detect changes in inline assembly, and record its own state, to be able to do so.

  Agreed.  SubtargetInfo's FeatureBits looks good for this.


  > Forbidding state change altogether is a first approach on correctness, and
  > I'm fine with this patch as it is. For the future, do you plan on implementing
  > a more fine grained approach?

  I'm not sure.  It's easy to implement but difficult to test.  llvm-objdump needs to respect the ARM-ELF mapping symbols.  I'll take a shot at it today.  I'll report back in a few hours.  If it doesn't go well, I think we should merge this patch, which is about as conservative as it gets.


================
Comment at: include/llvm/MC/MCTargetAsmParser.h:101
@@ +100,3 @@
+  /// ParsingInlineGnuAsm - Are we parsing GAS-syntax inline assembly?
+  bool ParsingInlineGnuAsm;
+
----------------
Renato Golin wrote:
> I don't understand why you need this...
Because the name 'ParsingInlineAsm' was taken for MS-style assembly.


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



More information about the llvm-commits mailing list