]> granicus.if.org Git - clang/log
clang
14 years agoTeach the diagnostic engine to provide more detailed information about
Douglas Gregor [Thu, 25 Mar 2010 22:17:48 +0000 (22:17 +0000)]
Teach the diagnostic engine to provide more detailed information about
how to handle a diagnostic during template argument deduction, which
may be "substitution failure", "suppress", or "report". This keeps us
from, e.g., emitting warnings while performing template argument
deduction.

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

14 years agoWhen finishing a function definition, leave the function definition *after*
John McCall [Thu, 25 Mar 2010 22:08:03 +0000 (22:08 +0000)]
When finishing a function definition, leave the function definition *after*
doing all the cleanup tasks and checks.  This gives us the proper context for
checking access to base and member destructors.

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

14 years agoFix a code gen. bug involving generation of getter method
Fariborz Jahanian [Thu, 25 Mar 2010 21:56:43 +0000 (21:56 +0000)]
Fix a code gen. bug involving generation of getter method
from properties of _Complex type. (radar 7351147).

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

14 years agoDon't add address points for virtual primary bases that aren't primary bases in the...
Anders Carlsson [Thu, 25 Mar 2010 21:45:14 +0000 (21:45 +0000)]
Don't add address points for virtual primary bases that aren't primary bases in the complete class.

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

14 years agoFix a very minor oversight in privileges-elevation: we were only considering
John McCall [Thu, 25 Mar 2010 21:39:55 +0000 (21:39 +0000)]
Fix a very minor oversight in privileges-elevation:  we were only considering
friendship for a derived class if the base class specifier was non-public,
and thus not considering friendship for non-public members of public bases.

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

14 years agoHandle simple friend-class decls in class templates better by ensuring that
John McCall [Thu, 25 Mar 2010 21:28:06 +0000 (21:28 +0000)]
Handle simple friend-class decls in class templates better by ensuring that
we look for shadow friend decls in the appropriate scope before injecting
a new declaration.

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

14 years agoCheck for some code gen. for PR6641 test.
Fariborz Jahanian [Thu, 25 Mar 2010 18:05:35 +0000 (18:05 +0000)]
Check for some code gen. for PR6641 test.

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

14 years agoPreserve type-source information in friend declarations.
John McCall [Thu, 25 Mar 2010 18:04:51 +0000 (18:04 +0000)]
Preserve type-source information in friend declarations.

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

14 years agoRemove support for nand atomic builtins. They are inconsistently implemented in
Daniel Dunbar [Thu, 25 Mar 2010 17:13:09 +0000 (17:13 +0000)]
Remove support for nand atomic builtins. They are inconsistently implemented in
gcc, and the common expectation seems to be that they are unused. If and when
someone cares we can add them back with well documented demantics.

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

14 years agoUse the new vtable layout code for construction vtables.
Anders Carlsson [Thu, 25 Mar 2010 16:49:53 +0000 (16:49 +0000)]
Use the new vtable layout code for construction vtables.

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

14 years agoUse Daniel's trick for XFAIL'd tests
Douglas Gregor [Thu, 25 Mar 2010 16:40:13 +0000 (16:40 +0000)]
Use Daniel's trick for XFAIL'd tests

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

14 years agoPS3 needs __PPC__. Should this be in the PPC target?
John Thompson [Thu, 25 Mar 2010 16:18:32 +0000 (16:18 +0000)]
PS3 needs __PPC__.  Should this be in the PPC target?

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

14 years agoAdd another test for weird substitutions into function types during template argument...
Douglas Gregor [Thu, 25 Mar 2010 15:42:11 +0000 (15:42 +0000)]
Add another test for weird substitutions into function types during template argument deduction

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

14 years agoImprove our handling of local instantiation scopes in two related ways:
Douglas Gregor [Thu, 25 Mar 2010 15:38:42 +0000 (15:38 +0000)]
Improve our handling of local instantiation scopes in two related ways:

  - When substituting template arguments as part of template argument
    deduction, introduce a new local instantiation scope.
  - When substituting into a function prototype type, introduce a new
    "temporary" local instantiation scope that merges with its outer
    scope but also keeps track of any additions it makes, removing
    them when we exit that scope.

