summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* After a lengthy design discussion, add support for "ownership attributes" ↵Ted Kremenek2010-07-311-3/+172
| | | | | | for malloc/free checking. Patch by Andrew McGregor! llvm-svn: 109939
* Add support for differentiating between attributes ignored when handled andChandler Carruth2010-07-081-1/+2
| | | | | | | | unknown attributes that we discard. Add a diagnostic group for unknown attribute warnings to allow turning these off when we don't care. Also consolidates the tests for this case. llvm-svn: 107864
* Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead ↵Argyrios Kyrtzidis2010-07-071-1/+1
| | | | | | | | of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH. Makes de-serialization of the function body even more "lazier". llvm-svn: 107768
* Complain about the application of a transparent_union attribute to aDouglas Gregor2010-06-301-2/+3
| | | | | | | | union whose first field has integral vector type. Also, clean up this diagnostic a bit. Thanks to Eli for spotting this change in semantics last week. llvm-svn: 107296
* Implement dependent alignment attribute support. This is a bit gross given theChandler Carruth2010-06-251-12/+18
| | | | | | | | | | | | | current attribute system, but it is enough to handle class templates which specify parts of their alignment in terms of their template parameters. This also replaces the attributes test in SemaTemplate with one that actually tests working attributes instead of broken ones. I plan to add more tests here for non-dependent attributes in a subsequent patch. Thanks to John for walking me through some of this. =D llvm-svn: 106818
* Change Type::isFloatingType() to reflect the actual definition of aDouglas Gregor2010-06-221-1/+1
| | | | | | | | | | | "floating type" in C, which does not include vector types. Introduce Type::hasFloatingRepresentation() for the places where we want to know whether the underlying representation is one or more floating-point values. Remove some hacks we had where the former behavior of Type::isFloatingType() was at odds with the language definition of the term. llvm-svn: 106584
* implement support for -finstrument-functions, patch by NelsonChris Lattner2010-06-221-1/+20
| | | | | | Elhage! llvm-svn: 106507
* IRGen for implementation of init-priority attribute.Fariborz Jahanian2010-06-211-1/+1
| | | | | | | Test case will be checked in llvm test suite. (finishes off radar 8076356). llvm-svn: 106441
* More Sema Check and a test case for init_priority attr.Fariborz Jahanian2010-06-181-0/+15
| | | | | | (radar 8076356). llvm-svn: 106350
* Implements Sema part of init_priority(priority) attributeFariborz Jahanian2010-06-181-0/+36
| | | | | | (radar 8076356) - wip. llvm-svn: 106322
* Introduce Type::isIntegralOrEnumerationType(), to cover those placesDouglas Gregor2010-06-161-1/+1
| | | | | | | | | | in C++ that involve both integral and enumeration types. Convert all of the callers to Type::isIntegralType() that are meant to work with both integral and enumeration types over to Type::isIntegralOrEnumerationType(), to prepare to eliminate enumeration types as integral types. llvm-svn: 106071
* Roll back r104941.John McCall2010-05-281-19/+3
| | | | llvm-svn: 104990
* Add a new attribute on records, __attribute__((adl_invisible)), and defineJohn McCall2010-05-281-3/+19
| | | | | | | | | | | | the x86-64 __va_list_tag with this attribute. The attribute causes the affected type to behave like a fundamental type when considered by ADL. (x86-64 is the only target we currently provide with a struct-based __builtin_va_list) Fixes PR6762. llvm-svn: 104941
* Add clang support for IBOutletCollection.Ted Kremenek2010-05-191-1/+23
| | | | llvm-svn: 104135
* Protect isIntegerConstantExpr from seeing type- or value-dependentDouglas Gregor2010-05-181-11/+22
| | | | | | expressions in attributes, pragmas. llvm-svn: 104083
* Add support for Microsoft's __thiscall, from Steven Watanabe!Douglas Gregor2010-05-181-0/+3
| | | | llvm-svn: 104026
* Clean up some more uses of getAs<ObjCInterfaceType>() that Fariborz pointedJohn McCall2010-05-171-3/+3
| | | | | | out. The remaining ones are okay. llvm-svn: 103973
* Merged Elaborated and QualifiedName types.Abramo Bagnara2010-05-111-1/+1
| | | | llvm-svn: 103517
* Add calling convention related attributes to related declaration. Mark ↵Abramo Bagnara2010-04-301-16/+35
| | | | | | attributes invalid on type related checking so to add them to declarations only when everything is ok. llvm-svn: 102710
* Attribute noreturn is now put in declaration attributes. Fixed a double ↵Abramo Bagnara2010-04-301-16/+14
| | | | | | warning generation. llvm-svn: 102705
* Rename BlockDecl::IsVariadic() to BlockDecl::isVariadic() to match the casingTed Kremenek2010-04-291-1/+1
| | | | | | for similar methods. No functionality change. llvm-svn: 102634
* Keep track of the actual storage specifier written on a variable orDouglas Gregor2010-04-191-1/+2
| | | | | | | | function declaration, since it may end up being changed (e.g., "extern" can become "static" if a prior declaration was static). Patch by Enea Zaffanella and Paolo Bolzoni. llvm-svn: 101826
* Feed proper source-location information into Sema::LookupSingleResult,Douglas Gregor2010-04-151-1/+4
| | | | | | | | in case it ends up doing something that might trigger diagnostics (template instantiation, ambiguity reporting, access reporting). Noticed while working on PR6831. llvm-svn: 101412
* Twik to radar 7839485. Do not attach weak_import attribute to classFariborz Jahanian2010-04-131-3/+3
| | | | | | for non-fragile abi on darwin. llvm-svn: 101168
* Turn off warning about weak_import attributeFariborz Jahanian2010-04-131-3/+1
| | | | | | on objc classes for Darwin. Radar 7839485. llvm-svn: 101164
* Issue warning when 'weak_import' attribute is applied on a class onlyFariborz Jahanian2010-04-121-3/+8
| | | | | | when it is not supported in versions of MacOs. llvm-svn: 101044
* Support __attribute__((unused)) on types. This suddenly started firingJohn McCall2010-03-311-1/+2
| | | | | | a lot for me on selfhosts, I dunno why. llvm-svn: 99981
* Add Support for 'warn_unused_result" attribute onFariborz Jahanian2010-03-301-5/+11
| | | | | | objective-c methods. (radar 7418262). llvm-svn: 99903
* Add comment indicating that we intentionally don't add the noreturnTed Kremenek2010-03-261-0/+3
| | | | | | attribute to a FunctionDecl. llvm-svn: 99662
* Ignore a more comprehensive set of gcc-special format attributes.Duncan Sands2010-03-231-1/+2
| | | | llvm-svn: 99277
* (re)implement PR6542, accepting and discarding the __gcc_tdiag__Chris Lattner2010-03-221-0/+8
| | | | | | format attribute specifier. llvm-svn: 99213
* Perform access control for the implicit base and member destructor callsJohn McCall2010-03-161-1/+7
| | | | | | required when emitting a destructor definition. llvm-svn: 98609
* Remember declaration scope qualifiers in the AST. Imposes no memory overheadJohn McCall2010-03-151-0/+8
| | | | | | | | | | | on unqualified declarations. Patch by Enea Zaffanella! Minimal adjustments: allocate the ExtInfo nodes with the ASTContext and delete them during Destroy(). I audited a bunch of Destroy methods at the same time, to ensure that the correct teardown was being done. llvm-svn: 98540
* Allow __attribute__((unused)) to be applied to ObjC ivars.Ted Kremenek2010-02-251-1/+1
| | | | llvm-svn: 97103
* Add support for the weakref attribute. We still produce "alias weak" as ↵Rafael Espindola2010-02-231-10/+93
| | | | | | llvm-gcc does, but are more strict on what uses of weakref we accept. llvm-svn: 96992
* Clang really intends to reject attribute 'warn_unused_result' on Objective-C ↵Ted Kremenek2010-02-211-1/+1
| | | | | | | | | methods, but instead it crashes on them. We might extend this attribute to work on methods, but for now fix the crasher. Addresses <rdar://problem/7670939>. llvm-svn: 96723
* Change the behavior of ibaction attributes to be attached to methods, not ivars.Ted Kremenek2010-02-181-16/+25
| | | | llvm-svn: 96562
* Add 'ns_returns_not_retained' and 'cf_returns_not_retained' attributes toTed Kremenek2010-02-181-0/+8
| | | | | | | match 'ns_returns_retained' and 'cf_returns_retained' respectively. These are not yet hooked up to the static analyzer. llvm-svn: 96535
* Add IBAction attribute to keep the IBOutlet attribute company.Ted Kremenek2010-02-171-7/+18
| | | | llvm-svn: 96447
* dllimport and dllexport are declspec attributes, too. They're alsoCharles Davis2010-02-161-80/+7
| | | | | | | | Win32-specific. Also, fix a test to use FileCheck instead of grepping LLVM IR. llvm-svn: 96364
* Use the allocator associated with ASTContext to allocate the argsTed Kremenek2010-02-111-1/+1
| | | | | | | | array associated with NonNullAttr. This fixes yet another leak when ASTContext uses a BumpPtrAllocator. Fixes: <rdar://problem/7637150> llvm-svn: 95863
* Remove use of 'std::string' from Attr objects, using instead a byteTed Kremenek2010-02-111-5/+5
| | | | | | | | | array allocated using the allocator in ASTContext. This addresses these strings getting leaked when using a BumpPtrAllocator (in ASTContext). Fixes: <rdar://problem/7636765> llvm-svn: 95853
* Standardize the parsing of function type attributes in a way thatJohn McCall2010-02-051-118/+11
| | | | | | | | | | | | follows (as conservatively as possible) gcc's current behavior: attributes written on return types that don't apply there are applied to the function instead, etc. Only parse CC attributes as type attributes, not as decl attributes; don't accepet noreturn as a decl attribute on ValueDecls, either (it still needs to apply to other decls, like blocks). Consistently consume CC/noreturn information throughout codegen; enforce this by removing their default values in CodeGenTypes::getFunctionInfo(). llvm-svn: 95436
* Testing, 1, 2, 3...Charles Davis2010-02-051-2/+4
| | | | | | Also make the comments I added in r95291 consistent. llvm-svn: 95394
* Allow calling convention attributes to apply to types. Patch by Chip Davis!John McCall2010-02-041-0/+16
| | | | llvm-svn: 95291
* Implement access-check delays for out-of-line member definitionsJohn McCall2010-01-271-22/+45
| | | | | | using the same framework we use for deprecation warnings. llvm-svn: 94659
* Correctly treat 64 bit integers specified via the mode attribute as the 'long'Chandler Carruth2010-01-261-2/+8
| | | | | | | | | | type when that type is 64 bits wide, and the 'long long' type when 'long' is only 32 bits wide. This fixes PR6108. Also adds a bunch of test cases to ensure proper conversion between equally sized standard types and mode-specified types on both 32 and 64 bit targets. llvm-svn: 94527
* Simplify code with StringRef.Benjamin Kramer2010-01-231-6/+5
| | | | llvm-svn: 94314
* implement PR6007, diagnosing invalid attribute((section))Chris Lattner2010-01-121-5/+10
| | | | llvm-svn: 93255
* Generalize target weirdness handling having proper layering in mind:Anton Korobeynikov2010-01-101-1/+5
| | | | | | | | | 1. Add helper class for sema checks for target attributes 2. Add helper class for codegen of target attributes As a proof-of-concept - implement msp430's 'interrupt' attribute. llvm-svn: 93118
OpenPOWER on IntegriCloud