summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* MS ABI: Implement #pragma vtordisp() and clang-cl /vdNReid Kleckner2014-02-121-5/+36
| | | | | | | | | | | | | | | | | These features are new in VS 2013 and are necessary in order to layout std::ostream correctly. Currently we have an ABI incompatibility when self-hosting with the 2013 stdlib in our convertible_fwd_ostream wrapper in gtest. This change adds another implicit attribute, MSVtorDispAttr, because implicit attributes are currently the best way to make sure the information stays on class templates through instantiation. Reviewers: majnemer Differential Revision: http://llvm-reviews.chandlerc.com/D2746 llvm-svn: 201274
* MS ABI: Add support for the -vm{b,g,s,m,v} flagsDavid Majnemer2014-02-111-1/+1
| | | | | | | | | These flags control the inheritance model initially used by the translation unit. Differential Revision: http://llvm-reviews.chandlerc.com/D2741 llvm-svn: 201175
* MS ABI: Add support for #pragma pointers_to_membersDavid Majnemer2014-02-101-0/+7
| | | | | | | | | | | | | | | | | | | Introduce a notion of a 'current representation method' for pointers-to-members. When starting out, this is set to 'best case' (representation method is chosen by examining the class, selecting the smallest representation that would work given the class definition or lack thereof). This pragma allows the translation unit to dictate exactly what representation to use, similar to how the inheritance model keywords operate. N.B. PCH support is forthcoming. Differential Revision: http://llvm-reviews.chandlerc.com/D2723 llvm-svn: 201105
* Fix a -Wmicrosoft warning about an unrepresentable enum valueReid Kleckner2014-02-031-1/+1
| | | | | | In MSVC, enums are always signed unless you explicitly specify the type. llvm-svn: 200719
* Distinguish between attributes explicitly written at the request of the ↵Aaron Ballman2014-01-161-7/+6
| | | | | | | | user, and attributes implicitly generated to assist in bookkeeping by the compiler. This is done so by table generating a CreateImplicit method for each attribute. Additionally, remove the optional nature of the spelling list index when creating attributes. This is supported by table generating a Spelling enumeration when the spellings for an attribute are distinct enough to warrant it. llvm-svn: 199378
* Tablegen now generates a StringSwitch for attributes containing enumeration ↵Aaron Ballman2013-09-111-13/+4
| | | | | | arguments to map strings to the proper enumeration value. This makes error checking more consistent and reduces the amount of hand-written code required. llvm-svn: 190545
* Omit llvm:: before StringRef and SmallString. We have using directive in ↵Robert Wilhelm2013-08-101-3/+2
| | | | | | include/clang/Basic/LLVM.h. llvm-svn: 188139
* Adding support for MSVC #pragma detect_mismatch functionality by emitting a ↵Aaron Ballman2013-06-041-0/+6
| | | | | | FAILIFMISMATCH linker command into the object file. llvm-svn: 183178
* Suffixing #pragma comment(lib) library names with .lib if necessary. This ↵Aaron Ballman2013-05-241-2/+1
| | | | | | matches MSVC behavior, as well as allows us to properly link libraries such as the ones provided by the MSDN examples. llvm-svn: 182647
* Forward #pragma comment(lib/linker) through as flags metadataReid Kleckner2013-05-081-0/+21
| | | | | | | | | | | | | | | | | | | | | | Summary: Most of this change is wiring the pragma all the way through from the lexer, parser, and sema to codegen. I considered adding a Decl AST node for this, but it seemed too heavyweight. Mach-O already uses a metadata flag called "Linker Options" to do this kind of auto-linking. This change follows that pattern. LLVM knows how to forward the "Linker Options" metadata into the COFF .drectve section where these flags belong. ELF support is not implemented, but possible. This is related to auto-linking, which is http://llvm.org/PR13016. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D723 llvm-svn: 181426
* Add a new 'type_visibility' attribute to allow users toJohn McCall2013-02-201-1/+1
| | | | | | | | | | | | | | control the visibility of a type for the purposes of RTTI and template argument restrictions independently of how visibility propagates to its non-type member declarations. Also fix r175326 to not ignore template argument visibility on a template explicit instantiation when a member has an explicit attribute but the instantiation does not. The type_visibility work is rdar://11880378 llvm-svn: 175587
* Disable caching of visibility.Rafael Espindola2013-01-121-1/+0
| | | | | | | | | | | | | | The testcase in pr14929 shows that this is extremely hard to do. If we choose to apply the attribute, that causes the visibility of some decls to change and that can happen really late (during codegen). Current gcc warns and ignores the attribute in this testcase with a warning. This suggest that the correct solution is to find a point in the compilation where we can compute the visibility and * assert it was never computed before * reject any attempts to compute it again in the future (with warnings). llvm-svn: 172305
* Add 171048 back but invalidate the cache of all redeclarations when settingRafael Espindola2012-12-251-1/+3
| | | | | | | | | | | | | | | | | | the body of a functions. The problem was that hasBody looks at the entire chain and causes problems to -fvisibility-inlines-hidden if the cache was not invalidated. Original message: Cache visibility of decls. This unifies the linkage and visibility caching. I first implemented this when working on pr13844, but the previous fixes removed the performance advantage of this one. This is still a step in the right direction for making linkage and visibility cheap to use. llvm-svn: 171053
* Revert r171048, "Cache visibility of decls."NAKAMURA Takumi2012-12-251-3/+1
| | | | | | It broke stage2. llvm-svn: 171050
* Cache visibility of decls.Rafael Espindola2012-12-251-1/+3
| | | | | | | | | | | This unifies the linkage and visibility caching. I first implemented this when working on pr13844, but the previous fixes removed the performance advantage of this one. This is still a step in the right direction for making linkage and visibility cheap to use. llvm-svn: 171048
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-201-1/+1
| | | | | | which is wrong here. llvm-svn: 170721
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-1/+1
| | | | | | single attribute in the future. llvm-svn: 170500
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Permanently end the whole "pragma got handled by the parser too early"Eli Friedman2012-10-041-15/+8
| | | | | | | mess by handling all pragmas which the parser touches uniformly. <rdar://problem/12248901>, etc. llvm-svn: 165195
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-1/+1
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Reject mismatched "#pragma GCC visibility push" and "#pragma GCC visibility ↵Rafael Espindola2012-02-011-12/+33
| | | | | | pop". llvm-svn: 149559
* Remove redundant argument.Rafael Espindola2012-01-211-2/+2
| | | | llvm-svn: 148628
* Remove unnecessary default cases in switches over enums.David Blaikie2012-01-171-3/+0
| | | | | | This allows -Wswitch-enum to find switches that need updating when these enums are modified. llvm-svn: 148281
* Add explicit attributes to mark functions as having had theirJohn McCall2011-09-301-0/+12
| | | | | | | | | | | CoreFoundation object-transfer properties audited, and add a #pragma to cause them to be automatically applied to functions in a particular span of code. This has to be implemented largely in the preprocessor because of the requirement that the region be entirely contained in a single file; that's hard to impose from the parser without registering for a ton of callbacks. llvm-svn: 140846
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Change all references of type ExprTy to Expr and get rid of the typedefs.Richard Trieu2011-09-091-1/+1
| | | | llvm-svn: 139347
* Add ms_struct attribute on record typeeFariborz Jahanian2011-04-261-0/+6
| | | | | | (and ignore it for now) - wip. llvm-svn: 130224
* Recognize gcc's ms_struct pragma (and ignore for now).Fariborz Jahanian2011-04-251-0/+4
| | | | | | This is wip. llvm-svn: 130138
* On Mac OS X, the presence of an 'availability' attribute for thatDouglas Gregor2011-03-261-1/+1
| | | | | | | | | platform implies default visibility. To achieve these, refactor our lookup of explicit visibility so that we search for both an explicit VisibilityAttr and an appropriate AvailabilityAttr, favoring the VisibilityAttr if it is present. llvm-svn: 128336
* Move support for "#pragma STDC FP_CONTRACT" to Parser; add Sema actionsPeter Collingbourne2011-02-141-0/+14
| | | | llvm-svn: 125474
* Allow #pragma unused to be used on global variables like gcc. Fixes ↵Argyrios Kyrtzidis2011-01-271-2/+2
| | | | | | rdar://8793832. llvm-svn: 124383
* Convert "#pragma unused(...)" into tokens for the parser.Argyrios Kyrtzidis2011-01-171-27/+21
| | | | | | | This allows us to cache a "#pragma unused" that occurs inside an inline C++ member function. Fixes rdar://8829590&8770988. llvm-svn: 123666
* Treat visibility on an enclosing namespace as a non-explicit source ofJohn McCall2010-12-101-7/+14
| | | | | | | | | | | visibility. Fixes PR8713. I've disabled a test which was testing that you can #pragma pop visibility to get out of a namespace's visibility attribute. We should probably just diagnose that as an error unless it's instrumental to someone's system headers. llvm-svn: 121459
* Make #pragma unused work for static local variables.Douglas Gregor2010-11-091-1/+1
| | | | llvm-svn: 118500
* Warn if a variable marked with the "unused" attribute is used. Patch by ↵Anders Carlsson2010-10-221-0/+4
| | | | | | Darin Adler! llvm-svn: 117184
* One who seeks knowledge learns something new every day.John McCall2010-08-261-5/+5
| | | | | | | | | One who seeks the Tao unlearns something new every day. Less and less remains until you arrive at non-action. When you arrive at non-action, nothing will be left undone. llvm-svn: 112244
* Move things around so that Sema.h no longer depends on even DeclBase.h.John McCall2010-08-261-9/+13
| | | | | | It still depends on Type because DeclarationName.h does. llvm-svn: 112177
* Split out a header to hold APIs meant for the Sema implementation from Sema.h.John McCall2010-08-251-1/+1
| | | | | | | Clients of Sema don't need to know (for example) the list of diagnostics we support. llvm-svn: 112093
* Generate Attr subclasses with TableGen.Alexis Hunt2010-08-181-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | Now all classes derived from Attr are generated from TableGen. Additionally, Attr* is no longer its own linked list; SmallVectors or Attr* are used. The accompanying LLVM commit contains the updates to TableGen necessary for this. Some other notes about newly-generated attribute classes: - The constructor arguments are a SourceLocation and a Context&, followed by the attributes arguments in the order that they were defined in Attr.td - Every argument in Attr.td has an appropriate accessor named getFoo, and there are sometimes a few extra ones (such as to get the length of a variadic argument). Additionally, specific_attr_iterator has been introduced, which will iterate over an AttrVec, but only over attributes of a certain type. It can be accessed through either Decl::specific_attr_begin/end or the global functions of the same name. llvm-svn: 111455
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-121-2/+2
| | | | llvm-svn: 110945
* Implement #pragma GCC visibility.Eli Friedman2010-08-051-0/+67
| | | | llvm-svn: 110315
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-1/+0
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* Sema: Fix a bug with #pragma options align=reset, reset against an empty stackDaniel Dunbar2010-07-161-14/+23
| | | | | | is well defined, it resets to the default alignment. llvm-svn: 108508
* Sema: Fix comment, apparently #pragma options align=power is just the same asDaniel Dunbar2010-05-281-6/+1
| | | | | | align=native, at least for the platforms we support. llvm-svn: 105000
* Sema: Just ignore '#pragma options align=power' for now, this is no worse thanDaniel Dunbar2010-05-281-1/+6
| | | | | | | what we used to be doing, and makes sure that paired '#pragma options align=reset' won't fail. llvm-svn: 104998
* Parse/Sema: Add support for '#pragma options align=packed', which, it should beDaniel Dunbar2010-05-271-0/+7
| | | | | | noted, is not the same as __attribute__((packed)). That would be ridiculous! llvm-svn: 104865
* Parse/Sema: Add support for '#pragma options align=native'.Daniel Dunbar2010-05-271-0/+4
| | | | llvm-svn: 104864
* Sema: Add initial support for '#pragma options align=mac68k'.Daniel Dunbar2010-05-271-7/+16
| | | | | | | - Docs are fairly sketchy, if someone wants to pore through gcc to look for holes I'd appreciate any failing test cases! llvm-svn: 104809
* Sema: Factor out struct for alignment stack entries.Daniel Dunbar2010-05-271-5/+11
| | | | llvm-svn: 104799
* Sema: Replace getPragmaPackAlignment with AddAlignmentAttributesForRecord, whichDaniel Dunbar2010-05-271-6/+10
| | | | | | exposes less details. llvm-svn: 104797
OpenPOWER on IntegriCloud