Eli Friedman
85c3515516
Sanity fix for PR3642: if we're treating a diagnostic as an error, it's
...
required to actually be an error for correctness. The attached testcase
now gives an error instead of mysteriously crashing.
Now, it's possible we actually want to support the given usage, but I
haven't looked at the relevant code closely.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65253 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-22 00:20:44 +00:00
Steve Naroff
f7f52e7bf5
More work to integrate newly added ObjCQualifiedClassType into the type system.
...
This is necessary 'plumbing' to fix <rdar://problem/6497631> Message lookup is sometimes different than gcc's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65248 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 21:17:01 +00:00
Steve Naroff
15509f4fe7
Add support for GCC ObjC extension "Class<protocol>". Sigh.
...
Found while researching <rdar://problem/6497631> Message lookup is sometimes different than gcc's.
Will never be seen in user code. Needed to pass dejagnu testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65244 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 20:17:11 +00:00
Steve Naroff
8dfb0c57dd
Warn about bogus protocol qualifiers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 19:50:43 +00:00
Fariborz Jahanian
7b5b3170d9
Warn on use of __weak attribute on local
...
variable (objc2 gc specific).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 19:44:02 +00:00
Fariborz Jahanian
4ae1f05890
Fix a bug whereby a pointer to a __weak was not recognized
...
as __weak (objc2 gc specific).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65238 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 19:08:45 +00:00
Steve Naroff
ccef371a67
Fix <rdar://problem/6500554> missing objc error message.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:59:16 +00:00
Chris Lattner
685befeb5f
switch the macroinfo argument lists from being allocated off the heap
...
to being allocated from the same bumpptr that the MacroInfo objects
themselves are.
This speeds up -Eonly cocoa.h pth by ~4%, fsyntax-only is barely measurable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65195 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:46:43 +00:00
Chris Lattner
cf29e0716b
detemplatify setArgumentList and some other cleanups.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:31:31 +00:00
Chris Lattner
0301b3ff13
require the MAcroInfo objects are explcitly destroyed.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65179 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:19:20 +00:00
Chris Lattner
38af2deb27
add plumbing to get ASTContext& down to allocation/deallocation points in ObjCList,
...
but don't start using it yet. Renamed some methods to be more consistent.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65168 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 21:35:13 +00:00
Chris Lattner
11e1e1af26
newly factored, we can now move the set and destroy methods out of line.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65166 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 21:16:26 +00:00
Chris Lattner
793ccfd646
factor a bunch of common code out of the ObjCList template class
...
into a new shared ObjCListBase class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 21:14:14 +00:00
Chris Lattner
68835718c4
prune #includes
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 21:06:29 +00:00
Chris Lattner
88cf7a1690
rename ObjCList::clear() -> ObjCList::Destroy(). Require that destroy is called
...
before the dtor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 21:02:11 +00:00
Chris Lattner
a8ff9f455d
more random cleanups, add some fixme's. ObjCCategoryImplDecl really
...
shouldn't be a NamedDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 20:48:45 +00:00
Chris Lattner
7a21bd046f
move the @implementation ivar list to being an ObjCList, which prevents
...
it from being leaked, among other things.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 20:41:34 +00:00
Chris Lattner
2f0fe337f4
remove dead list.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 18:57:29 +00:00
Chris Lattner
89951a86b5
remove some more methods from objc decls, using the iterator
...
interfaces more consistently.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 18:43:26 +00:00
Chris Lattner
cafeb35117
remove some slow O(n) methods.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 18:18:36 +00:00
Chris Lattner
07fa7749da
Change ObjCForwardProtocolDecl to use an ObjCList.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65131 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 18:10:37 +00:00
Chris Lattner
67956052ea
move the interace list of @class to use ObjCList.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65129 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 18:04:31 +00:00
Chris Lattner
4a323d94e5
remove a dead list.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 17:53:35 +00:00
Daniel Dunbar
f8ebb4154e
Add some stdlib builtins
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65115 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 06:36:40 +00:00
Chris Lattner
2073216a10
switch ObjCMethodDecl's parameter list from being explicitly managed to an ObjCList.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65114 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 06:23:21 +00:00
Chris Lattner
e881483a3b
switch the interface ivar list from being explicitly managed to using ObjCList.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65113 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 06:10:45 +00:00
Chris Lattner
0b7ebb3dba
move more objc destruction out of dtors into Destroy.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 06:03:09 +00:00
Chris Lattner
411280e5b2
move some objc decl destruction out of dtors into Destroy method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65111 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 05:54:35 +00:00
Chris Lattner
676f0242a8
map source ranges through macro expansions. Before:
...
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
MAX(P, F);
^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
^
(no ranges on the second diagnostics)
After:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
MAX(P, F);
^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
~~~ ^ ~~~
(ranges!)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65090 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 00:25:28 +00:00
Chris Lattner
ebbbb1b211
refactor, pass ranges down instead of the whole
...
DiagnosticInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65088 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 00:18:51 +00:00
Chris Lattner
92dd386e3f
replace a dirty hack with a clean solution. Too bad we can't
...
use Blocks for our callbacks ;-)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 23:53:20 +00:00
Ted Kremenek
58e899b336
Added a new method to GRStmtNodeBuilder to build nodes using an arbitrary
...
PostStmt program point. This allows clients to pass in PostStmtCustom program
points.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65080 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 23:45:28 +00:00
Ted Kremenek
2680b5f926
ProgramPoint::Profile now specially handles PostStmtCustom (hashes on tag and data) so that clients don't need a unique address for the pair itself.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 23:43:16 +00:00
Mike Stump
b83d287bc7
Add enough checking to ensure that non-constant block literals don't
...
appear to be constant. I'll probably redo this and throw it all away
later once we have codegen for BlockDeclRefExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 22:01:56 +00:00
Anders Carlsson
5bab788d40
Add sema support for the noinline attribute.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65055 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 19:16:48 +00:00
Chris Lattner
b66158c299
fix PR3609, emit:
...
t.c:1:10: error: missing terminating '>' character
#include <stdio.h
^
instead of:
t.c:1:10: error: missing terminating " character
#include <stdio.h
^
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65052 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 18:29:56 +00:00
Chris Lattner
0be2ef2321
Fix PR3619 by properly considering size modifiers and type quals when
...
uniquing array types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 17:31:02 +00:00
Gabor Greif
4b5d486a0a
fix typo
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 09:27:40 +00:00
Daniel Dunbar
afa74448a0
Add Type::getAsFunctionNoProto
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65031 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 07:11:26 +00:00
Chris Lattner
d000c9ec6e
standardise on bastardised american spelling.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 06:49:30 +00:00
Chris Lattner
6858dd3fcc
fix a bug introduced in my previous patch: moving clang headers to the
...
"after" group instead of the system group makes it so #include <limits.h>
picks up the *system* limits.h file before clang's. This causes a failure
on linux and is definitely not what we want.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65026 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 06:48:28 +00:00
Chris Lattner
60b2837ba2
disable copying and assignment of AttributeList
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 06:41:35 +00:00
Chris Lattner
8bea7c0ee4
fix a typo gabor noticed
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 04:44:27 +00:00
Ted Kremenek
21fe8370f6
Implemented simple check in <rdar://problem/6600344>: When the receiver of a
...
message expression is nil and the return type is struct then the returned value
is undefined or potentially garbage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65003 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 04:06:22 +00:00
Fariborz Jahanian
f6123ca578
Couple of helpers for objc's gc attributes.
...
No change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64989 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 00:22:47 +00:00
Chris Lattner
b7d2553edd
fix some subtle bugs handling the mix of cvr qualifiers, addr spaces,
...
and gc attrs. Add an assert to check that we never
get ExtQualType(ExtQualType(T)).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 22:53:11 +00:00
Chris Lattner
bc5e150b6d
minor spacing changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64968 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 22:34:38 +00:00
Douglas Gregor
7c53ca6e03
Downgrade the "excess elements in initializer" errors to warnings *in
...
C*. They're required errors in C++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 22:23:55 +00:00
Chris Lattner
1e4db7c468
rip out __builtin_overload
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 22:14:55 +00:00
Douglas Gregor
48f3bb9f78
Downgrade complaints about calling unavailable functions to a warning
...
(as GCC does), except when we've performed overload resolution and
found an unavailable function: in this case, we actually error.
Merge the checking of unavailable functions with the checking for
deprecated functions. This unifies a bit of code, and makes sure that
we're checking for unavailable functions in the right places. Also,
this check can cause an error. We may, eventually, want an option to
make "unavailable" warnings into errors.
Implement much of the logic needed for C++0x deleted functions, which
are effectively the same as "unavailable" functions (but always cause
an error when referenced). However, we don't have the syntax to
specify deleted functions yet :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 21:56:37 +00:00