]> granicus.if.org Git - clang/log
clang
14 years agoMove ~CodeGenAction out-of-line.
Daniel Dunbar [Thu, 25 Feb 2010 20:37:44 +0000 (20:37 +0000)]
Move ~CodeGenAction out-of-line.

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

14 years agoRestore Zhongxing's commits r97122 r97127 r97129 r97131 which were reverted due to...
Douglas Gregor [Thu, 25 Feb 2010 19:01:53 +0000 (19:01 +0000)]
Restore Zhongxing's commits r97122 r97127 r97129 r97131 which were reverted due to a Clang-on-Clang failure

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

14 years agoAllow us to compare derived-to-base conversions between a reference
Douglas Gregor [Thu, 25 Feb 2010 19:01:05 +0000 (19:01 +0000)]
Allow us to compare derived-to-base conversions between a reference
binding and a copy-construction. Fixes an overloading problem in the
Clang-on-Clang build.

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

14 years agoForgot to include nested protocols in collection, resulting in
Fariborz Jahanian [Thu, 25 Feb 2010 18:24:33 +0000 (18:24 +0000)]
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

14 years agoDon't try to finalize an ill-formed variable or one whose class type is ill-formed...
Douglas Gregor [Thu, 25 Feb 2010 18:11:54 +0000 (18:11 +0000)]
Don't try to finalize an ill-formed variable or one whose class type is ill-formed. Fixes PR6421

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

14 years agoRevert patches r97122 r97127 r97129 r97131.
Jakob Stoklund Olesen [Thu, 25 Feb 2010 15:47:53 +0000 (15:47 +0000)]
Revert patches r97122 r97127 r97129 r97131.
They were breaking clang-x86_64-darwin10-selfhost

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

14 years agoAdd "template" keyword at strategic position to fix
Gabor Greif [Thu, 25 Feb 2010 13:04:33 +0000 (13:04 +0000)]
Add "template" keyword at strategic position to fix
compilation using g++ v3.4.

I'll watch the buildbots and back out if necessary.
Feel free to do the same if something breaks.

Without this patch I get (on g++ 3.4.6) following error:

