]> granicus.if.org Git - clang/log
clang
14 years agoWhen mapping restrict to noalias, look for 'restrict' on the parameter variable
John McCall [Sat, 27 Mar 2010 00:47:27 +0000 (00:47 +0000)]
When mapping restrict to noalias, look for 'restrict' on the parameter variable
instead of the canonical parameter type (which has correctly dropped all such
direct qualifiers).  Fixes PR6695.

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

14 years agoscan-build: set environment variable LDPLUSPLUS to 'c++-analyzer' to correctly link...
Ted Kremenek [Sat, 27 Mar 2010 00:20:01 +0000 (00:20 +0000)]
scan-build: set environment variable LDPLUSPLUS to 'c++-analyzer' to correctly link projects
with c++ code.

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

14 years agoFix comparison in isDiagnosticInFlight().
Ted Kremenek [Fri, 26 Mar 2010 23:36:48 +0000 (23:36 +0000)]
Fix comparison in isDiagnosticInFlight().

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

14 years agoRemove unused static function
Douglas Gregor [Fri, 26 Mar 2010 23:25:35 +0000 (23:25 +0000)]
Remove unused static function

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

14 years agoPut function templates instantiated from friend declarations in the correct
John McCall [Fri, 26 Mar 2010 23:10:15 +0000 (23:10 +0000)]
Put function templates instantiated from friend declarations in the correct
lexical context.  This is required for ADL to work properly;  fixes PR6716.

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

14 years agoCompare namespaces properly when looking for redeclarations of
Douglas Gregor [Fri, 26 Mar 2010 22:59:39 +0000 (22:59 +0000)]
Compare namespaces properly when looking for redeclarations of
namespace aliases. Fixes PR6341.

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

14 years agoFix NoReturnFunctionChecker to properly look at a function's type
Ted Kremenek [Fri, 26 Mar 2010 22:57:13 +0000 (22:57 +0000)]
Fix NoReturnFunctionChecker to properly look at a function's type
when determining if it returns.  Fixes <rdar://problem/7796563>.

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

14 years agoAdd comment indicating that we intentionally don't add the noreturn
Ted Kremenek [Fri, 26 Mar 2010 22:57:10 +0000 (22:57 +0000)]
Add comment indicating that we intentionally don't add the noreturn
attribute to a FunctionDecl.

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

14 years agoWhen adding initializers to a constructor, be sure that we are looking
Douglas Gregor [Fri, 26 Mar 2010 22:43:07 +0000 (22:43 +0000)]
When adding initializers to a constructor, be sure that we are looking
through the bases and fields of the definition of the class in which
the constructor is declared, rather than some other declaration of
that class.

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

14 years agoDriver/Darwin: Support CCC_ENABLE_NEW_DARWIN_TOOLCHAIN as an environment
Daniel Dunbar [Fri, 26 Mar 2010 22:41:03 +0000 (22:41 +0000)]
Driver/Darwin: Support CCC_ENABLE_NEW_DARWIN_TOOLCHAIN as an environment
override to enable use of the DarwinClang tool chain on all platforms (not just
ARM).

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

14 years agoProperly account for redeclarations when explicitly instantiating class templates.
John McCall [Fri, 26 Mar 2010 21:56:38 +0000 (21:56 +0000)]
Properly account for redeclarations when explicitly instantiating class templates.
What happens here is that we actually turn the first declaration into a
definition, regardless of whether it was actually originally a definition,
and furthermore we do this all after we've instantiated all the declarations.
This exposes a bug in my DefinitionData patch where it was only setting the
DefinitionData for previous declarations, not future declarations.
Fortunately, there's an iterator for that.

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

14 years agoWhen trying to determine whether one operand of a conditional
Douglas Gregor [Fri, 26 Mar 2010 20:59:55 +0000 (20:59 +0000)]
When trying to determine whether one operand of a conditional
expression can be converted to the type of another, only apply the
lvalue-to-rvalue conversion to the type of the expression we're
converting, *not* the array-to-pointer or function-to-pointer
conversions. Fixes PR6595.

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

14 years agoEliminate the non-InitializedEntity PerformCopyInitialization() and
Douglas Gregor [Fri, 26 Mar 2010 20:35:59 +0000 (20:35 +0000)]
Eliminate the non-InitializedEntity PerformCopyInitialization() and
re-route its only caller to the newer
PerformCopyInitialization(). We're down to one remaining caller of
Sema::CheckReferenceInit.

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

14 years agoMake sure we don't include mm_malloc.h in this test, it includes errno.h which
Daniel Dunbar [Fri, 26 Mar 2010 20:17:23 +0000 (20:17 +0000)]
Make sure we don't include mm_malloc.h in this test, it includes errno.h which
we aren't always able to find on Win32.

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

14 years agoFix 80 col violations.
Daniel Dunbar [Fri, 26 Mar 2010 20:17:17 +0000 (20:17 +0000)]
Fix 80 col violations.

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

