]> granicus.if.org Git - clang/log
clang
14 years agoDivide list of registration functions in API and foundational checks. Also trim...
Ted Kremenek [Thu, 25 Feb 2010 00:20:25 +0000 (00:20 +0000)]
Divide list of registration functions in API and foundational checks.  Also trim whitespace.

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

14 years agoSort list of checker registration functions.
Ted Kremenek [Thu, 25 Feb 2010 00:20:22 +0000 (00:20 +0000)]
Sort list of checker registration functions.

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

14 years agoKeep track of the location of the '~' in a pseudo-destructor expression.
Douglas Gregor [Wed, 24 Feb 2010 23:50:37 +0000 (23:50 +0000)]
Keep track of the location of the '~' in a pseudo-destructor expression.

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

14 years agoRetain complete source information for the type after the '~' in a
Douglas Gregor [Wed, 24 Feb 2010 23:40:28 +0000 (23:40 +0000)]
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

14 years agoMake sure that we finish the DeclSpec when parsing a C++
Douglas Gregor [Wed, 24 Feb 2010 23:13:13 +0000 (23:13 +0000)]
Make sure that we finish the DeclSpec when parsing a C++
type-specifier-seq. Fixes some conditional-jump-on-unitialized-value
errors in valgrind. Also counts as attempt #2 at making the MSVC
buildbot happy.

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

14 years agoMake sure that we have type source information for the scope type of a
Douglas Gregor [Wed, 24 Feb 2010 23:02:30 +0000 (23:02 +0000)]
Make sure that we have type source information for the scope type of a
pseudo-destructor expression. Attempt #1 at fixing the MSVC buildbot.

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

14 years agoAdded test case for non-objective-c situation in
Fariborz Jahanian [Wed, 24 Feb 2010 22:53:58 +0000 (22:53 +0000)]
Added test case for non-objective-c situation in
my last patch.

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

14 years agoImplement nasty rewriting of nested blocks when inner
Fariborz Jahanian [Wed, 24 Feb 2010 22:48:18 +0000 (22:48 +0000)]
Implement nasty rewriting of nested blocks when inner
blocks use variables not used in any of the outer blocks.
(Fixes radar 7682149).

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

14 years agoSplit ActOnPseudoDestructorExpr into the part that interprets the
Douglas Gregor [Wed, 24 Feb 2010 22:38:50 +0000 (22:38 +0000)]
Split ActOnPseudoDestructorExpr into the part that interprets the
parser's data structures and the part that performs semantic analysis
and AST building, in preparation for improved template instantiation
of pseudo-destructor expressions.

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

14 years agoGet rid of 'this' adjustments from the FinalOverriders class since they can be differ...
Anders Carlsson [Wed, 24 Feb 2010 22:32:18 +0000 (22:32 +0000)]
Get rid of 'this' adjustments from the FinalOverriders class since they can be different for the same overrider in different parts of the vtable.

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

14 years agoImprove this adjustment pointer calculation.
Anders Carlsson [Wed, 24 Feb 2010 22:27:12 +0000 (22:27 +0000)]
Improve this adjustment pointer calculation.

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

14 years agoMake ComputeThisAdjustmentBaseOffset public for now.
Anders Carlsson [Wed, 24 Feb 2010 22:18:01 +0000 (22:18 +0000)]
Make ComputeThisAdjustmentBaseOffset public for now.

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

14 years agoAdd test case for PR6141, which was fixed a few days ago
Douglas Gregor [Wed, 24 Feb 2010 21:54:27 +0000 (21:54 +0000)]
Add test case for PR6141, which was fixed a few days ago

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

14 years agoAdd test for AST importing of C++ namespaces, missing from a prior commit
Douglas Gregor [Wed, 24 Feb 2010 21:53:36 +0000 (21:53 +0000)]
Add test for AST importing of C++ namespaces, missing from a prior commit

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

14 years agoAdd PCH test for C++ namespaces, missing from a previous commit
Douglas Gregor [Wed, 24 Feb 2010 21:52:55 +0000 (21:52 +0000)]
Add PCH test for C++ namespaces, missing from a previous commit

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

14 years agoRetain source information for the "type-name ::" in a
Douglas Gregor [Wed, 24 Feb 2010 21:52:20 +0000 (21:52 +0000)]
Retain source information for the "type-name ::" in a
pseudo-destructor expression such as

  p->T::~T()

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

14 years agoActOnPseudoDestructorExpr now performs all semantic analysis for
Douglas Gregor [Wed, 24 Feb 2010 21:29:12 +0000 (21:29 +0000)]
ActOnPseudoDestructorExpr now performs all semantic analysis for
pseudo-destructor expressions, and builds the CXXPseudoDestructorExpr
node directly. Currently, this only affects pseudo-destructor
expressions when they are parsed, but not after template
instantiation. That's coming next...

Improve parsing of pseudo-destructor-names. When parsing the
nested-name-specifier and we hit the sequence of tokens X :: ~, query
the actual module to determine whether X is a type-name (in which case
the X :: is part of the pseudo-destructor-name but not the
nested-name-specifier) or not (in which case the X :: is part of the
nested-name-specifier).

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

14 years agoFix an iterator-invalidation bug that was causing selfhost errors
John McCall [Wed, 24 Feb 2010 20:32:01 +0000 (20:32 +0000)]
Fix an iterator-invalidation bug that was causing selfhost errors
on non-darwin platforms.  Fixes PR6411. Test case doesn't reduce,
unfortunately.

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

14 years agoRework parsing of pseudo-destructor expressions and explicit
Douglas Gregor [Wed, 24 Feb 2010 18:44:31 +0000 (18:44 +0000)]
Rework parsing of pseudo-destructor expressions and explicit
destructor calls, e.g.,

  p->T::~T

We now detect when the member access that we've parsed, e.g.,

  p-> or x.

may be a pseudo-destructor expression, either because the type of p or
x is a scalar or because it is dependent (and, therefore, may become a
scalar at template instantiation time).

We then parse the pseudo-destructor grammar specifically:

  ::[opt] nested-name-specifier[opt] type-name :: ∼ type-name

and hand those results to a new action, ActOnPseudoDestructorExpr,
which will cope with both dependent member accesses of destructors and
with pseudo-destructor expressions.

This commit affects the parsing of pseudo-destructors, only; the
semantic actions still go through the semantic actions for member
access expressions. That will change soon.

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

14 years agoGenerate correct vcall offsets when we have a primary virtual base that is not a...
Anders Carlsson [Wed, 24 Feb 2010 16:43:12 +0000 (16:43 +0000)]
Generate correct vcall offsets when we have a primary virtual base that is not a primary base in the complete class hierarchy.

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

14 years agoReferences to const int parameters with ICE default arguments are not ICEs.
John McCall [Wed, 24 Feb 2010 09:03:18 +0000 (09:03 +0000)]
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

14 years agoMake this test portable to ABIs that use sret.
John McCall [Wed, 24 Feb 2010 08:14:27 +0000 (08:14 +0000)]
Make this test portable to ABIs that use sret.

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

14 years agoFix test case and convert fully to FileCheck.
John McCall [Wed, 24 Feb 2010 07:33:39 +0000 (07:33 +0000)]
Fix test case and convert fully to FileCheck.

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

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