[PATCH] MC: provide the ability to disable assembly parsing

Renato Golin renato.golin at linaro.org
Thu Feb 20 03:37:33 PST 2014



================
Comment at: include/llvm/MC/MCAsmInfo.h:310-315
@@ -309,2 +309,8 @@
 
+    /// Should we parse inline assembly?
+    /// The integrated assembler will usually parse inline assembly.  However,
+    /// when simply generating an object file, it can be useful to prevent this
+    /// (e.g. the Linux kernel uses it as a fancy preprocessor).
+    bool ValidateInlineASMSyntax;
+
   public:
----------------
Daniel Sanders wrote:
> Isn't this the same as UseIntegratedAssembler above?
Now, reading the comment above, I agree with you that the semantics is close enough so that we can merge them. I think Saleem's approach to flags was too conservative.

I can see the following states:

1. We don't even parse, just dump text.
2. We parse, but don't fail on error (like GNU)
3. We parse and fail on errors

We need to dump one of them to have only one flag in which case it can be either:

* 1 and 3, as it is today, but we'll need to disable the parser by default even with IAS on for -S output, and that's what Saleem's patch is trying to do
* 2 and 3, as I proposed on my first comment, and was the original assumption for enabling the IAS on -S output in the first place

I'd rather have any of them than what we have now, but I'm not completely convinced either is the best. 

I still slightly prefer 2 and 3 on the grounds that it was our original agreement (me, you, Jim), and it will enable us to do more with inline assembly (ex. .code16/.code32) without breaking code that depends on weird behaviour (ex. macros). Also, other folks (Chandler) are preferring this solution.


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



More information about the cfe-commits mailing list