[llvm-commits] [llvm] r78547 - in /llvm/trunk: include/llvm/MC/ include/llvm/Target/ lib/MC/ lib/Target/ lib/Target/ARM/AsmPrinter/ lib/Target/PowerPC/AsmPrinter/ lib/Target/X86/AsmPrinter/ test/CodeGen/ARM/ test/CodeGen/PowerPC/ test/CodeGen/X86

Chris Lattner clattner at apple.com
Tue Aug 11 11:21:52 PDT 2009


On Aug 9, 2009, at 8:43 PM, Daniel Dunbar wrote:

> Very nice!
>
> On Sun, Aug 9, 2009 at 6:39 PM, Chris Lattner<sabre at nondot.org> wrote:
>> Author: lattner
>> Date: Sun Aug  9 20:39:42 2009
>> New Revision: 78547
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=78547&view=rev
>> Log:
>> Make the big switch: Change MCSectionMachO to represent a section  
>> *semantically*
>> instead of syntactically as a string.  This means that it keeps  
>> track of the
>> segment, section, flags, etc directly and asmprints them in the  
>> right format.
>> This also includes parsing and validation support for llvm-mc and
>> "attribute(section)", so we should now start getting errors about  
>> invalid
>> section attributes from the compiler instead of the assembler on  
>> darwin.
>
> I couldn't help but wire this up:
>
> --
> ddunbar at giles:Frontend$ clang -c backend-errors.c
> fatal error: error in backend: Global variable 'a' has an invalid
> section specifier
>      'I AM, not, legal': mach-o section specifier uses an unknown  
> section type.
> --
> compare to:
> --
> ddunbar at giles:Frontend$ gcc -c backend-errors.c
> /var/folders/DQ/DQ8GT3++HESEzT1obWBynE+++TI/-Tmp-//cc45w2pq.s: 
> 2:Expected
> comma after segment-name
> /var/folders/DQ/DQ8GT3++HESEzT1obWBynE+++TI/-Tmp-//cc45w2pq.s:2:Rest
> of line ignored. 1st junk character valued 77 (M).
> --
>
> Hmm, I'm not sure which one is easier to read!

Oh yeah, I know you saw this on cfe-commits, but for other people who  
are curious, clang now produces:

$ clang t.c -fsyntax-only
t.c:4:30: error: argument to 'section' attribute is not valid for this  
target: mach-o section specifier requires a segment and section  
separated by a comma
int x __attribute__((section("sadf")));
                              ^
:)
-Chris



More information about the llvm-commits mailing list