14 years agoSwitch semantic analysis of the conditional operator from using
Douglas Gregor [Fri, 26 Mar 2010 20:14:36 +0000 (20:14 +0000)]
Switch semantic analysis of the conditional operator from using
CheckReferenceInit to using the new initialization sequence code.

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

14 years agoRuntime: Install the new libcc_kext.a produced by the clang_darwin compiler-rt
Daniel Dunbar [Fri, 26 Mar 2010 19:37:38 +0000 (19:37 +0000)]
Runtime: Install the new libcc_kext.a produced by the clang_darwin compiler-rt
configuration.

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

14 years agoSpell -triple correctly for %clang, not %clang_cc1.
Daniel Dunbar [Fri, 26 Mar 2010 19:02:07 +0000 (19:02 +0000)]
Spell -triple correctly for %clang, not %clang_cc1.

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

14 years agoi386-apple-darwin10 implies sse2, this option shouldn't be needed.
Chris Lattner [Fri, 26 Mar 2010 17:51:13 +0000 (17:51 +0000)]
i386-apple-darwin10 implies sse2, this option shouldn't be needed.

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

14 years agofix a case where macro expansion should be disabled, patch by
Chris Lattner [Fri, 26 Mar 2010 17:49:16 +0000 (17:49 +0000)]
fix a case where macro expansion should be disabled, patch by
Abramo Bagnara!

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

14 years agomerge all the macro disable tests by using filecheck.
Chris Lattner [Fri, 26 Mar 2010 17:46:33 +0000 (17:46 +0000)]
merge all the macro disable tests by using filecheck.

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

14 years agofix a bug in paste avoidance which would cause us to accidentally
Chris Lattner [Fri, 26 Mar 2010 17:10:02 +0000 (17:10 +0000)]
fix a bug in paste avoidance which would cause us to accidentally
form a >>=.  Patch by Abramo Bagnara, testcase by me.

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

14 years agoxmmintrin just requires sse2, not sse3.
Chris Lattner [Fri, 26 Mar 2010 17:05:16 +0000 (17:05 +0000)]
xmmintrin just requires sse2, not sse3.

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

14 years agoNo need to specify ${CMAKE_CURRENT_BINARY_DIR}
Kovarththanan Rajaratnam [Fri, 26 Mar 2010 16:46:16 +0000 (16:46 +0000)]
No need to specify ${CMAKE_CURRENT_BINARY_DIR}

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

14 years agoadd a slight variation of test3, where
Gabor Greif [Fri, 26 Mar 2010 08:26:30 +0000 (08:26 +0000)]
add a slight variation of test3, where
argument list seems to be different, but in fact
is semantically equivalent; check that we do not error here

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

14 years agoImplement new mangling for vectors.
Nick Lewycky [Fri, 26 Mar 2010 07:18:04 +0000 (07:18 +0000)]
Implement new mangling for vectors.

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

14 years agoDo not mark the destructor of a function parameter's type. Fixes PR6709.
Douglas Gregor [Fri, 26 Mar 2010 06:57:13 +0000 (06:57 +0000)]
Do not mark the destructor of a function parameter's type. Fixes PR6709.

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

14 years agoRevert r99612 and see if it fixes self-host.
Anders Carlsson [Fri, 26 Mar 2010 06:35:42 +0000 (06:35 +0000)]
Revert r99612 and see if it fixes self-host.

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

14 years agoAdd tests for PR6707.
Douglas Gregor [Fri, 26 Mar 2010 05:57:46 +0000 (05:57 +0000)]
Add tests for PR6707.

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

14 years agoDon't initialize virtual pointers for primary bases, they've already been initialized.
Anders Carlsson [Fri, 26 Mar 2010 05:53:12 +0000 (05:53 +0000)]
Don't initialize virtual pointers for primary bases, they've already been initialized.

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

14 years agoWhen deducing an integral template argument for a non-type template
Douglas Gregor [Fri, 26 Mar 2010 05:50:28 +0000 (05:50 +0000)]
When deducing an integral template argument for a non-type template
parameter, keep the integral value exactly as it was in the source
code rather than trying to convert it to the type of the non-type
template parameter (which may still be dependent!). The value will
then be converted to the appropriate type once we check the resulting
template arguments. Fixes PR6707.

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

14 years agoReapply r99596 with a fix: link an instantiated friend function to its
John McCall [Fri, 26 Mar 2010 04:53:08 +0000 (04:53 +0000)]
Reapply r99596 with a fix:  link an instantiated friend function to its
pattern if it has a body.

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

14 years agoSimplify InitializeVtablePtrs in preparation of making it work with construction...
Anders Carlsson [Fri, 26 Mar 2010 04:39:42 +0000 (04:39 +0000)]
Simplify InitializeVtablePtrs in preparation of making it work with construction vtables.

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

