[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
Sun Aug 9 22:53:36 PDT 2009


On Aug 9, 2009, at 8:43 PM, Daniel Dunbar wrote:
>> 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!

Ah, the idea is that clang would try this out when processing the  
"attribute section" in sema, and reject it if it (with a really nice  
sloc) if it isn't valid!

-Chris



More information about the llvm-commits mailing list