]> granicus.if.org Git - clang/log
clang
14 years agoCanonicalize parameter and return types before computing ABI info. Eliminates
John McCall [Wed, 24 Feb 2010 07:14:12 +0000 (07:14 +0000)]
Canonicalize parameter and return types before computing ABI info.  Eliminates
a common source of oddities and, in theory, removes some redundant ABI
computations.  Also fixes a miscompile I introduced yesterday by refactoring
some code and causing a slightly different code path to be taken that
didn't perform *parameter* type canonicalization, just normal type
canonicalization;  this in turn caused a bit of ABI code to misfire because
it was looking for 'double' or 'float' but received 'const float'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97030 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd comments.
Zhongxing Xu [Wed, 24 Feb 2010 04:54:56 +0000 (04:54 +0000)]
Add comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97020 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDisable one test case because of the inconsistent results it is giving on
Ted Kremenek [Wed, 24 Feb 2010 02:28:29 +0000 (02:28 +0000)]
Disable one test case because of the inconsistent results it is giving on
Windows and Mac OS X.  Will investigate later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97016 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen we encounter a function-specific attribute in a declaration specifier,
Charles Davis [Wed, 24 Feb 2010 02:27:18 +0000 (02:27 +0000)]
When we encounter a function-specific attribute in a declaration specifier,
apply it only to the function itself, and never to the return type. Fixes part
of PR6408.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97015 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAlways add CallExpr as block-level expression. Inline-based interprocedural
Zhongxing Xu [Wed, 24 Feb 2010 02:19:28 +0000 (02:19 +0000)]
Always add CallExpr as block-level expression. Inline-based interprocedural
analysis needs this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97014 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCorrect radar no.
Fariborz Jahanian [Wed, 24 Feb 2010 01:37:04 +0000 (01:37 +0000)]
Correct radar no.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97009 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix rewriting of a method when return type is
Fariborz Jahanian [Wed, 24 Feb 2010 01:25:40 +0000 (01:25 +0000)]
Fix rewriting of a method when return type is
a block pointer type. Fixes radar 7682149.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97008 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd support for '%C' and '%S' printf conversion specifiers.
Ted Kremenek [Wed, 24 Feb 2010 00:05:54 +0000 (00:05 +0000)]
Add support for '%C' and '%S' printf conversion specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97005 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore Sema check for ivars in class continuation.
Fariborz Jahanian [Tue, 23 Feb 2010 23:41:11 +0000 (23:41 +0000)]
More Sema check for ivars in class continuation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97002 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEmit debug info for VectorType.
Devang Patel [Tue, 23 Feb 2010 22:59:39 +0000 (22:59 +0000)]
Emit debug info for VectorType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96999 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix buildbot failure on windows by slightly trimming test output to ignore temporary...
Blaine Garst [Tue, 23 Feb 2010 22:59:01 +0000 (22:59 +0000)]
fix buildbot failure on windows by slightly trimming test output to ignore temporary name

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96998 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd support for the weakref attribute. We still produce "alias weak" as llvm-gcc...
Rafael Espindola [Tue, 23 Feb 2010 22:00:30 +0000 (22:00 +0000)]
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

14 years agoUnconditionally support block introspection data in a new field at the end
Blaine Garst [Tue, 23 Feb 2010 21:51:17 +0000 (21:51 +0000)]
Unconditionally support block introspection data in a new field at the end
of the block descriptor field.  This field is the ObjC style @encode
signature of the implementation function, and was to this point
conditionally provided in the block literal data structure.  That
provisional support is removed.

