summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Sema: Reject '#pragma options align=mac68k' everywhere except i386-apple-darwin.Daniel Dunbar2010-05-271-0/+14
| | | | llvm-svn: 104789
* Sema: Support for #pragma options align={reset,natural}. '#pragma options align'Daniel Dunbar2010-05-271-1/+36
| | | | | | shares the stack with '#pragma pack', who knew!? llvm-svn: 104786
* Protect isIntegerConstantExpr from seeing type- or value-dependentDouglas Gregor2010-05-181-1/+3
| | | | | | expressions in attributes, pragmas. llvm-svn: 104083
* Rip out the last remaining implicit use of OverloadedFunctionDecl in Sema:John McCall2009-12-021-5/+4
| | | | | | | LookupResult::getAsSingleDecl() is no more. Shift Sema::LookupSingleName to return null on overloaded results. llvm-svn: 90309
* Split LookupResult into its own header.John McCall2009-11-181-0/+1
| | | | llvm-svn: 89199
* Carry lookup configuration throughout lookup on the LookupResult. GiveJohn McCall2009-11-171-4/+2
| | | | | | | | | | | | | LookupResult RAII powers to diagnose ambiguity in the results. Other diagnostics (e.g. access control and deprecation) will be moved to automatically trigger during lookup as part of this same mechanism. This abstraction makes it much easier to encapsulate aliasing declarations (e.g. using declarations) inside the lookup system: eventually, lookup will just produce the aliases in the LookupResult, and the standard access methods will naturally strip the aliases off. llvm-svn: 89027
* Refactor the LookupResult API to simplify most common operations. Require ↵John McCall2009-10-091-5/+4
| | | | | | | | | users to pass a LookupResult reference to lookup routines. Call out uses which assume a single result. llvm-svn: 83674
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-19/+19
| | | | llvm-svn: 81346
* Per advice that Doug Gregor gave me several months ago, clean up theTed Kremenek2009-08-031-31/+24
| | | | | | | | | | | | | implementation of '#pragma unused' by not constructing intermediate DeclRefExprs, but instead do the name lookup directly. The implementation is greatly simplified. Along the way, degrade '#pragma unused(undeclaredvariable)' to a warning instead of being a hard error. This implements: <rdar://problem/6761874> [sema] allow #pragma unused to reference undefined variable (with warning) llvm-svn: 78019
* Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis2009-06-301-1/+1
| | | | | | | | | The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
* Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor2009-06-181-1/+1
| | | | llvm-svn: 73702
* Deallocate 'DeclRefExpr's in correctly formed '#pragma unused'Ted Kremenek2009-03-231-0/+1
| | | | llvm-svn: 67573
* Implement '#pragma unused'.Ted Kremenek2009-03-231-0/+38
| | | | llvm-svn: 67569
* Handle #pragma pack(0). I left this out of diagnostic because users shouldDaniel Dunbar2009-03-061-2/+4
| | | | | | | really use pack() instead. - <rdar://problem/6650243> clang warns about '#pragma pack(0)' llvm-svn: 66287
* Make PragmaPackStack be a private class in SemaAttr and make itsChris Lattner2009-02-171-31/+91
| | | | | | instance in Sema be a pimpl. llvm-svn: 64718
* move attribute(packed) sema support out of SemaDecl into a new SemaAttr.cpp ↵Chris Lattner2009-02-171-0/+110
file. llvm-svn: 64711
OpenPOWER on IntegriCloud