Граф коммитов

32 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor d89275bc86 Fix PR 4489, a crash in PCH loading that occurs when loading the name
of a top-level declaration loads another top-level declaration of the
same name whose type depends on the first declaration having been
completed. This commit breaks the circular dependency by delaying
loads of top-level declarations triggered by loading a name until we
are no longer recursively loading types or declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 18:54:52 +00:00
Argyrios Kyrtzidis 40b598eea1 Remove the ASTContext parameter from the attribute-related methods of Decl.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 02:34:44 +00:00
Nate Begeman 6f3d838867 OpenCL 1.0 support: attributes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74280 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-26 06:32:41 +00:00
Argyrios Kyrtzidis 8cff90e1f7 Serialize FunctionDecl's EndRangeLoc out to the PCH file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-20 08:09:34 +00:00
Douglas Gregor e0762c9211 Keep track of when declarations are "used" according to C and
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.

This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-19 23:52:42 +00:00
Douglas Gregor 68584ed35a Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 16:11:24 +00:00
Douglas Gregor 8dbc3c6496 Enumeration declarations that were instantiated from an enumeration
within a template now have a link back to the enumeration from which
they were instantiated. This means that we can now find the
instantiation of an anonymous enumeration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-27 17:20:35 +00:00
Douglas Gregor 78d1583d0b When evaluating a VarDecl as a constant or determining whether it is
an integral constant expression, maintain a cache of the value and the
is-an-ICE flag within the VarDecl itself. This eliminates
exponential-time behavior of the Fibonacci template metaprogram.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-26 18:54:04 +00:00
Douglas Gregor 75fdb23776 Fix lots of PCH crashes caused by the new assertions in
llvm::SmallVector, using data() instead of &[0]. The PCH testsuite now
runs cleanly (again).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72292 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 22:45:36 +00:00
Ted Kremenek 66ef111b16 Fix PCH crash caused by new assertions in llvm::SmallVector. Use
ProtoRefs.data() instead of &ProtoRefs[0] to access the raw buffer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72291 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 22:34:23 +00:00
Jay Foad beaaccd8e2 Use v.data() instead of &v[0] when SmallVector v might be empty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-21 09:52:38 +00:00
Fariborz Jahanian 5b16092767 implementation of format_arg for ObjC methods/functions.
Still more to do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-20 17:41:43 +00:00
Anders Carlsson 77b7f1d4fb Check that the function being overridden is virtual.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 22:15:41 +00:00
Anders Carlsson a75e8534f2 Improvements to the FunctionDecl getters/setters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71800 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 21:46:00 +00:00
Douglas Gregor 1eee0e753f Link FunctionDecls instantiated from the member functions of a class
template to the FunctionDecls from which they were instantiated. This
is a necessary first step to support instantiation of the definitions
of such functions, but by itself does essentially nothing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71792 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 21:06:31 +00:00
Fariborz Jahanian 5b53005fb9 Some early declarations to support sentinel attribute on
message dispatches (and function calls later). No change in
functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71683 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 18:09:35 +00:00
Ted Kremenek b71368d285 Add back Parse/Sema support for attributes cf_returns_retained and
ns_returns_retained, but do not include the other ownership attributes
we previously had.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71308 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 02:44:38 +00:00
Ted Kremenek 008fc73ac9 Remove experimental ownership attributes from Clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71216 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 15:19:25 +00:00
Ted Kremenek 69aa08072d Implement attribute 'ns_autorelease'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 18:44:20 +00:00
Ted Kremenek e351aa10da Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 00:46:09 +00:00
Ted Kremenek d99b345a1a Remove experimental attribute 'ns_ownership_make_collectable.'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 23:46:06 +00:00
Ted Kremenek 75494ffb4e Rename attributes 'objc_ownership...' to 'ns_ownership...'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 19:10:19 +00:00
Ted Kremenek 31c215e620 Rename attributes:
'objc_ownership_cfretain' -> 'cf_ownership_retain'
'objc_ownership_cfrelease' -> 'cf_ownership_release'

Motivation: Core Foundation objects can be used in isolation from Objective-C,
and this forces users to reason about the separate semantics of CF objects. More
Sema support pending.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 17:29:57 +00:00
Ted Kremenek bf20dbdec6 Implement ownership attribute 'objc_ownership_make_collectable'. This allows one
to add 'CFMakeCollectable' semantics to a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70336 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 22:32:26 +00:00
Chris Lattner d1d64a0275 Teach PCH that ASTContext is optional. Move -parse-noop and -Eonly (so far)
processing to after PCH is loaded.  -Eonly and -parse-noop are close to working
with PCH now but are not quite there yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 21:45:14 +00:00
Ted Kremenek c6a59e4bf2 Add two new checker-specific attributes: 'objc_ownership_release' and
'objc_ownership_cfrelease'. These are the 'release' equivalents of
'objc_ownership_retain' and 'objc_ownership_cfretain' respectively.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 19:36:56 +00:00
Ted Kremenek 4064de9598 Add new checker-specific attribute 'objc_ownership_cfretain'. This is the same
as 'objc_ownership_cfretain' except that the method acts like a CFRetain instead
of a [... retain] (important in GC modes). Checker support is wired up, but
currently only for Objective-C message expressions (not function calls).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70218 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 18:27:22 +00:00
Chris Lattner 02602be3cc unclone SavedStreamPosition
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70192 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 06:03:19 +00:00
Chris Lattner 4e3fcc845b move attribute reading to PCHReaderDecl.cpp, remove some
extraneous braces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 06:01:06 +00:00
Chris Lattner da93061f56 read all decls (and attributes and stmts/exprs referenced by the decl)
from the DeclsCursor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 05:58:23 +00:00
Chris Lattner 52e97d1afc change the interface to ReadStmt to force clients to pass a cursor in to read from.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70188 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 05:41:06 +00:00
Chris Lattner 698f925ded split decl reading out to its own PCHReaderDecl.cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 05:27:42 +00:00