Additionally, eliminate unused enumerations for the block literal flags field.
The first shipping ABI unconditionally set (1<<29) but this bit is unused
by the runtime, so the second ABI will unconditionally have (1<<30) set so
that the runtime can in fact distinguish whether the additional data is
present or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96989 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixes a rewriting of qualified-id type which exposed a bigger
Fariborz Jahanian [Tue, 23 Feb 2010 21:34:38 +0000 (21:34 +0000)]
Fixes a rewriting of qualified-id type which exposed a bigger
rewriting problem. Fixes radar 7680953.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96987 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDead emit dead store warnings when assigning nil to an ObjC object
Ted Kremenek [Tue, 23 Feb 2010 21:19:33 +0000 (21:19 +0000)]
Dead emit dead store warnings when assigning nil to an ObjC object
pointer (for defensive programming).  This matches the behavior with
assigning NULL to a regular pointer.  Fixes <rdar://problem/7631278>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96985 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix bogus diagnostic format string.
Daniel Dunbar [Tue, 23 Feb 2010 20:23:45 +0000 (20:23 +0000)]
Fix bogus diagnostic format string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96978 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix another crash on invalid code. In this case, handle ObjC categories (with no...
Ted Kremenek [Tue, 23 Feb 2010 19:39:46 +0000 (19:39 +0000)]
Fix another crash on invalid code.  In this case, handle ObjC categories (with no names)
that refer to an undefined class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96976 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't assert on compound assignment operators that operate in FP types when
John McCall [Tue, 23 Feb 2010 19:22:29 +0000 (19:22 +0000)]
Don't assert on compound assignment operators that operate in FP types when
the result is integral.  Fixes <rdar://problem/7676608>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96970 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoA test case for property synthesis using ivar in class extensions.
Fariborz Jahanian [Tue, 23 Feb 2010 18:50:01 +0000 (18:50 +0000)]
A test case for property synthesis using ivar in class extensions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96968 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake previous fix handle a few more edge cases.
Eli Friedman [Tue, 23 Feb 2010 18:25:09 +0000 (18:25 +0000)]
Make previous fix handle a few more edge cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96962 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPR6400: Handle an extreme edge case in mangling correctly.
Eli Friedman [Tue, 23 Feb 2010 18:20:18 +0000 (18:20 +0000)]
PR6400: Handle an extreme edge case in mangling correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96961 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPR6386: Fix a recent regression in IRGen of cast-to-union constructs.
Eli Friedman [Tue, 23 Feb 2010 17:58:35 +0000 (17:58 +0000)]
PR6386: Fix a recent regression in IRGen of cast-to-union constructs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96958 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRetain attributes for K&R style parameter declarations.
Richard Pennington [Tue, 23 Feb 2010 12:22:13 +0000 (12:22 +0000)]
Retain attributes for K&R style parameter declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96941 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd test case for <rdar://problem/7242010>, which appears to have been fixed
Ted Kremenek [Tue, 23 Feb 2010 07:17:57 +0000 (07:17 +0000)]
Add test case for <rdar://problem/7242010>, which appears to have been fixed
in the recent changes to RegionStore::InvalidateRegions().  Note that we
are still not yet modeling 'memcpy()' explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96902 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement IsOverriderUsed. This can't be tested yet due to some other bugs :)
Anders Carlsson [Tue, 23 Feb 2010 06:34:44 +0000 (06:34 +0000)]
Implement IsOverriderUsed. This can't be tested yet due to some other bugs :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96897 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen comparing two calling conventions after redeclaring a function, compare
Charles Davis [Tue, 23 Feb 2010 06:13:55 +0000 (06:13 +0000)]
When comparing two calling conventions after redeclaring a function, compare
the canonical calling conventions instead of comparing the raw calling
conventions directly. Fixes PR6361.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96895 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove the rest of the unreachable code analysis from libSema
Ted Kremenek [Tue, 23 Feb 2010 05:59:20 +0000 (05:59 +0000)]
Move the rest of the unreachable code analysis from libSema
to libAnalysis (with only the error reporting in libSema).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96893 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify check for basic block with a CXXTryStmt terminator.
Ted Kremenek [Tue, 23 Feb 2010 05:59:16 +0000 (05:59 +0000)]
Simplify check for basic block with a CXXTryStmt terminator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96892 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen a reference to a field of a struct/union/class is passed to the
Charles Davis [Tue, 23 Feb 2010 04:52:00 +0000 (04:52 +0000)]
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

14 years agoStub out IsOverriderUsed.
Anders Carlsson [Tue, 23 Feb 2010 04:26:39 +0000 (04:26 +0000)]
Stub out IsOverriderUsed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96883 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore fixes. Don't try to emit a virtual base vtable if the virtual base in question...
Anders Carlsson [Tue, 23 Feb 2010 03:48:14 +0000 (03:48 +0000)]
More fixes. Don't try to emit a virtual base vtable if the virtual base in question is a primary virtual base of some other base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96881 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAlways emit vcall offset for the primary base, not only if it's virtual. Remove a...
Anders Carlsson [Tue, 23 Feb 2010 03:26:17 +0000 (03:26 +0000)]
Always emit vcall offset for the primary base, not only if it's virtual. Remove a debug printf, and add the test case that now passes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96880 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify the vcall offset calculation and make it give the correct answers :) My...
Anders Carlsson [Tue, 23 Feb 2010 03:14:49 +0000 (03:14 +0000)]
Simplify the vcall offset calculation and make it give the correct answers :) My test case now has the right values but in the wrong order.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96877 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd missing header file.
Ted Kremenek [Tue, 23 Feb 2010 03:08:26 +0000 (03:08 +0000)]
Add missing header file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96875 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore work on vcall offsets. We now emit the right number of vcall offsets in my local...
Anders Carlsson [Tue, 23 Feb 2010 02:47:31 +0000 (02:47 +0000)]
More work on vcall offsets. We now emit the right number of vcall offsets in my local test case, but not the right values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96874 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStart moving some of the logic for the unreachable code analysis out of libSema
Ted Kremenek [Tue, 23 Feb 2010 02:39:16 +0000 (02:39 +0000)]
Start moving some of the logic for the unreachable code analysis out of libSema
and into libAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96872 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoConvert use of std::queue to llvm::SmallVector and fix buildbot.
Ted Kremenek [Tue, 23 Feb 2010 01:39:04 +0000 (01:39 +0000)]
Convert use of std::queue to llvm::SmallVector and fix buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96855 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove BaseOffset out of the FinalOverriders class.
Anders Carlsson [Tue, 23 Feb 2010 01:34:28 +0000 (01:34 +0000)]
Move BaseOffset out of the FinalOverriders class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96853 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore support for ivars in class extension.
Fariborz Jahanian [Tue, 23 Feb 2010 01:26:30 +0000 (01:26 +0000)]
More support for ivars in class extension.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96850 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse SmallVectorImpl::iterator.
Ted Kremenek [Tue, 23 Feb 2010 01:19:17 +0000 (01:19 +0000)]
Use SmallVectorImpl::iterator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96848 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify logic for determining values of 'ReturnsVoid' and 'HasNoReturn' flags.
Ted Kremenek [Tue, 23 Feb 2010 01:19:11 +0000 (01:19 +0000)]
Simplify logic for determining values of 'ReturnsVoid' and 'HasNoReturn' flags.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96847 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCorrect comment.
Zhongxing Xu [Tue, 23 Feb 2010 01:17:41 +0000 (01:17 +0000)]
Correct comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96846 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPerform two more constructor/destructor code-size optimizations:
John McCall [Tue, 23 Feb 2010 00:48:20 +0000 (00:48 +0000)]
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