Fixes PR6700, where we were getting too much mixing of local
instantiation scopes due to template argument deduction that
substituted results into function types.

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

14 years agoWhen -fdump-vtable-layouts is specified, construction vtable initializers will be...
Anders Carlsson [Thu, 25 Mar 2010 15:26:28 +0000 (15:26 +0000)]
When -fdump-vtable-layouts is specified, construction vtable initializers will be generated using the new vtable layout code. (The code is still not completely in place but this is a huge step forward).

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

14 years agoadd dump() method to CanQual for debugging purposes
Nuno Lopes [Thu, 25 Mar 2010 13:19:42 +0000 (13:19 +0000)]
add dump() method to CanQual for debugging purposes

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

14 years agoProperly instantiate friend class template declarations and link them into
John McCall [Thu, 25 Mar 2010 06:39:04 +0000 (06:39 +0000)]
Properly instantiate friend class template declarations and link them into
the redeclaration chain.  Recommitted from r99477 with a fix:  we need to
merge in default template arguments from previous declarations.

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

14 years agoAdd a utility method.
Zhongxing Xu [Thu, 25 Mar 2010 06:33:37 +0000 (06:33 +0000)]
Add a utility method.

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

14 years agoRevert 99477 since it appears to be breaking the clang-x86_64-darwin10-fnt
Bob Wilson [Thu, 25 Mar 2010 04:40:43 +0000 (04:40 +0000)]
Revert 99477 since it appears to be breaking the clang-x86_64-darwin10-fnt
buildbot.  The tramp3d test fails.
--- Reverse-merging r99477 into '.':
U    test/SemaTemplate/friend-template.cpp
U    test/CXX/temp/temp.decls/temp.friend/p1.cpp
U    lib/Sema/SemaTemplateInstantiateDecl.cpp
U    lib/Sema/SemaAccess.cpp

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

14 years agoFix two bugs in format-string checking:
Ted Kremenek [Thu, 25 Mar 2010 03:59:12 +0000 (03:59 +0000)]
Fix two bugs in format-string checking:
(1) Do not assume the data arguments start after the format string
(2) Do not use the fact that a function is variadic to treat it like a va_list printf function

Fixes PR 6697.

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

14 years agoFix '+=' accumulation error when parsing numeric amounts in a format string.
Ted Kremenek [Thu, 25 Mar 2010 03:59:09 +0000 (03:59 +0000)]
Fix '+=' accumulation error when parsing numeric amounts in a format string.

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

14 years agoProperly instantiate and link in friend-class-template declarations.
John McCall [Thu, 25 Mar 2010 02:56:08 +0000 (02:56 +0000)]
Properly instantiate and link in friend-class-template declarations.

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

14 years agoAdd c-index-test support for printing USRs.
Ted Kremenek [Thu, 25 Mar 2010 02:00:39 +0000 (02:00 +0000)]
Add c-index-test support for printing USRs.

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

14 years agoRequire that all Clang-based USRs start with the prefix 'c:' for the "USR space".
Ted Kremenek [Thu, 25 Mar 2010 02:00:36 +0000 (02:00 +0000)]
Require that all Clang-based USRs start with the prefix 'c:' for the "USR space".

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

14 years agoAdd methods to remove a GDM entry.
Zhongxing Xu [Thu, 25 Mar 2010 01:39:39 +0000 (01:39 +0000)]
Add methods to remove a GDM entry.
Instead of setting the ReturnExpr GDM to NULL, remove it.

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

14 years agoMore address point map shuffling.
Anders Carlsson [Thu, 25 Mar 2010 00:51:13 +0000 (00:51 +0000)]
More address point map shuffling.

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

14 years agoShuffle some code around; this will make it easier to use the new layout code for...
Anders Carlsson [Thu, 25 Mar 2010 00:35:49 +0000 (00:35 +0000)]
Shuffle some code around; this will make it easier to use the new layout code for address points.

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

14 years agoKill off two more uses of Sema::CheckReferenceInit in favor of the new
Douglas Gregor [Thu, 25 Mar 2010 00:20:38 +0000 (00:20 +0000)]
Kill off two more uses of Sema::CheckReferenceInit in favor of the new
initialization code. Exposed a bug where we were not marking an
implicit conversion as an lvalue when we were forming a call to a
conversion function whose return type is a reference.

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

