[cfe-dev] Pre-processing assembly sources

Martin J. O'Riordan via cfe-dev cfe-dev at lists.llvm.org
Thu Aug 11 06:07:11 PDT 2016

Yes, unfortunately our assembler uses ';' to start a comment to end of line :-(



-----Original Message-----
From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of Joerg Sonnenberger via cfe-dev
Sent: 11 August 2016 13:52
To: 'Clang Dev'
Subject: Re: [cfe-dev] Pre-processing assembly sources

On Thu, Aug 11, 2016 at 09:16:17AM +0100, Martin J. O'Riordan wrote:
> Thanks Joerg.
> I have another question about pre-processing for assembly sources.
> C and C++ do not distinguish newline from any other kind of 
> whitespace, and the expansion of a macro has no embedded newlines 
> (keeps line tracking happy).
> But assemblers typically process a line at a time, so a macro such as:
>   #define LOAD_and_ADDI(n) \
>     LD  r1, r2 \
>     ADDI r1, r1, n
>   LOAD_and_ADDI(0x20)
> expands to:
>   LD  r1, r2 ADDI r1, r1, 0x20

This is normally dealt with by separating the instructions explicitly with ";".

cfe-dev mailing list
cfe-dev at lists.llvm.org

More information about the cfe-dev mailing list