14 years agoImplement crazy destructor name lookup semantics differently in
Douglas Gregor [Tue, 23 Feb 2010 00:15:22 +0000 (00:15 +0000)]
Implement crazy destructor name lookup semantics differently in
C++98/03 and C++0x, since the '0x semantics break valid C++98/03
code. This new mess is tracked by core issue 399, which is still
unresolved.

Fixes PR6358 and PR6359.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96836 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRework the CIndex API for displaying diagnostics. Instead of printing
Douglas Gregor [Mon, 22 Feb 2010 23:17:23 +0000 (23:17 +0000)]
Rework the CIndex API for displaying diagnostics. Instead of printing
the diagnostics to a FILE*, return a CXString containing the formatted
diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96823 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEarly support for declaring ivars in class extensions. wip.
Fariborz Jahanian [Mon, 22 Feb 2010 23:04:20 +0000 (23:04 +0000)]
Early support for declaring ivars in class extensions. wip.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96819 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixes a rewriting of byref variable when its initializer is
Fariborz Jahanian [Mon, 22 Feb 2010 20:48:10 +0000 (20:48 +0000)]
Fixes a rewriting of byref variable when its initializer is
itself rewritten. Radar 7669784.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96798 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't assert that we have a valid access specifier on an invalid
Douglas Gregor [Mon, 22 Feb 2010 17:53:38 +0000 (17:53 +0000)]
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