14 years agoSwitch static_cast from the old reference-initialization code (via
Douglas Gregor [Wed, 24 Mar 2010 23:38:29 +0000 (23:38 +0000)]
Switch static_cast from the old reference-initialization code (via
CheckReferenceInit) over to the new initialization code
(InitializationSequence), which is better-tested and doesn't require
us to compute the entire conversion sequence twice.

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

14 years agoCheck for ret, so that we know we hit the end of the function
Douglas Gregor [Wed, 24 Mar 2010 23:19:27 +0000 (23:19 +0000)]
Check for ret, so that we know we hit the end of the function

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

14 years agoWhen returning from a function that has a reference return type, use
Douglas Gregor [Wed, 24 Mar 2010 23:14:04 +0000 (23:14 +0000)]
When returning from a function that has a reference return type, use
EmitReferenceBindingToExpr() rather than assuming we have an
lvalue. This is just the lowest hanging fruit for PR6024, which still
requires a bit of work.

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

14 years agoDiscussing with dgregor we decided that we should not force the emission of
Rafael Espindola [Wed, 24 Mar 2010 22:43:31 +0000 (22:43 +0000)]
Discussing with dgregor we decided that we should not force the emission of
implicit methods on explicit template instantiation definitions. As a
consequence, we should emit them at every use, even if we see a explicit
template instantiation declaration.

This is already the current behaviour, but it is good to test for that :-)

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

14 years agoUse llvm::SmallString instead of std::string.
Ted Kremenek [Wed, 24 Mar 2010 22:39:47 +0000 (22:39 +0000)]
Use llvm::SmallString instead of std::string.

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

14 years agoImprove static analyzer diagnostic concerning the use of 'mktemp'
Ted Kremenek [Wed, 24 Mar 2010 22:39:45 +0000 (22:39 +0000)]
Improve static analyzer diagnostic concerning the use of 'mktemp'

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

14 years agomake the vtable tester a little friendlier, with a clean target and without requiring...
Douglas Gregor [Wed, 24 Mar 2010 21:52:55 +0000 (21:52 +0000)]
make the vtable tester a little friendlier, with a clean target and without requiring . to be in your path

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

14 years agoWhen pulling apart an initializer that involves a CXXConstructExpr, do
Douglas Gregor [Wed, 24 Mar 2010 21:22:47 +0000 (21:22 +0000)]
When pulling apart an initializer that involves a CXXConstructExpr, do
not pick apart a CXXTemporaryObjectExpr because such an object
construction was explicitly written in the source code. Fixes PR6657.

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

14 years agoMake sure that we have File IDs for all of the unsaved files before we
Douglas Gregor [Wed, 24 Mar 2010 21:04:06 +0000 (21:04 +0000)]
Make sure that we have File IDs for all of the unsaved files before we
deserialize diagnostics.

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

14 years agoAllow conversion of qualified Class type to unqualified
Fariborz Jahanian [Wed, 24 Mar 2010 21:00:27 +0000 (21:00 +0000)]
Allow conversion of qualified Class type to unqualified
Class type to match gcc's. Fixes radar 7789113.

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

14 years agoXFAIL the -nostdinc++ test on Windows; it doesn't look like we even have the notion...
Douglas Gregor [Wed, 24 Mar 2010 20:45:20 +0000 (20:45 +0000)]
XFAIL the -nostdinc++ test on Windows; it doesn't look like we even have the notion of separate C and C++ paths there

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

14 years agoControl warnings about GNU extensions with -Wgnu, which has a subgroup
Douglas Gregor [Wed, 24 Mar 2010 20:42:51 +0000 (20:42 +0000)]
Control warnings about GNU extensions with -Wgnu, which has a subgroup
for GNU designated-initializer syntax (-Wgnu-designator).

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

14 years agoImplement support for -nostdc++. Fixes PR6446.
Douglas Gregor [Wed, 24 Mar 2010 20:13:48 +0000 (20:13 +0000)]
Implement support for -nostdc++. Fixes PR6446.

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

14 years agoImprove diagnostics when ivar added to class
Fariborz Jahanian [Wed, 24 Mar 2010 18:08:23 +0000 (18:08 +0000)]
Improve diagnostics when ivar added to class
extension (radar 6812436).

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

