Peter Collingbourne
e8cfaf4258
Sema: diagnose kernel functions with non-void return type
...
llvm-svn: 121653
2010-12-12 23:02:57 +00:00
Rafael Espindola
0017c5fa92
Fix PR8720 by printing an error message with a substring that the gcc testsuite searches for.
...
llvm-svn: 121137
2010-12-07 15:23:23 +00:00
Argyrios Kyrtzidis
7ddcb80efe
Remove a fixme which was fixed in a previous commit.
...
llvm-svn: 121029
2010-12-06 19:36:50 +00:00
Argyrios Kyrtzidis
e88168ae6e
Use Sema's MarkDeclarationReferenced, which takes care of templates, instead of calling Decl's setUsed directly.
...
Thanks to John for the hint!
llvm-svn: 121014
2010-12-06 17:51:53 +00:00
Argyrios Kyrtzidis
7b608976b1
Use the source location of the parameter, when it makes sense, for diagnostics in HandleCleanupAttr.
...
llvm-svn: 121013
2010-12-06 17:51:50 +00:00
Argyrios Kyrtzidis
86a26b8e35
Mark functions referenced by 'cleanup' attribute as used. Fixes rdar://8728293
...
llvm-svn: 120872
2010-12-04 01:12:11 +00:00
Eric Christopher
515d87ff95
Add some warning messages about invalid use of common/nocommon attributes.
...
llvm-svn: 120799
2010-12-03 06:58:14 +00:00
Eric Christopher
8a2ee390be
Add support for the common and nocommon attributes.
...
rdar://8560647
llvm-svn: 120650
2010-12-02 02:45:55 +00:00
Eric Christopher
bc638a83e0
80-col fixups.
...
llvm-svn: 120613
2010-12-01 22:13:54 +00:00
Peter Collingbourne
6ab610ce57
Basic, Sema: add support for CUDA location attributes
...
llvm-svn: 120545
2010-12-01 03:15:31 +00:00
Peter Collingbourne
e57e9ef9b7
Remove static_casts from SemaDeclAttr.cpp
...
llvm-svn: 120053
2010-11-23 20:45:58 +00:00
Dan Gohman
f41b525161
Drop the warning about __attribute__((may_alias)) being used
...
on a non-type declaration, as GCC permits it on variables too.
This fixes PR8635.
llvm-svn: 119517
2010-11-17 17:21:47 +00:00
Dan Gohman
bbb7d62546
Front-end support for __attribute__((may_alias)). This is not
...
yet hooked up to anything yet.
llvm-svn: 119407
2010-11-17 00:03:07 +00:00
Chandler Carruth
743682bb9f
Re-work the handling of implicit 'this' arguments and silly GCC-style attribute
...
argument indexes. This handles the offsets in a consistent manner for all of
the attributes which I saw working with these concepts. I've also added tests
for the attribute that motivated this: nonnull.
I consolidated the tests for format attributes into one file, and fleshed them
out a bit to trigger more of the warning cases. Also improved the quality of
some of the diagnostics that occur with invalid argument indices.
The only really questionable change here is supporting the implicit this
argument for the ownership attribute. I'm not sure it's really a sensible
concept there, but implemented the logic for consistency.
llvm-svn: 119339
2010-11-16 08:35:43 +00:00
John McCall
29600e160e
Kill off the remaining places which generate CK_Unknown casts.
...
llvm-svn: 119326
2010-11-16 02:32:08 +00:00
Bob Wilson
118baf7611
Add support for "neon_vector_type" and "neon_polyvector_type" attributes
...
to create the special Neon vector types. These are intended to be used in
Clang's version of <arm_neon.h> to define special Neon vector types that will
be mangled according to ARM's ABI.
llvm-svn: 119301
2010-11-16 00:32:24 +00:00
John McCall
8cb679e4e1
Assorted work leading towards the elimination of CK_Unknown.
...
llvm-svn: 119138
2010-11-15 09:13:47 +00:00
John McCall
6fe024052b
Don't compute linkage for a declaration as part of the #pragma weak
...
forward-declaration support unless there's really a mapping for that
name.
llvm-svn: 117426
2010-10-27 00:59:00 +00:00
Ted Kremenek
22813f4077
Tidy up comment (remove extraneous text).
...
llvm-svn: 117044
2010-10-21 18:49:36 +00:00
Benjamin Kramer
bfac7dcda0
Don't rely on a StringRef being null-terminated (it's not) for deprecation messages.
...
Store pointer and length of the message in DelayedDiagnostic and hide the gory union details.
llvm-svn: 116153
2010-10-09 15:49:00 +00:00
Fariborz Jahanian
c74073cd20
Patch for adding message to unavailable attribute.
...
And its documentation.
Finishes off // rdar: // 6734520.
llvm-svn: 115862
2010-10-06 23:12:32 +00:00
Fariborz Jahanian
776653a70a
Simplified code for deprecated attribute wih message a little.
...
llvm-svn: 115856
2010-10-06 22:20:08 +00:00
Fariborz Jahanian
55106310ae
Add message to attribute(deprecated).
...
attribute(unavailable) to do next.
// rdar:// 6734520.
llvm-svn: 115842
2010-10-06 21:18:44 +00:00
Daniel Dunbar
8caf6415a8
Add support for attribute((naked)), patch by Zoxc on cfe-commits!
...
- Minor style tweaks by me.
llvm-svn: 115056
2010-09-29 18:20:25 +00:00
Fariborz Jahanian
3567c426c4
Patch to support transparent_union arguments
...
passed to nonnull attributed functions. Implements radar
6857843.
llvm-svn: 114917
2010-09-27 22:42:37 +00:00
Fariborz Jahanian
cb67d7b7c2
Issue warning for trivial cases of nonnull attributes
...
(on functions with no pointer arguments) but only when
the attribute has not been coming from a macro
instantiation in a header file. Fixes first part
of radar 6857843.
llvm-svn: 114860
2010-09-27 19:05:51 +00:00
John Thompson
9a587aaaa9
Add more error checking to attribute vecreturn
...
llvm-svn: 114251
2010-09-18 01:12:07 +00:00
Ted Kremenek
0f107e4386
Relax __attribute_((nonnull)) checking to allow the attribute on functions with no pointer arguments. GCC doesn't warn
...
in this case, and the attribute is trivially satisfied (and benign). Fixes <rdar://problem/8364828>.
llvm-svn: 113464
2010-09-09 01:17:32 +00:00
Dawn Perchik
335e16bad4
Add symantic support for the Pascal calling convention via
...
"__attribute((pascal))" or "__pascal" (and "_pascal" under
-fborland-extensions). Support still needs to be added to llvm.
llvm-svn: 112939
2010-09-03 01:29:35 +00:00
Sebastian Redl
50c682585f
Rename DeclContext::getLookupContext to getRedeclContext and change its semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them.
...
llvm-svn: 112563
2010-08-31 00:36:30 +00:00
Douglas Gregor
4d13d10df2
Add a missing return. Bug noticed by Dawn Perchik!
...
llvm-svn: 112552
2010-08-30 23:30:49 +00:00
John McCall
faf5fb4b78
One who seeks knowledge learns something new every day.
...
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
2010-08-26 23:41:50 +00:00
John McCall
8e7d656a4a
De-memberify the VarDecl and FunctionDecl StorageClass enums.
...
This lets us remove Sema.h's dependency on Expr.h and Decl.h.
llvm-svn: 112156
2010-08-26 03:08:43 +00:00
John McCall
b45a1e735a
Restore r112114 now that SmallVector<...,0> is safe.
...
llvm-svn: 112148
2010-08-26 02:13:20 +00:00
Daniel Dunbar
b6ceacf623
Revert r112114, "Pull DelayedDiagnostic and AccessedEntity out into their own
...
header.", it is teh broken.
llvm-svn: 112123
2010-08-26 00:52:50 +00:00
John McCall
6b48873d50
Pull DelayedDiagnostic and AccessedEntity out into their own header.
...
This works courtesy of the new SmallVector<..., 0> specialization that
doesn't require a complete type. Note that you'll need to pull at least
SmallVector.h from LLVM to compile successfully.
llvm-svn: 112114
2010-08-25 23:44:00 +00:00
John McCall
8302463dc6
Split out a header to hold APIs meant for the Sema implementation from Sema.h.
...
Clients of Sema don't need to know (for example) the list of diagnostics we
support.
llvm-svn: 112093
2010-08-25 22:03:47 +00:00
John McCall
28a0cf7825
Remove Sema.h's dependency on DeclCXX.h.
...
llvm-svn: 112032
2010-08-25 07:42:41 +00:00
John McCall
ba7bf59503
Abstract out passing around types and kill off ActionBase.
...
llvm-svn: 111901
2010-08-24 05:47:05 +00:00
John McCall
b268a282a4
Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).
...
llvm-svn: 111863
2010-08-23 23:25:46 +00:00
John McCall
4887165193
DeclPtrTy -> Decl *
...
llvm-svn: 111733
2010-08-21 09:40:31 +00:00
John McCall
8b0666cf79
Another step in the process of making the parser depend on Sema:
...
- move DeclSpec &c into the Sema library
- move ParseAST into the Parse library
Reflect this change in a thousand different includes.
Reflect this change in the link orders.
llvm-svn: 111667
2010-08-20 18:27:03 +00:00
Ted Kremenek
5295ce8120
HandleCommonNoReturnAttr() now only has a single caller. Move that logic to HandleAnalyzerNoReturnAttr.
...
llvm-svn: 111491
2010-08-19 00:51:58 +00:00
Alexis Hunt
dcfba7b35b
Generate Attr subclasses with TableGen.
...
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
2010-08-18 23:23:40 +00:00
Fariborz Jahanian
798f83239c
Diagnose use of iboutletcollection on ivar/property
...
of non-object types. Radar 8308053.
llvm-svn: 111296
2010-08-17 21:39:27 +00:00
Fariborz Jahanian
b5d59b66c2
Patch to add type parameter support for attribute iboutletcollection.
...
Radar 8308053.
llvm-svn: 111275
2010-08-17 20:23:12 +00:00
Douglas Gregor
c3a6ade0bb
Move Sema's headers into include/clang/Sema, renaming a few along the way.
...
llvm-svn: 110945
2010-08-12 20:07:10 +00:00
Douglas Gregor
62157e5342
Downgrade error about nonnull attribute bbeing applied to a function without point arguments to a warning
...
llvm-svn: 110939
2010-08-12 18:48:43 +00:00
Jordy Rose
5af0e3cbba
Remove OwnershipAttr::Kind, since it's essentially redundant with attr::Kind the way it's being used. Also fix isa<OwnershipAttr> support, break more-than-80-char lines, and other miscellaneous ownership attr cleanup.
...
llvm-svn: 110908
2010-08-12 08:54:03 +00:00
John Thompson
cdb847ba16
Added vecreturn attribute parsing.
...
llvm-svn: 110609
2010-08-09 21:53:52 +00:00