14 years agoSet access specifiers on imported declarations.
Douglas Gregor [Mon, 22 Feb 2010 17:42:47 +0000 (17:42 +0000)]
Set access specifiers on imported declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96788 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDo not require a complete type when checking for a pointer conversion
Douglas Gregor [Mon, 22 Feb 2010 17:06:41 +0000 (17:06 +0000)]
Do not require a complete type when checking for a pointer conversion
between cv1 T* and cv2 T*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96787 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange the name of the vtable-debugging environment variable to
Douglas Gregor [Mon, 22 Feb 2010 16:48:26 +0000 (16:48 +0000)]
Change the name of the vtable-debugging environment variable to
CLANG_VTABLE_DEBUG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96785 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't use NamedDecl::getNameAsCString() when dealing with C++ methods,
Douglas Gregor [Mon, 22 Feb 2010 16:44:27 +0000 (16:44 +0000)]
Don't use NamedDecl::getNameAsCString() when dealing with C++ methods,
since they may not have normal identifiers for names. Fixes PR6369.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96784 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert "Simplify code: Succ is guaranteed to be not NULL.", which turns out to
Daniel Dunbar [Mon, 22 Feb 2010 05:58:59 +0000 (05:58 +0000)]
Revert "Simplify code: Succ is guaranteed to be not NULL.", which turns out to
not be guaranteed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96782 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove dead code.
Zhongxing Xu [Mon, 22 Feb 2010 03:50:18 +0000 (03:50 +0000)]
Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96773 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify code: Succ is guaranteed to be not NULL.
Zhongxing Xu [Mon, 22 Feb 2010 02:59:27 +0000 (02:59 +0000)]
Simplify code: Succ is guaranteed to be not NULL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96772 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd 'previous declaration is here' note for param redefinition
Chris Lattner [Mon, 22 Feb 2010 00:40:25 +0000 (00:40 +0000)]
Add 'previous declaration is here' note for param redefinition
errors, e.g.:

t.c:1:21: error: redefinition of parameter 'x'
int test(int x, int x);
                    ^
t.c:1:14: note: previous declaration is here
int test(int x, int x);
             ^

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96769 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate the default arguments to ASTContext::getFunctionType(),
Douglas Gregor [Sun, 21 Feb 2010 22:15:06 +0000 (22:15 +0000)]
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

14 years agoSpell string.h correctly.
Daniel Dunbar [Sun, 21 Feb 2010 22:14:52 +0000 (22:14 +0000)]
Spell string.h correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96765 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd missing include, noticed by ace2001ac on IRC.
Daniel Dunbar [Sun, 21 Feb 2010 22:07:42 +0000 (22:07 +0000)]
Add missing include, noticed by ace2001ac on IRC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96764 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove unused includes.
Daniel Dunbar [Sun, 21 Feb 2010 21:47:19 +0000 (21:47 +0000)]
Remove unused includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96760 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDe-XFAIL some win32 tests that are now passing
Douglas Gregor [Sun, 21 Feb 2010 20:58:24 +0000 (20:58 +0000)]
De-XFAIL some win32 tests that are now passing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96759 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAttempt to fix the MSVC9 failure with c-indext-test, where the CIndex DLL
Douglas Gregor [Sun, 21 Feb 2010 20:15:42 +0000 (20:15 +0000)]
Attempt to fix the MSVC9 failure with c-indext-test, where the CIndex DLL
and the c-index-test executable end up getting different copies of
stderr, causing non-deterministic ordering of output. Fixed by
flushing the file after printing a diagnostic (only on Windows).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96754 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement support for parsing pseudo-destructor expression with a nested-name-specifi...
Douglas Gregor [Sun, 21 Feb 2010 18:36:56 +0000 (18:36 +0000)]
Implement support for parsing pseudo-destructor expression with a nested-name-specifier, e.g.,

  typedef int Int;
  int *p;
  p->Int::~Int();

This weakens the invariant that the only types in nested-name-specifiers are tag types (restricted to class types in C++98/03). However, we weaken this invariant as little as possible, accepting arbitrary types in nested-name-specifiers only when we're in a member access expression that looks like a pseudo-destructor expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96743 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoA constructor template cannot be used to copy to an object of the same class type...
Douglas Gregor [Sun, 21 Feb 2010 18:30:38 +0000 (18:30 +0000)]
A constructor template cannot be used to copy to an object of the same class type (per C++ [class.copy]p3). Make sure that includes copies that involve a derived-to-base conversion. Fixes PR6141.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96742 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement AST import for C++ member functions, including constructors, destructors...
Douglas Gregor [Sun, 21 Feb 2010 18:29:16 +0000 (18:29 +0000)]
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

