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

2061 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 2263f822c3 Don't error when a block pointer is passed to a
vararg functions/methods. Fixes radar 7725203.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98070 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 18:34:52 +00:00
Benjamin Kramer bb9357cf8f Replace copy loops with memcpy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98055 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-09 12:53:38 +00:00
Ted Kremenek 503524acc7 Allocate ASTRecordLayout objects using the allocator associated with ASTContext.
This allows them to be allocated using a BumpPtrAllocated
in the common case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97978 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 20:56:29 +00:00
Douglas Gregor c2350e553b Extend ObjCMessageExpr for class method sends with the source location
of the class name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97943 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 16:40:19 +00:00
Douglas Gregor 4bc1cb6aa6 Keep track of type source information in the return type of an
Objective-C method declaration, e.g., for 

  - (Foo *)myMethod;

we now have TypeSourceInfo for the Foo*.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 14:59:44 +00:00
Fariborz Jahanian a42286486c Patch to build qualifier on objective-c
pointer types. Fixes radar 7626768.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 22:42:55 +00:00
Douglas Gregor 4273857325 When we invalidate a declaration, make it public, so that it doesn't
trigger access control or one of the many assertions we have for valid
access specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-05 00:26:45 +00:00
Douglas Gregor 4e6ba4be8d Implement name hiding for names found through virtual base subobjects
that are hidden by other derived base subobjects reached along a
lookup path that does *not* pass through the hiding subobject (C++
[class.member.lookup]p6). Fixes PR6462.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 04:38:46 +00:00
Douglas Gregor 89b7702c9a Refactor CXXRecordDecl::lookupInBases() to push the recursion down a
level. No functionality change, and it obeys access control this
time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97634 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 02:18:00 +00:00
Douglas Gregor 7f7f5f2803 Revert r97618. Access control sucks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 01:13:25 +00:00
Douglas Gregor 3262a0f7b8 Factor out the recursive lookup into C++ base classes into a separate,
static function. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 01:02:31 +00:00
Douglas Gregor 7d10b7eb67 Eliminate the static map of overridden C++ methods, which was going to
come back to bite us at some point. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97607 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 23:58:15 +00:00
John McCall ad5e738870 Split out types that are non-canonical unless dependent as their own
category.  Use this in a few places to eliminate unnecessary TST cases and
do some future-proofing.  Provide terrible manglings for typeof.  Mangle
decltype with some hope of accuracy.

Our manglings for some of the cases covered in the testcase are different
from gcc's, which I've raised as an issue with the ABI list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97523 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 23:49:17 +00:00
John McCall db7b72a82a Support constant-evaluation of __builtin_nans* as well as the correct constant
evaluation of __builtin_nan*.  Most of the work to make this work is in LLVM.

Fixes <rdar://problem/7696712> and part of PR 5255.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97383 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 13:00:19 +00:00
Douglas Gregor 5fe8c04009 Skip dependent virtual base classes; fixes PR6413.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97291 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 00:25:28 +00:00
Douglas Gregor 6d90870fe8 Implement semantic analysis for C++ [expr.new]p18-20, which describe
how we find the operator delete that matches withe operator new we
found in a C++ new-expression.

This will also need CodeGen support. On a happy note, we're now a
"nans" away from building tramp3d-v4.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 05:06:18 +00:00
Fariborz Jahanian b2f8121656 Forgot to include nested protocols in collection, resulting in
bogus warning. Fixes radar 7682116.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 18:24:33 +00:00
Douglas Gregor a2e7dd2f4a Use CXXPseudoDestructorExpr as the stored representation for dependent
expressions that look like pseudo-destructors, e.g.,

  p->T::~T()

where p has dependent type.

At template instantiate time, we determine whether we actually have a
pseudo-destructor or a member access, and funnel down to the
appropriate routine in Sema.

Fixes PR6380.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 01:56:36 +00:00
Douglas Gregor 26d4ac97fb Retain complete source information for the type after the '~' in a
CXXPseudoDestructorExpr. 

Update template instantiation for pseudo-destructor expressions to use
this source information and to make use of
Sema::BuildPseudoDestructorExpr when the base expression is dependent
or refers to a scalar type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97079 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 23:40:28 +00:00
John McCall f604a5648d References to const int parameters with ICE default arguments are not ICEs.
Fixes PR6373.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 09:03:18 +00:00
Rafael Espindola 11e8ce7380 Add support for the weakref attribute. We still produce "alias weak" as llvm-gcc does, but are more strict on what uses of weakref we accept.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 22:00:30 +00:00
Charles Davis 05f62474dd When a reference to a field of a struct/union/class is passed to the
__alignof__ operator, make sure to take into account the packed alignment
of the struct/union/class itself. Matches GCC's behavior and fixes PR6362.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96884 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 04:52:00 +00:00
Fariborz Jahanian 0e5ad25572 More support for ivars in class extension.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96850 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 01:26:30 +00:00
John McCall c0bf462cf3 Perform two more constructor/destructor code-size optimizations:
1) emit base destructors as aliases to their unique base class destructors
under some careful conditions.  This is enabled for the same targets that can
support complete-to-base aliases, i.e. not darwin.