14 years agoSilently drop dependent friend function template specializations,
Douglas Gregor [Wed, 24 Mar 2010 17:31:23 +0000 (17:31 +0000)]
Silently drop dependent friend function template specializations,
since we have absolutely no way to match them when they are declared
nor do we have a way to represent these parsed-but-not-checked friend
declarations.

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

14 years agoChange two class forward declarations to struct forward declarations, silencing a...
Douglas Gregor [Wed, 24 Mar 2010 16:59:08 +0000 (16:59 +0000)]
Change two class forward declarations to struct forward declarations, silencing a Clang warning

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

14 years agoCode gen for multi-dimensional dynamic allocations.
Fariborz Jahanian [Wed, 24 Mar 2010 16:57:01 +0000 (16:57 +0000)]
Code gen for multi-dimensional dynamic allocations.
Fixes PR6641.

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

14 years agoMore vtable improvements. We now compute and keep track of all vtable related informa...
Anders Carlsson [Wed, 24 Mar 2010 16:42:11 +0000 (16:42 +0000)]
More vtable improvements. We now compute and keep track of all vtable related information which avoids computing the same vtable layout over and over.

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

14 years agoWalk out of enums when determining effective context.
John McCall [Wed, 24 Mar 2010 09:04:37 +0000 (09:04 +0000)]
Walk out of enums when determining effective context.

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

14 years agoCorrect that last fixit: if the user wrote
John McCall [Wed, 24 Mar 2010 08:27:58 +0000 (08:27 +0000)]
Correct that last fixit:  if the user wrote
  template <> friend void foo(int);
we need to change it to
  friend void foo<>(int);
or else the user won't get the template specialization they obviously want.

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

14 years agoSupport friend function specializations.
John McCall [Wed, 24 Mar 2010 07:46:06 +0000 (07:46 +0000)]
Support friend function specializations.

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

14 years agoWhen a declaration of a function is missing an exception specification
Douglas Gregor [Wed, 24 Mar 2010 07:14:45 +0000 (07:14 +0000)]
When a declaration of a function is missing an exception specification
that was present in a prior declaration, emit a warning rather than a
hard error (which we did before, and still do with mismatched
exception specifications). Moreover, provide a fix-it hint with the
throw() clause that should be added, e.g.,

t.C:10:7: warning: 'operator new' is missing exception specification
      'throw(std::bad_alloc)'
void *operator new(unsigned long sz)
      ^
                                     throw(std::bad_alloc)

As part of this, disable the warning when we're missing an exception
specification on operator new, operator new[], operator delete, or
operator delete[] when exceptions are turned off (-fno-exceptions).

Fixes PR5957.

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

14 years agoUse getNamedGlobal instead of getGlobalVariable. (Fixes self-host).
Anders Carlsson [Wed, 24 Mar 2010 05:32:05 +0000 (05:32 +0000)]
Use getNamedGlobal instead of getGlobalVariable. (Fixes self-host).

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

14 years agoMake the license header in smmintrin.h match the other SSE headers.
Anders Carlsson [Wed, 24 Mar 2010 05:31:31 +0000 (05:31 +0000)]
Make the license header in smmintrin.h match the other SSE headers.

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

14 years agoImplement a framework for the delay of arbitrary diagnostics within
John McCall [Wed, 24 Mar 2010 05:22:00 +0000 (05:22 +0000)]
Implement a framework for the delay of arbitrary diagnostics within
templates.  So delay access-control diagnostics when (for example) the target
of a friend declaration is a specific specialization of a template.

I was surprised to find that this was required for an access-controlled selfhost.

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

14 years agoWhen performing name lookup for the allocation or deallocation
Douglas Gregor [Wed, 24 Mar 2010 05:07:21 +0000 (05:07 +0000)]
When performing name lookup for the allocation or deallocation
operators, make sure that the implicitly-declared global new and
delete operators are always available. Fixes PR5904.

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

14 years agoMore vtable work; preparations for moving over to the new vtable layout code (finally).
Anders Carlsson [Wed, 24 Mar 2010 03:57:14 +0000 (03:57 +0000)]
More vtable work; preparations for moving over to the new vtable layout code (finally).

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