14 years agoImplement AST importing for C++ namespaces.
Douglas Gregor [Sun, 21 Feb 2010 18:26:36 +0000 (18:26 +0000)]
Implement AST importing for C++ namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96740 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCollect the code that imports all of the members of a declaration context into a...
Douglas Gregor [Sun, 21 Feb 2010 18:24:45 +0000 (18:24 +0000)]
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

14 years agoImplement PCH support for C++ namespaces.
Douglas Gregor [Sun, 21 Feb 2010 18:22:14 +0000 (18:22 +0000)]
Implement PCH support for C++ namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96738 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCommiting a revert from dgregor of a bit of destructor logic until we can
Chandler Carruth [Sun, 21 Feb 2010 10:19:54 +0000 (10:19 +0000)]
Commiting a revert from dgregor of a bit of destructor logic until we can
figure out how not to break lots of code using this. See PR6358 and PR6359 for
motivating examples. FIXME's left in the code and the test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96733 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake Decl::isOutOfLine() virtual, and use that to determine when definitions
Chandler Carruth [Sun, 21 Feb 2010 07:08:09 +0000 (07:08 +0000)]
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

14 years agoClang really intends to reject attribute 'warn_unused_result' on Objective-C methods...
Ted Kremenek [Sun, 21 Feb 2010 05:15:32 +0000 (05:15 +0000)]
Clang really intends to reject attribute 'warn_unused_result' on Objective-C methods, but
instead it crashes on them.  We might extend this attribute to work on methods, but for
now fix the crasher.  Addresses <rdar://problem/7670939>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96723 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't emit a warning about a dllimport attribute being used in a typedef
Ted Kremenek [Sun, 21 Feb 2010 05:12:56 +0000 (05:12 +0000)]
Don't emit a warning about a dllimport attribute being used in a typedef
when -fms-extensions is specified.  Fixes <rdar://problem/7653870>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96722 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't warn about functions redeclared without the dllimport attribute when
Ted Kremenek [Sun, 21 Feb 2010 05:12:53 +0000 (05:12 +0000)]
Don't warn about functions redeclared without the dllimport attribute when
-fms-extensions is enabled.  Fixes <rdar://problem/7669559>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96721 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStart supporting declaration of ivars in @implementation
Fariborz Jahanian [Fri, 19 Feb 2010 20:58:54 +0000 (20:58 +0000)]
Start supporting declaration of ivars in @implementation
blocks. WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96696 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd the CK_UnusedFunctionPointer component kind for unused function pointers.
Anders Carlsson [Fri, 19 Feb 2010 20:08:13 +0000 (20:08 +0000)]
Add the CK_UnusedFunctionPointer component kind for unused function pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96695 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIssue extended diagnostic when property dot-syntax is used and
Fariborz Jahanian [Fri, 19 Feb 2010 18:30:30 +0000 (18:30 +0000)]
Issue extended diagnostic when property dot-syntax is used and
there is a setter but no getter (part of radar 7664555).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96687 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify the CIndex fix-it API, now that we have half-open CXSourceRanges.
Douglas Gregor [Fri, 19 Feb 2010 18:16:06 +0000 (18:16 +0000)]
Simplify the CIndex fix-it API, now that we have half-open CXSourceRanges.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96685 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix link.
Ted Kremenek [Fri, 19 Feb 2010 18:12:09 +0000 (18:12 +0000)]
Fix link.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96684 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate front page to mention Xcode integration.
Ted Kremenek [Fri, 19 Feb 2010 17:33:38 +0000 (17:33 +0000)]
Update front page to mention Xcode integration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96682 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoExpose "Key features" paragraph.
Ted Kremenek [Fri, 19 Feb 2010 17:33:30 +0000 (17:33 +0000)]
Expose "Key features" paragraph.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96681 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOnly parse C++0x attribute specifiers in declarators when in C++0x
Douglas Gregor [Fri, 19 Feb 2010 16:47:56 +0000 (16:47 +0000)]
Only parse C++0x attribute specifiers in declarators when in C++0x
mode. This allows us to detect invalid VLAs in Objective-C++
mode. This should be the last of <rdar://problem/7660386>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96679 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement C++ name lookup for instance variables of Objective-C classes
Douglas Gregor [Fri, 19 Feb 2010 16:08:35 +0000 (16:08 +0000)]
Implement C++ name lookup for instance variables of Objective-C classes
from an instance method. Previously, we were following the Objective-C
name lookup rules for ivars, which are of course completely different
from and incompatible with the Objective-C++ rules.

