summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Get rid of FixedWidthIntType, as suggested by Chris and Eli.Anders Carlsson2009-12-291-1/+4
| | | | llvm-svn: 92246
* warn when attribute warn_unused_result is applied to void functions.Nuno Lopes2009-12-221-1/+6
| | | | | | while at it, remove an outdated FIXME llvm-svn: 91946
* fix PR4010: add support for the warn_unused_result for function pointersNuno Lopes2009-12-201-4/+3
| | | | llvm-svn: 91803
* This patch should fix PR2461. It allows clang to apply the noreturnMike Stump2009-12-151-1/+2
| | | | | | | | | attribute to function pointers. It also fixes Sema to check function pointers for the noreturn attribute when checking for fallthrough. Patch by Chip Davis, with a slight fix to pass the testsuite. llvm-svn: 91408
* Add support for the cleanup attribute for C++; we don't have to copyMike Stump2009-12-091-4/+0
| | | | | | all of g++'s bugs. llvm-svn: 90924
* DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated ↵John McCall2009-12-071-4/+4
| | | | | | | | | | | | | | | | | | | | | variables, but the results are imperfect. For posterity, I did: cat <<EOF > $cmdfile s/DeclaratorInfo/TypeSourceInfo/g s/DInfo/TInfo/g s/TypeTypeSourceInfo/TypeSourceInfo/g s/SourceTypeSourceInfo/TypeSourceInfo/g EOF find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \; find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \; find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \; llvm-svn: 90743
* Fix for PR5650 - Revised vector_size attribute handling to be done earlier ↵John Thompson2009-12-041-86/+1
| | | | | | before declaration is finalized. llvm-svn: 90600
* Use StringRef in Attr constructors.Benjamin Kramer2009-11-301-10/+4
| | | | llvm-svn: 90140
* Parse C++ member check attributes - base_check, hiding, and override.Alexis Hunt2009-11-251-43/+125
| | | | | | The attributes are currently ignored. llvm-svn: 89837
* Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and John McCall2009-11-241-3/+4
| | | | | | | | | | | | DependentScopeDeclRefExpr support storing templateids. Unite the common code paths between ActOnDeclarationNameExpr and ActOnTemplateIdExpr. This gets us to a point where we don't need to store function templates in the AST using TemplateNames, which is critical to ripping out OverloadedFunction. Also resolves a few FIXMEs. llvm-svn: 89785
* Added rudimentary C++0x attribute support.Alexis Hunt2009-11-211-3/+45
| | | | | | | | | | | | | | The following attributes are currently supported in C++0x attribute lists (and in GNU ones as well): - align() - semantics believed to be conformant to n3000, except for redeclarations and what entities it may apply to - final - semantics believed to be conformant to CWG issue 817's proposed wording, except for redeclarations - noreturn - semantics believed to be conformant to n3000, except for redeclarations - carries_dependency - currently ignored (this is an optimization hint) llvm-svn: 89543
* Start support of weak_import objective-c classes.Fariborz Jahanian2009-11-171-1/+1
| | | | | | (Radar 6815425). llvm-svn: 89124
* Adjust format attribute index for implicit object arguments. Fixes PR5521.Sebastian Redl2009-11-171-1/+8
| | | | llvm-svn: 89113
* Add support for cdecl attribute. (As far as I know, it doesn't affect CodeGenEli Friedman2009-11-091-0/+33
| | | | | | | | unless we start implementing command-line switches which override the default calling convention, so the effect is mostly to silence unknown attribute warnings.) llvm-svn: 86571
* Diagnose the use of 'fastcall' on functions without prototypes or withJohn McCall2009-11-041-0/+18
| | | | | | varargs prototypes. llvm-svn: 86001
* Change our basic strategy for avoiding deprecation warnings when the decl useJohn McCall2009-11-041-0/+59
| | | | | | | | | | | | appears in a deprecated context. In the new strategy, we emit the warnings as usual unless we're currently parsing a declaration, where "declaration" is restricted to mean a decl group or a few special cases in Objective C. If we *are* parsing a declaration, we queue up the deprecation warnings until the declaration has been completely parsed, and then emit them only if the decl is not deprecated. We also standardize the bookkeeping for deprecation so as to avoid special cases. llvm-svn: 85998
* Rename FunctionDecl::isInline/setInline toDouglas Gregor2009-10-271-3/+3
| | | | | | FunctionDecl::isInlineSpecified/setInlineSpecified. llvm-svn: 85305
* Preserve type source information in TypedefDecls. Preserve it acrossJohn McCall2009-10-241-6/+11
| | | | | | | | | template instantiation. Preserve it through PCH. Show it off to the indexer. I'm healthily ignoring the vector type cases because we don't have a sensible TypeLoc implementation for them anyway. llvm-svn: 84994
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-181-3/+3
| | | | | | are updated. llvm-svn: 84447
* Simplify HandleModeAttr.Daniel Dunbar2009-10-181-11/+8
| | | | llvm-svn: 84391
* Simplify HandleFormatAttr.Daniel Dunbar2009-10-181-35/+41
| | | | | | | | | | | | | | | - I have this crazy dream that one day someone will invent a miraculous tool so that developers, instead of hand optimizing their source code to obscure its intent and decrease its maleability, will instead write what they mean, and this strange and wonderful tool -- which I imagine would be called something fancy sounding like "an optimizing compiler" -- will make their code fast *for* them. With all the saved time, developers could maybe even focus on making the magic "optimizing compiler" better!! - No intended functionality change, all though I expect the universe to mock me for snarkiness. llvm-svn: 84390
* Fix for PR 5181.Edward O'Callaghan2009-10-131-1/+4
| | | | llvm-svn: 84051
* Refactor the LookupResult API to simplify most common operations. Require ↵John McCall2009-10-091-2/+3
| | | | | | | | | users to pass a LookupResult reference to lookup routines. Call out uses which assume a single result. llvm-svn: 83674
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-7/+7
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-9/+8
| | | | llvm-svn: 81346
* reduce indentation.Chris Lattner2009-09-081-17/+16
| | | | llvm-svn: 81234
* Regularize the case and sort.Mike Stump2009-08-261-6/+6
| | | | llvm-svn: 80163
* Handle the implicit 'this' parameter for format attributes.Anders Carlsson2009-08-251-3/+12
| | | | llvm-svn: 79987
* Enhance diagnostics concerning attribute 'ns_returns_retained' and ↵Ted Kremenek2009-08-191-4/+6
| | | | | | 'cf_returns_retained' to present the range of the attribute and have the diagnostic location be the declaration that the attribute was falsely attached to. This solves the problem where these diagnostics were being suppressed when these attributes were wrapped in a macro that was defined in a system header. llvm-svn: 79496
* Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema ↵Argyrios Kyrtzidis2009-08-191-2/+3
| | | | | | | | | | | | interfaces. DeclaratorDecl contains a DeclaratorInfo* to keep type source info. Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl. EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo. Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet. llvm-svn: 79392
* Change handling of attribute 'malloc' to only accept the attribute on functionTed Kremenek2009-08-151-14/+7
| | | | | | | | | | declarations (and not function pointers). This is consistent with GCC. Accepting this attribute on function pointers means that the attribute should be treated as a type qualifier, which apparently is not what GCC does. We obviously can change this later should we desire to enhance the 'malloc' attribute in this way. llvm-svn: 79060
* Per Eli Friedman's feedback, handle attribute 'malloc' being applied toTed Kremenek2009-08-141-5/+5
| | | | | | declarations of function pointers. llvm-svn: 79053
* Use 'dyn_cast' instead of a check for a function declaration followed by aTed Kremenek2009-08-141-2/+3
| | | | | | 'cast'. llvm-svn: 79041
* Improve Sema's handling of attribute 'malloc' to reject the attribute whenTed Kremenek2009-08-141-18/+26
| | | | | | | | | | | attaching to Objective-C methods (which mirrors GCC's behavior) and to allow the return type of the function to be an Objective-C pointer or Block pointer (which GCC also accepts). Along the way, add 'const' to some of the pointer arguments of various utility functions... llvm-svn: 79040
* change cast to dyn_cast because d may not be a FunctionDeclRyan Flynn2009-08-131-1/+1
| | | | llvm-svn: 78876
* change a dyn_cast to castRyan Flynn2009-08-121-1/+1
| | | | llvm-svn: 78862
* fix a couple of problems with section attributes:Chris Lattner2009-08-101-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Passing something that isn't a string used to cause: "argument to annotate attribute was not a string literal" make it say "section attribute" instead. 2. Fix the location of the above message to point to the bad argument instead of the section token. 3. Implement rdar://4341926, by diagnosing invalid section specifiers in the frontend rather than letting them slip all the way to the assembler (a QoI win). An example of #3 is that we used to produce something like this: /var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Expected comma after segment-name /var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Rest of line ignored. 1st junk character valued 46 (.). Daniel improved clang to use llvm_report_error, so now we got: $ clang t.c -c fatal error: error in backend: Global variable 'x' has an invalid section specifier 'sadf': mach-o section specifier requires a segment and section separated by a comma. with no loc info. Now we get: $ clang t.c -fsyntax-only t.c:4:30: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a comma int x __attribute__((section("sadf"))); ^ which is nice :) llvm-svn: 78586
* warn, as gcc does, if __attribute__((malloc)) applied to function returning ↵Ryan Flynn2009-08-091-0/+7
| | | | | | non-pointer type llvm-svn: 78542
* map previously ignored __attribute((malloc)) to noalias attribute of llvm ↵Ryan Flynn2009-08-091-0/+17
| | | | | | function's return llvm-svn: 78541
* Introduce a new PragmaPack attribute, and use it for #pragma pack. The ↵Anders Carlsson2009-08-081-2/+2
| | | | | | | | PackedAttr now only represents __attribute__((packed)). This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug. llvm-svn: 78483
* add support for FreeBSD's format(printf0,x,y) attribute; allows null format ↵Ryan Flynn2009-08-061-1/+2
| | | | | | string. llvm-svn: 78276
* Canonicalize else.Mike Stump2009-08-041-2/+1
| | | | llvm-svn: 78102
* PR3679 - enable #pragma weak aliasing.Ryan Flynn2009-07-311-6/+12
| | | | llvm-svn: 77660
* PR3679 - handle #pragma weakRyan Flynn2009-07-301-0/+47
| | | | llvm-svn: 77573
* Change uses of:Ted Kremenek2009-07-291-10/+10
| | | | | | | | | | | | | | | | | | | | Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. llvm-svn: 77510
OpenPOWER on IntegriCloud