14 years agoEach non-local class instantiation is its own local instantiation
Douglas Gregor [Wed, 24 Mar 2010 01:33:17 +0000 (01:33 +0000)]
Each non-local class instantiation is its own local instantiation
scope. Fixes PR6619.

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

14 years agoRemove old thunks code.
Anders Carlsson [Wed, 24 Mar 2010 00:57:54 +0000 (00:57 +0000)]
Remove old thunks code.

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

14 years agoMake sure to properly track the anonymous namespace that lives inside
Douglas Gregor [Wed, 24 Mar 2010 00:46:35 +0000 (00:46 +0000)]
Make sure to properly track the anonymous namespace that lives inside
each namespace, even when the outer namespace has multiple
definitions. As part of this, collapsed two pointers worth of storage
(original namespace and inner anonymous namespace) into a single
pointer with a distinguishing bit, since the two are mutually
exclusive, saving a pointer per NamespaceDecl. Fixes PR6620.

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

14 years agoFlip the switch and use the new vtable layout code for thunks by default. Add a thunk...
Anders Carlsson [Wed, 24 Mar 2010 00:41:37 +0000 (00:41 +0000)]
Flip the switch and use the new vtable layout code for thunks by default. Add a thunks.cpp test.

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

14 years agoAdd CodeGenFunction::GenerateThunk and implement it.
Anders Carlsson [Wed, 24 Mar 2010 00:39:18 +0000 (00:39 +0000)]
Add CodeGenFunction::GenerateThunk and implement it.

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

14 years agoMinor cleanup.
Anders Carlsson [Wed, 24 Mar 2010 00:35:44 +0000 (00:35 +0000)]
Minor cleanup.

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

14 years agoRemove parts of virt.cpp
Anders Carlsson [Wed, 24 Mar 2010 00:32:03 +0000 (00:32 +0000)]
Remove parts of virt.cpp

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

14 years agoImplement computation of the final overriders for each virtual
Douglas Gregor [Tue, 23 Mar 2010 23:47:56 +0000 (23:47 +0000)]
Implement computation of the final overriders for each virtual
function within a class hierarchy (C++ [class.virtual]p2).

We use the final-overrider computation to determine when a particular
class is ill-formed because it has multiple final overriders for a
given virtual function (e.g., because two virtual functions override
the same virtual function in the same virtual base class). Fixes
PR5973.

We also use the final-overrider computation to determine which virtual
member functions are pure when determining whether a class is
abstract or diagnosing the improper use of an abstract class. The
prior approach to determining whether there were any pure virtual
functions in a class didn't cope with virtual base class subobjects
properly, and could not easily be fixed to deal with the oddities of
subobject hiding. Fixes PR6631.

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

14 years agoAdd some missing files to xcode project
Fariborz Jahanian [Tue, 23 Mar 2010 20:23:06 +0000 (20:23 +0000)]
Add some missing files to xcode project

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

14 years agorevert 99311. Looks like it broke darwin bootstrap.
Rafael Espindola [Tue, 23 Mar 2010 19:55:22 +0000 (19:55 +0000)]
revert 99311. Looks like it broke darwin bootstrap.

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

14 years agoImprove diagnostic for @property/ivar type mismatch by including the types of the
Ted Kremenek [Tue, 23 Mar 2010 19:02:22 +0000 (19:02 +0000)]
Improve diagnostic for @property/ivar type mismatch by including the types of the
ivar and @property respectively.

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

14 years agoAvoid producing implicit methods when we have a explicit template instantiation
Rafael Espindola [Tue, 23 Mar 2010 18:56:16 +0000 (18:56 +0000)]
Avoid producing implicit methods when we have a explicit template instantiation
declaration.

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

14 years agoCode gen for compound assignment of complex
Fariborz Jahanian [Tue, 23 Mar 2010 18:43:00 +0000 (18:43 +0000)]
Code gen for compound assignment of complex
types using property syntax to access setter/getters.
(also radar 7351147).

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

14 years agoMore work on thunks - don't assert if there's a variable with the same name as the...
Anders Carlsson [Tue, 23 Mar 2010 18:18:41 +0000 (18:18 +0000)]
More work on thunks - don't assert if there's a variable with the same name as the thunk already.

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

