[LLVMdev] IAS and inline assembly

Chandler Carruth chandlerc at google.com
Fri Feb 21 15:34:29 PST 2014


On Fri, Feb 21, 2014 at 8:29 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> My preference is also for the first option. The files we reject now
> with -S are the ones we used to reject with -c. We just ask for "-S
> -no-integrated-as" to be used when a file contains invalid inline
> assembly.
>

Emphatic agreement.


> If that is too strict to work in practice, I think the
> alternatives I would prefer would be
>
> * Have the driver pass -no-integrated-as when given -S but not
> -integrated-as. That is, -no-integrated-as is always the default for
> -S in clang. This has the big advantage that parsing assembly is still
> just a on/off switch.
> * Have a second TargetOption: StrictIntegratedAS. Have the driver set
> that based on -S/-c and -integrated-as/-no-integrated-as. With this
> option we downgrade assembly parsing errors to warnings and fallback
> to EmitRawText, but without ever calling hasRawTextSupport. I believe
> this is equivalent to Renato's proposal.
>
> Even if we decide to go with the option of downgrading errors to
> warnings, we should probably still do that in a second step and first
> just have the driver disable the integrated assembler with -S for now.
>

I don't much like any of these options. I actually have strong objections
to essentially all of the suggestions outside of the current state except
for passing comments through. I think passing comments through seems
obvious and correct. I also don't think it makes any difference for hacks
like the one being used by the linux kernel, so while it seems fine in
general, it doesn't seem important for this use case.

I think the simple reality is that if you want to use inline assembly to
dump raw text around C code to an assembly file generated with -S, turn off
the integrated assembler entirely. You clearly don't want it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140221/5748856e/attachment.html>


More information about the llvm-dev mailing list