14 years agoAdd and implement CodeGenVTables::getSecondaryVirtualPointerIndex (not used yet).
Anders Carlsson [Fri, 26 Mar 2010 04:23:58 +0000 (04:23 +0000)]
Add and implement CodeGenVTables::getSecondaryVirtualPointerIndex (not used yet).

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

14 years agoDidn't mean to commit this.
Anders Carlsson [Fri, 26 Mar 2010 04:14:45 +0000 (04:14 +0000)]
Didn't mean to commit this.

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

14 years agoUse the new vtable layout code for construction vtables.
Anders Carlsson [Fri, 26 Mar 2010 04:13:46 +0000 (04:13 +0000)]
Use the new vtable layout code for construction vtables.

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

14 years agoMore cleanup.
Anders Carlsson [Fri, 26 Mar 2010 04:10:39 +0000 (04:10 +0000)]
More cleanup.

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

14 years agoWay more VTT builder cleanup.
Anders Carlsson [Fri, 26 Mar 2010 03:56:54 +0000 (03:56 +0000)]
Way more VTT builder cleanup.

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

14 years agoApparently that didn't work. Reverting for now.
John McCall [Fri, 26 Mar 2010 02:38:45 +0000 (02:38 +0000)]
Apparently that didn't work.  Reverting for now.

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

14 years agoReinstate change to non-type template arguments of integral type, so
Douglas Gregor [Fri, 26 Mar 2010 02:38:37 +0000 (02:38 +0000)]
Reinstate change to non-type template arguments of integral type, so
that we extend/truncate then correct the sign to convert the non-type
template argument to the template parameter's type. Previously, we
reported an error when the non-type template argument was out of
range; now we just warn.

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

14 years agoProperly instantiate and link in friend function templates.
John McCall [Fri, 26 Mar 2010 02:05:14 +0000 (02:05 +0000)]
Properly instantiate and link in friend function templates.

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

14 years agoUpdate test case since c-index-test now works on invalid sources.
Ted Kremenek [Fri, 26 Mar 2010 01:34:53 +0000 (01:34 +0000)]
Update test case since c-index-test now works on invalid sources.

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

14 years agoReturn translation units from clang_createTranslationUnitFromSource()
Ted Kremenek [Fri, 26 Mar 2010 01:34:51 +0000 (01:34 +0000)]
Return translation units from clang_createTranslationUnitFromSource()
if even they contain errors.

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

14 years agoMore VTT builder cleanup.
Anders Carlsson [Fri, 26 Mar 2010 00:58:21 +0000 (00:58 +0000)]
More VTT builder cleanup.

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

14 years agoThis is just a simple v4si * v4si, make it so.
Eric Christopher [Fri, 26 Mar 2010 00:51:28 +0000 (00:51 +0000)]
This is just a simple v4si * v4si, make it so.

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

14 years agoMore VTT cleanup.
Anders Carlsson [Fri, 26 Mar 2010 00:50:17 +0000 (00:50 +0000)]
More VTT cleanup.

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

14 years agoRevert attempted fix for integral template arguments. It seems to have broken tramp3d-v4.
Douglas Gregor [Fri, 26 Mar 2010 00:39:40 +0000 (00:39 +0000)]
Revert attempted fix for integral template arguments. It seems to have broken tramp3d-v4.

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

14 years agoMark virtual methods that are used in tables included in VTTs as used.
Rafael Espindola [Fri, 26 Mar 2010 00:36:59 +0000 (00:36 +0000)]
Mark virtual methods that are used in tables included in VTTs as used.
Fixes PR6706.

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

14 years agoStart cleaning up the VTT builder to make it work more like the VTable builder.
Anders Carlsson [Fri, 26 Mar 2010 00:35:45 +0000 (00:35 +0000)]
Start cleaning up the VTT builder to make it work more like the VTable builder.

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

14 years agoRemove some VTT builder arguments that were always zero.
Anders Carlsson [Fri, 26 Mar 2010 00:11:51 +0000 (00:11 +0000)]
Remove some VTT builder arguments that were always zero.

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

14 years agoWarn when the conversion of an integral non-type template argument to
Douglas Gregor [Thu, 25 Mar 2010 22:21:04 +0000 (22:21 +0000)]
Warn when the conversion of an integral non-type template argument to
the type of its corresponding non-type template parameter changes the
value. Previously, we were diagnosing this as an error, which was
wrong. We give reasonably nice warnings like:

test/SemaTemplate/temp_arg_nontype.cpp:100:10: warning: non-type template
      argument value '256' truncated to '0' for template parameter of type
      'unsigned char'
Overflow<256> *overflow3; // expected-warning{{non-type template ...
         ^~~
test/SemaTemplate/temp_arg_nontype.cpp:96:24: note: template parameter is
      declared here
template<unsigned char C> struct Overflow;
                       ^

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

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