14 years agoPatch to implement code gen. use of compound assignent on
Fariborz Jahanian [Tue, 23 Mar 2010 18:08:50 +0000 (18:08 +0000)]
Patch to implement code gen. use of compound assignent on
properties of complex type. Radar 7351147.

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

14 years agoMore thunks scaffolding.
Anders Carlsson [Tue, 23 Mar 2010 17:17:29 +0000 (17:17 +0000)]
More thunks scaffolding.

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

14 years agoMore work on thunks.
Anders Carlsson [Tue, 23 Mar 2010 16:36:50 +0000 (16:36 +0000)]
More work on thunks.

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

14 years agoWhen recovering from a qualified typedef name, don't clear out the
Douglas Gregor [Tue, 23 Mar 2010 15:26:55 +0000 (15:26 +0000)]
When recovering from a qualified typedef name, don't clear out the
DeclContext because we don't want a NULL DeclContext. Instead, use the
current context.

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

14 years agoMove ThunkInfo as well.
Anders Carlsson [Tue, 23 Mar 2010 15:17:13 +0000 (15:17 +0000)]
Move ThunkInfo as well.

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

14 years agoMove ReturnAdjustment and ThisAdjustment out into CGVtable.h
Anders Carlsson [Tue, 23 Mar 2010 15:13:06 +0000 (15:13 +0000)]
Move ReturnAdjustment and ThisAdjustment out into CGVtable.h

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

14 years agoIgnore a more comprehensive set of gcc-special format attributes.
Duncan Sands [Tue, 23 Mar 2010 14:44:19 +0000 (14:44 +0000)]
Ignore a more comprehensive set of gcc-special format attributes.

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

14 years agoBind the constructed object value to CXXConstructExpr.
Zhongxing Xu [Tue, 23 Mar 2010 09:13:17 +0000 (09:13 +0000)]
Bind the constructed object value to CXXConstructExpr.

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

14 years agoupdate CMakeLists.txt
Zhongxing Xu [Tue, 23 Mar 2010 08:14:19 +0000 (08:14 +0000)]
update CMakeLists.txt

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

14 years agoClear the return expr GDM after using it.
Zhongxing Xu [Tue, 23 Mar 2010 08:09:29 +0000 (08:09 +0000)]
Clear the return expr GDM after using it.

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

14 years agoAdd a AggExprVisitor class. It contains lots of boiler
Zhongxing Xu [Tue, 23 Mar 2010 07:32:14 +0000 (07:32 +0000)]
Add a AggExprVisitor class. It contains lots of boiler
plate code for evaluating expressions of C++ class type.

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

14 years agoUse the canonical destructor, which fixes the self-host build. Thanks to Eli for...
Anders Carlsson [Tue, 23 Mar 2010 05:15:24 +0000 (05:15 +0000)]
Use the canonical destructor, which fixes the self-host build. Thanks to Eli for noticing.

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

14 years agomerge line.
Zhongxing Xu [Tue, 23 Mar 2010 05:13:26 +0000 (05:13 +0000)]
merge line.

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

14 years agoFrontend: Don't free the CompilerInstance or FrontendActions when running under
Daniel Dunbar [Tue, 23 Mar 2010 05:09:16 +0000 (05:09 +0000)]
Frontend: Don't free the CompilerInstance or FrontendActions when running under
-disable-free. Among other things, this fixes freeing of the LLVM module on
exit.
 - Note that this means we are disable-free'ing of a lot more stuff than we used to -- this should flush out bugs in anything left that is trying to do real work in its destructor. I did a mini-audit but '::~' is not totally uncommon.

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

14 years agoPPCallbacks: Add hook for reaching the end of the main file, and fix DependencyFile...
Daniel Dunbar [Tue, 23 Mar 2010 05:09:10 +0000 (05:09 +0000)]
PPCallbacks: Add hook for reaching the end of the main file, and fix DependencyFile to not do work in its destructor.

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

14 years agoSince we now may have basicblocks with the same block is in different function,
Zhongxing Xu [Tue, 23 Mar 2010 05:05:02 +0000 (05:05 +0000)]
Since we now may have basicblocks with the same block is in different function,
change the block counter map from unsigned -> unsigned to
<StackFrameContext*, unsigned> -> unsigned.

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

