Commit Graph

3 Commits

Author SHA1 Message Date
Reid Kleckner 722b1df869 Fix parsing certain kinds of strings in the MS section pragmas
We were crashing on the relevant test case inputs.  Also, refactor this
code a bit so we can report failure and slurp the pragma tokens without
returning a diagnostic id.  This is more consistent with the rest of the
parser and sema code.

llvm-svn: 213337
2014-07-18 00:13:16 +00:00
Bob Wilson 0e011f201d Add a -triple argument so that this new test passes on Darwin.
The section names used here are not valid for Mach-O.

llvm-svn: 205920
2014-04-09 18:51:19 +00:00
Warren Hunt c3b18967ed [MS-ABI] Add support for #pragma section and related pragmas
This patch adds support for the msvc pragmas section, bss_seg, code_seg, 
const_seg and data_seg as well as support for __declspec(allocate()).

Additionally it corrects semantics and adds diagnostics for 
__attribute__((section())) and the interaction between the attribute 
and the msvc pragmas and declspec.  In general conflicts should now be 
well diganosed within and among these features.

In supporting the pragmas new machinery for uniform lexing for 
msvc pragmas was introduced.  The new machinery always lexes the 
entire pragma and stores it on an annotation token.  The parser 
is responsible for parsing the pragma when the handling the 
annotation token.

There is a known outstanding bug in this implementation in C mode.  
Because these attributes and pragmas apply _only_ to definitions, we 
process them at the time we detect a definition.  Due to tentative 
definitions in C, we end up processing the definition late.  This means 
that in C mode, everything that ends up in a BSS section will end up in 
the _last_ BSS section rather than the one that was live at the time of 
tentative definition, even if that turns out to be the point of actual 
definition.  This issue is not known to impact anything as of yet 
because we are not aware of a clear use or use case for #pragma bss_seg 
but should be fixed at some point.

Differential Revision=http://reviews.llvm.org/D3065#inline-16241 

llvm-svn: 205810
2014-04-08 22:30:47 +00:00