In file included from clang/lib/Sema/SemaTemplate.cpp:14:
clang/lib/Sema/TreeTransform.h: In member function `clang::ASTOwningResult<&clang::ActionBase::DeleteExpr> clang::TreeTransform<Derived>::RebuildCXXPseudoDestructorExpr(clang::ASTOwningResult<&clang::ActionBase::DeleteExpr>, clang::SourceLocation, bool, clang::NestedNameSpecifier*, clang::SourceRange, clang::TypeSourceInfo*, clang::SourceLocation, clang::SourceLocation, clang::PseudoDestructorTypeStorage)':
clang/lib/Sema/TreeTransform.h:5784: error: expected primary-expression before '>' token
clang/lib/Sema/TreeTransform.h:5784: error: expected primary-expression before ')' token
make[4]: *** [clang/lib/Sema/Release/SemaTemplate.o] Error 1

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

14 years agoWhen comparing two method overload candidates during overload diagnostics,
John McCall [Thu, 25 Feb 2010 10:46:05 +0000 (10:46 +0000)]
When comparing two method overload candidates during overload diagnostics,
skip the object argument conversion if either of the candidates didn't
initialize it.

Fixes PR6421, which is such a very straightforward extension of PR6398 that I
should have worked it into the last test case (and therefore caught it then).
Ah well.

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

14 years agoFix a really trivial crasher and begin fleshing out one of the namespace test
Chandler Carruth [Thu, 25 Feb 2010 09:32:59 +0000 (09:32 +0000)]
Fix a really trivial crasher and begin fleshing out one of the namespace test
cases.

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

14 years agoAdd a minimal C interpreter example.
Daniel Dunbar [Thu, 25 Feb 2010 08:49:05 +0000 (08:49 +0000)]
Add a minimal C interpreter example.
 - Demonstrates how to build a standalone tool which loads source code using the
   Driver and Frontend libraries, and then uses CodeGen and the JIT to actually
   execute the code.

 - Still more complicated than it should be, but hey its only 153 lines. :)

--
ddunbar@ozzy:tmp$ cat hello.c
#include <stdio.h>
int main() { printf("hello world\n"); return 0; }
ddunbar@ozzy:tmp$ clang-interpreter hello.c
hello world
--

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

14 years agoMove the GenerateCallExitNode logic completely into GREndPathNodeBuilder.
Zhongxing Xu [Thu, 25 Feb 2010 07:57:35 +0000 (07:57 +0000)]
Move the GenerateCallExitNode logic completely into GREndPathNodeBuilder.

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

14 years agoMove the dead bindings removal logic from CallInliner to GRExprEngine::ProcessCallExit().
Zhongxing Xu [Thu, 25 Feb 2010 07:36:34 +0000 (07:36 +0000)]
Move the dead bindings removal logic from CallInliner to GRExprEngine::ProcessCallExit().

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

14 years agoAdd a new conversion rank to classify conversions between complex and scalar
Chandler Carruth [Thu, 25 Feb 2010 07:20:54 +0000 (07:20 +0000)]
Add a new conversion rank to classify conversions between complex and scalar
types. Rank these conversions below other conversions. This allows overload
resolution when the only distinction is between a complex and scalar type. It
also brings the complex overload resolutin in line with GCC's.

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

14 years agoAdd comments.
Zhongxing Xu [Thu, 25 Feb 2010 07:03:08 +0000 (07:03 +0000)]
Add comments.

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

14 years agoCall inliner improvements:
Zhongxing Xu [Thu, 25 Feb 2010 06:46:30 +0000 (06:46 +0000)]
Call inliner improvements:

This patch implements the CallEnter/CallExit idea of Ted.

Add two interfaces to GRSubEngine: ProcessCallEnter, ProcessCallExit.

The CallEnter program point uses caller's location context. The
CallExit program point uses callee's location context.

CallEnter is built by GRStmtNodeBuilder. CallExit is built by
GREndPathNodeBuilder.

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

14 years agoAdd MacOSXAPIChecker, a meta checker to include various precondition checks for calls
Ted Kremenek [Thu, 25 Feb 2010 05:44:09 +0000 (05:44 +0000)]
Add MacOSXAPIChecker, a meta checker to include various precondition checks for calls
to various MacOS X functions.  The checks in BasicObjCFoundationChecks.cpp will
gradually be migrated here.

As a first check, check that when 'dispatch_once()' is passed a predicate value
that has non-local storage.

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

14 years agoWhen generating error node, check to see if we already cached out.
Ted Kremenek [Thu, 25 Feb 2010 05:44:05 +0000 (05:44 +0000)]
When generating error node, check to see if we already cached out.

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

14 years agoTargets (like pic16) may have mangled the name of global variables,
Sanjiv Gupta [Thu, 25 Feb 2010 05:20:44 +0000 (05:20 +0000)]
Targets (like pic16) may have mangled the name of global variables,
so get the name from Var rather than the original decl.

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

14 years agoUpdate CMake makefiles
Douglas Gregor [Thu, 25 Feb 2010 04:52:01 +0000 (04:52 +0000)]
Update CMake makefiles

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

14 years agoRestore the invariant that a nested-name-specifier can only contain
Douglas Gregor [Thu, 25 Feb 2010 04:46:04 +0000 (04:46 +0000)]
Restore the invariant that a nested-name-specifier can only contain
class types, dependent types, and namespaces. I had previously
weakened this invariant while working on parsing pseudo-destructor
expressions, but recent work in that area has made these changes
unnecessary.

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

14 years agoFrontend: Add CodeGenAction::takeModule().
Daniel Dunbar [Thu, 25 Feb 2010 04:37:50 +0000 (04:37 +0000)]
Frontend: Add CodeGenAction::takeModule().

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

14 years agoFrontend: Pull CodeGenAction out more, and eliminate CreateBackendConsumer.
Daniel Dunbar [Thu, 25 Feb 2010 04:37:45 +0000 (04:37 +0000)]
Frontend: Pull CodeGenAction out more, and eliminate CreateBackendConsumer.

This is the way I would like to move the frontend function towards -- distinct
pieces of functionality should be exposed only via FrontendAction
implementations which have clean and relatively-stable APIs.

This also isolates the surface area in clang which depends on LLVM CodeGen.

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

14 years agoRemove dead code.
Anders Carlsson [Thu, 25 Feb 2010 03:57:50 +0000 (03:57 +0000)]
Remove dead code.

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

14 years agoMove the vcall and vbase offset layout code out into its own class.
Anders Carlsson [Thu, 25 Feb 2010 03:45:56 +0000 (03:45 +0000)]
Move the vcall and vbase offset layout code out into its own class.

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

14 years agoDriver: Allow driver title (for --help) to be overridden by clients.
Daniel Dunbar [Thu, 25 Feb 2010 03:31:53 +0000 (03:31 +0000)]
Driver: Allow driver title (for --help) to be overridden by clients.

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

14 years agoEnhance the unused ivar checker to not consider an ivar to be accidentally unused
Ted Kremenek [Thu, 25 Feb 2010 03:26:55 +0000 (03:26 +0000)]
Enhance the unused ivar checker to not consider an ivar to be accidentally unused
when it is explicitly marked as unused via __attribute__((unused)).

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

14 years agoAllow __attribute__((unused)) to be applied to ObjC ivars.
Ted Kremenek [Thu, 25 Feb 2010 03:26:51 +0000 (03:26 +0000)]
Allow __attribute__((unused)) to be applied to ObjC ivars.

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

14 years agoDriver: Use TextDiagnosticPrinter instead of a custom one.
Daniel Dunbar [Thu, 25 Feb 2010 03:23:43 +0000 (03:23 +0000)]
Driver: Use TextDiagnosticPrinter instead of a custom one.

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

14 years agoAdd TextDiagnosticPrinter::setPrefix, for adding a string to prefix diagnostic
Daniel Dunbar [Thu, 25 Feb 2010 03:23:40 +0000 (03:23 +0000)]
Add TextDiagnosticPrinter::setPrefix, for adding a string to prefix diagnostic
messages with.

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

14 years agoRemove some oogly code made dead by the pseudo-destructor
Douglas Gregor [Thu, 25 Feb 2010 02:00:27 +0000 (02:00 +0000)]
Remove some oogly code made dead by the pseudo-destructor
instantiation changes.

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

14 years agoUse CXXPseudoDestructorExpr as the stored representation for dependent
Douglas Gregor [Thu, 25 Feb 2010 01:56:36 +0000 (01:56 +0000)]
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

14 years agoCatch more uses of uninitialized implicit conversion sequences.
John McCall [Thu, 25 Feb 2010 01:37:24 +0000 (01:37 +0000)]
Catch more uses of uninitialized implicit conversion sequences.
When diagnosing bad conversions, skip the conversion for ignored object
arguments.  Fixes PR 6398.

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

14 years agoRemove test case dependancy on platform headers.
Ted Kremenek [Thu, 25 Feb 2010 01:16:07 +0000 (01:16 +0000)]
Remove test case dependancy on platform headers.

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

14 years agoAdd UnixAPIChecker, a meta checker to include various precondition checks for calls
Ted Kremenek [Thu, 25 Feb 2010 00:20:35 +0000 (00:20 +0000)]
Add UnixAPIChecker, a meta checker to include various precondition checks for calls
to various unix/posix functions, e.g. 'open()'.

As a first check, check that when 'open()' is passed 'O_CREAT' that it has
a third argument.

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

14 years agoRemove stray #include.
Ted Kremenek [Thu, 25 Feb 2010 00:20:31 +0000 (00:20 +0000)]
Remove stray #include.

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

14 years agoRemove #include.
Ted Kremenek [Thu, 25 Feb 2010 00:20:28 +0000 (00:20 +0000)]
Remove #include.

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

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