For the record, the Objective-C++ rules are the sane ones.

This is another part of <rdar://problem/7660386>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96677 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake Sema::ActOnClassMessage robust when name lookup for the receiver
Douglas Gregor [Fri, 19 Feb 2010 15:18:45 +0000 (15:18 +0000)]
Make Sema::ActOnClassMessage robust when name lookup for the receiver
name finds something other than a TypedefDecl or an
ObjCInterfaceDecl. This is a small part of <rdar://problem/7660386>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96676 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore refactoring around constructor/destructor code generation.
John McCall [Fri, 19 Feb 2010 09:25:03 +0000 (09:25 +0000)]
More refactoring around constructor/destructor code generation.
Fix some bugs with function-try-blocks and simplify normal try-block
code generation.

This implementation excludes a deleting destructor's call to
operator delete() from the function-try-block, which I believe
is correct but which I can't find straightforward support for at
a moment's glance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96670 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoLabel examples.
Ted Kremenek [Fri, 19 Feb 2010 08:24:37 +0000 (08:24 +0000)]
Label examples.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96668 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix link.
Ted Kremenek [Fri, 19 Feb 2010 08:19:14 +0000 (08:19 +0000)]
Fix link.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96667 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify menu.
Ted Kremenek [Fri, 19 Feb 2010 08:18:02 +0000 (08:18 +0000)]
Simplify menu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96666 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTweak menu.
Ted Kremenek [Fri, 19 Feb 2010 08:16:18 +0000 (08:16 +0000)]
Tweak menu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96665 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd section on using the analyzer within Xcode.
Ted Kremenek [Fri, 19 Feb 2010 08:14:02 +0000 (08:14 +0000)]
Add section on using the analyzer within Xcode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96664 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDump this-adjustments for destructors as well.
Anders Carlsson [Fri, 19 Feb 2010 06:03:53 +0000 (06:03 +0000)]
Dump this-adjustments for destructors as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96660 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd another test from the ABI spec.
Anders Carlsson [Fri, 19 Feb 2010 05:59:40 +0000 (05:59 +0000)]
Add another test from the ABI spec.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96659 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd new intro about running scan-build.
Ted Kremenek [Fri, 19 Feb 2010 05:36:44 +0000 (05:36 +0000)]
Add new intro about running scan-build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96658 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnable -mconstructor-aliases by default on non-darwin platforms.
John McCall [Fri, 19 Feb 2010 02:45:38 +0000 (02:45 +0000)]
Enable -mconstructor-aliases by default on non-darwin platforms.
The linker bug holding this back is Darwin-specific.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96655 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert: "Change InitListExpr to allocate the array for holding references"
Ted Kremenek [Fri, 19 Feb 2010 01:50:18 +0000 (01:50 +0000)]
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

14 years agoRemove this test for now.
Fariborz Jahanian [Fri, 19 Feb 2010 01:40:48 +0000 (01:40 +0000)]
Remove this test for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96651 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a missing break. Cocoa.h can now be merged twice into the same AST context
Douglas Gregor [Fri, 19 Feb 2010 01:36:36 +0000 (01:36 +0000)]
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

14 years agoRe-introduce the ctor/dtor alias optimization, this time hidden behind a
John McCall [Fri, 19 Feb 2010 01:32:20 +0000 (01:32 +0000)]
Re-introduce the ctor/dtor alias optimization, this time hidden behind a
command-line option which defaults off.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96649 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAST import for CStyleCastExpr. With this, we can import Cocoa.h into an empty context
Douglas Gregor [Fri, 19 Feb 2010 01:32:14 +0000 (01:32 +0000)]
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

14 years agoAST import for sizeof and alignof expressions
Douglas Gregor [Fri, 19 Feb 2010 01:24:23 +0000 (01:24 +0000)]
AST import for sizeof and alignof expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96647 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAST import for DeclRefExprs
Douglas Gregor [Fri, 19 Feb 2010 01:17:02 +0000 (01:17 +0000)]
AST import for DeclRefExprs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96646 91177308-0d34-0410-b5e6-96231b3b80d8