14 years agoBaby steps towards making thunks be emitted from the new vtable layout code.
Anders Carlsson [Tue, 23 Mar 2010 04:59:02 +0000 (04:59 +0000)]
Baby steps towards making thunks be emitted from the new vtable layout code.

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

14 years agoSome renames.
Anders Carlsson [Tue, 23 Mar 2010 04:44:10 +0000 (04:44 +0000)]
Some renames.

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

14 years agoAlways emit associated thunks when emitting the function itself. Remove getVtableAddr...
Anders Carlsson [Tue, 23 Mar 2010 04:31:31 +0000 (04:31 +0000)]
Always emit associated thunks when emitting the function itself. Remove getVtableAddressPoint, it's not used.

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

14 years agoRename MaybeEmitVtable to EmitVTableRelatedData in preparation for making it emit...
Anders Carlsson [Tue, 23 Mar 2010 04:15:00 +0000 (04:15 +0000)]
Rename MaybeEmitVtable to EmitVTableRelatedData in preparation for making it emit thunks as well.

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

14 years agoRename CGVtableInfo to CodeGenVTables in preparation of adding another VTableInfo...
Anders Carlsson [Tue, 23 Mar 2010 04:11:45 +0000 (04:11 +0000)]
Rename CGVtableInfo to CodeGenVTables in preparation of adding another VTableInfo class.

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

14 years agoFor forward-declared static inline functions, delay CFG-based warnings until we
Ted Kremenek [Tue, 23 Mar 2010 01:37:12 +0000 (01:37 +0000)]
For forward-declared static inline functions, delay CFG-based warnings until we
encounter a definition.

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

14 years agoTweak null dereference diagnostics to give clearer diagnostics when
Ted Kremenek [Tue, 23 Mar 2010 01:11:38 +0000 (01:11 +0000)]
Tweak null dereference diagnostics to give clearer diagnostics when
a null dereference results from a field access.

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

14 years agoOnly perform CFG-based warnings on 'static inline' functions that
Ted Kremenek [Tue, 23 Mar 2010 00:13:23 +0000 (00:13 +0000)]
Only perform CFG-based warnings on 'static inline' functions that
are called (transitively) by regular functions/blocks within a
translation untion.

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

14 years agoSet the relevent attributes declared in class extension
Fariborz Jahanian [Mon, 22 Mar 2010 23:25:52 +0000 (23:25 +0000)]
Set the relevent attributes declared in class extension
and fix a missing diagnostics on assigning to a read-only
property. Fixes radar 7766184.

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

14 years agoA fixed version of r99174 which also includes a test that we emit vtables when
Rafael Espindola [Mon, 22 Mar 2010 23:12:48 +0000 (23:12 +0000)]
A fixed version of r99174 which also includes a test that we emit vtables when
we see an specialization definition ever if we then see a extern template declaration.

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

14 years agoDisable the emission of frontend warnings (not errors) under --analyze.
Ted Kremenek [Mon, 22 Mar 2010 22:32:05 +0000 (22:32 +0000)]
Disable the emission of frontend warnings (not errors) under --analyze.
Fixes <rdar://problem/7405601>.

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

14 years agoImprove the diagnostics for the UndefinedAssignmentChecker when an
Ted Kremenek [Mon, 22 Mar 2010 22:16:26 +0000 (22:16 +0000)]
Improve the diagnostics for the UndefinedAssignmentChecker when an
uninitialized value is used in the LHS of a compound assignment.

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

14 years agoComment the reasons for the strange little dance we do with the main file name for...
Douglas Gregor [Mon, 22 Mar 2010 21:28:29 +0000 (21:28 +0000)]
Comment the reasons for the strange little dance we do with the main file name for debug information

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

14 years ago(re)implement PR6542, accepting and discarding the __gcc_tdiag__
Chris Lattner [Mon, 22 Mar 2010 21:08:50 +0000 (21:08 +0000)]
(re)implement PR6542, accepting and discarding the __gcc_tdiag__
format attribute specifier.

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

14 years agomerge some tests.
Chris Lattner [Mon, 22 Mar 2010 21:05:15 +0000 (21:05 +0000)]
merge some tests.

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