2) Emit non-variadic complete constructors for classes with no virtual bases
as calls to the base constructor.  This is enabled on all targets and in
theory can trigger in situations that the alias optimization can't (mostly
involving virtual bases, mostly not yet supported).

These are bundled together because I didn't think it worthwhile to split them,
not because they really need to be.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 00:48:20 +00:00
Douglas Gregor fdd8ab11bc Don't assert that we have a valid access specifier on an invalid
declaration. This is the trivial part of PR6365.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96792 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 17:53:38 +00:00
Douglas Gregor 325bf177ac Set access specifiers on imported declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 17:42:47 +00:00
Douglas Gregor ce056bcaa1 Eliminate the default arguments to ASTContext::getFunctionType(),
fixing up a few callers that thought they were propagating NoReturn
information but were in fact saying something about exception
specifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96766 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 22:15:06 +00:00
Douglas Gregor c144f3534e Implement AST import for C++ member functions, including constructors, destructors, and conversions. Unfortunately, this cannot be tested yet, since we don't have C++ PCH support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 18:29:16 +00:00
Douglas Gregor 788c62d1e8 Implement AST importing for C++ namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96740 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 18:26:36 +00:00
Douglas Gregor 083a821bbd Collect the code that imports all of the members of a declaration context into a single function, ImportDeclContext. Use it rather than explicit loops. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96739 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 18:24:45 +00:00
Chandler Carruth 8761d680ea Make Decl::isOutOfLine() virtual, and use that to determine when definitions
are for out of line declarations more easily. This simplifies the logic and
handles the case of out-of-line class definitions correctly. Fixes PR6107.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96729 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 07:08:09 +00:00
Ted Kremenek ba7bc5584b Revert: "Change InitListExpr to allocate the array for holding references"
This was causing buildbot breakage.

This reverts commit d46e952cc8cb8d9eed8657d9a0b267910a0f745a.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96652 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 01:50:18 +00:00
Douglas Gregor 0e12b44081 Add a missing break. Cocoa.h can now be merged twice into the same AST context
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 01:36:36 +00:00
Douglas Gregor 008847a70a AST import for CStyleCastExpr. With this, we can import Cocoa.h into an empty context
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96648 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 01:32:14 +00:00
Douglas Gregor bd249a5428 AST import for sizeof and alignof expressions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96647 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 01:24:23 +00:00
Douglas Gregor 4408063066 AST import for DeclRefExprs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96646 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 01:17:02 +00:00
Douglas Gregor f638f9580b AST import of parenthesized expressions, unary operators, binary
operators, and compound assignment operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 01:07:06 +00:00
Ted Kremenek 9f9269e810 Change InitListExpr to allocate the array for holding references
to initializer expressions in an array allocated using ASTContext.

This plugs a memory leak when ASTContext uses a BumpPtrAllocator to
allocate memory for AST nodes.

In my mind this isn't an ideal solution; it would be nice to have
a general "vector"-like class that allocates memory using ASTContext,
but whose guts could be separated from the methods of InitListExpr
itself.  I haven't gone and taken this approach yet because it isn't
clear yet if we'll eventually want an alternate solution for recylcing
memory using by InitListExprs as we are constructing the ASTs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 00:42:33 +00:00
Fariborz Jahanian 11062e1123 Patch removes IVars list from ObjCInterfaceDecl and
instead relies on their DeclContext for iteration, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 00:31:17 +00:00
Benjamin Kramer bb2d176c4f Try to fix the auroraux buildbot. I suspect it has a "#define SEC" somewhere.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 13:02:13 +00:00
Douglas Gregor b2e400aae8 AST import for character literals
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96557 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 02:21:22 +00:00
Douglas Gregor 2b78502297 AST import for forward declarations of Objective-C protocols
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96555 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 02:12:22 +00:00
Douglas Gregor a2bc15b746 Implement import of forward declarations of Objective-C classes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96554 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 02:04:09 +00:00
Douglas Gregor b4677b62a8 AST import of Objective-C categories.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 01:47:50 +00:00
Ted Kremenek 31c780d95a Add 'ns_returns_not_retained' and 'cf_returns_not_retained' attributes to
match 'ns_returns_retained' and 'cf_returns_retained' respectively.  These
are not yet hooked up to the static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 00:05:45 +00:00
Douglas Gregor 2cd00932b9 Implement AST importing of ImplicitParamDecls, despite the sad fact
that we can't test it yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96516 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 21:22:52 +00:00
Douglas Gregor e3261624c1 Implement AST merging for Objective-C properties.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96483 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 18:02:10 +00:00
Douglas Gregor 2e2a400383 AST import for Objective-C protocols
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 16:12:00 +00:00
Ted Kremenek efbddd2317 Add IBAction attribute to keep the IBOutlet attribute company.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96447 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 02:37:45 +00:00
Tanya Lattner 12ead498c4 Fix unused function warning to handle used attributes and redeclarations. Update test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 02:17:21 +00:00