]> granicus.if.org Git - clang/log
clang
13 years agoMark classes final and/or explicit during class template instantiation.
Anders Carlsson [Sat, 22 Jan 2011 18:07:06 +0000 (18:07 +0000)]
Mark classes final and/or explicit during class template instantiation.

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

13 years agoMark classes as final or explicit. Diagnose when a class marked 'final' is used as...
Anders Carlsson [Sat, 22 Jan 2011 17:51:53 +0000 (17:51 +0000)]
Mark classes as final or explicit. Diagnose when a class marked 'final' is used as a base.

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

13 years agoAdd final/explicit getters and setters to CXXRecordDecl.
Anders Carlsson [Sat, 22 Jan 2011 17:22:48 +0000 (17:22 +0000)]
Add final/explicit getters and setters to CXXRecordDecl.

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

13 years agoParse class-virt-specifier-seqs.
Anders Carlsson [Sat, 22 Jan 2011 16:56:46 +0000 (16:56 +0000)]
Parse class-virt-specifier-seqs.

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

13 years agoMore work on ClassVirtSpecifiers.
Anders Carlsson [Sat, 22 Jan 2011 15:58:16 +0000 (15:58 +0000)]
More work on ClassVirtSpecifiers.

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

13 years agoAdd test from PR9026.
Rafael Espindola [Sat, 22 Jan 2011 15:34:07 +0000 (15:34 +0000)]
Add test from PR9026.

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

13 years agorevert r123977 and r123978 to fix PR9026.
Rafael Espindola [Sat, 22 Jan 2011 15:32:35 +0000 (15:32 +0000)]
revert r123977 and r123978 to fix PR9026.

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

13 years agoStart stubbing out a ClassVirtSpecifiers class.
Anders Carlsson [Sat, 22 Jan 2011 15:11:37 +0000 (15:11 +0000)]
Start stubbing out a ClassVirtSpecifiers class.

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

13 years agoA member function template cannot be virtual.
Anders Carlsson [Sat, 22 Jan 2011 14:43:56 +0000 (14:43 +0000)]
A member function template cannot be virtual.

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

13 years agoUse a FunctionType::get overload that doesn't require an empty vector.
Benjamin Kramer [Sat, 22 Jan 2011 12:15:57 +0000 (12:15 +0000)]
Use a FunctionType::get overload that doesn't require an empty vector.

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

13 years agoImprove our parse recovery on 'case blah;' and 'default;'.
John McCall [Sat, 22 Jan 2011 09:28:32 +0000 (09:28 +0000)]
Improve our parse recovery on 'case blah;' and 'default;'.

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

13 years agoSend code generation for xvalues down the same path as lvalues
Douglas Gregor [Sat, 22 Jan 2011 02:44:21 +0000 (02:44 +0000)]
Send code generation for xvalues down the same path as lvalues

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

13 years agoDebug info generation for rvalue references
Douglas Gregor [Sat, 22 Jan 2011 01:58:15 +0000 (01:58 +0000)]
Debug info generation for rvalue references

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

13 years agoUpdate const_cast semantics for rvalue references. Add tests for
Douglas Gregor [Sat, 22 Jan 2011 00:19:52 +0000 (00:19 +0000)]
Update const_cast semantics for rvalue references. Add tests for
reinterpret_cast and const_cast using rvalue references.

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

13 years agoTeach static_cast and dynamic_cast about rvalue references.
Douglas Gregor [Sat, 22 Jan 2011 00:06:57 +0000 (00:06 +0000)]
Teach static_cast and dynamic_cast about rvalue references.

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

13 years agoAdd a test for "perfect" forwarding
Douglas Gregor [Fri, 21 Jan 2011 22:52:47 +0000 (22:52 +0000)]
Add a test for "perfect" forwarding

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

13 years agoProvide -Wuninitialized-experimental fixits
Ted Kremenek [Fri, 21 Jan 2011 22:49:49 +0000 (22:49 +0000)]
Provide -Wuninitialized-experimental fixits
for floats, and also check if 'nil' is declared
when suggesting it for initializing ObjC pointers.

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

13 years agoWhen throwing an elidable object, first try to treat the subexpression
Douglas Gregor [Fri, 21 Jan 2011 22:46:35 +0000 (22:46 +0000)]
When throwing an elidable object, first try to treat the subexpression
as an rvalue per C++0x [class.copy]p33. If that fails, try again with
the original subexpression.

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

13 years agoGeneralize the NRVO move-construction-based initialization routine. No functionality...
Douglas Gregor [Fri, 21 Jan 2011 21:08:57 +0000 (21:08 +0000)]
Generalize the NRVO move-construction-based initialization routine. No functionality change

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

13 years agoAdd basic fixits for -Wuninitialized-experimental
Ted Kremenek [Fri, 21 Jan 2011 19:41:46 +0000 (19:41 +0000)]
Add basic fixits for -Wuninitialized-experimental
to suggest initializations for pointer and
ObjC pointer types.

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

13 years agoEnhance -Wuninitialized-experimental diagnostics
Ted Kremenek [Fri, 21 Jan 2011 19:41:41 +0000 (19:41 +0000)]
Enhance -Wuninitialized-experimental diagnostics
to issue the warning at an uninitialized variable's
declaration, but to issue notes at possible
uninitialized uses (which could be multiple).

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

13 years agoImplement the preference for move-construction over copy-construction
Douglas Gregor [Fri, 21 Jan 2011 19:38:21 +0000 (19:38 +0000)]
Implement the preference for move-construction over copy-construction
when returning an NRVO candidate expression. For example, this
properly picks the move constructor when dealing with code such as

  MoveOnlyType f() { MoveOnlyType mot; return mot; }

The previously-XFAIL'd rvalue-references test case now works, and has
been moved into the appropriate paragraph-specific test case.

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

13 years agoWe love parentheses
Douglas Gregor [Fri, 21 Jan 2011 18:20:49 +0000 (18:20 +0000)]
We love parentheses

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

13 years agoPromote the static getNRVOCandidate() function, which computed the
Douglas Gregor [Fri, 21 Jan 2011 18:05:27 +0000 (18:05 +0000)]
Promote the static getNRVOCandidate() function, which computed the
NRVO candidate for a return statement, to
Sema::getCopyElisionCandidate(), and teach it enough to also determine
the NRVO candidate for a throw expression. We still don't use the
latter information, however.

Along the way, implement core issue 1148, which eliminates copy
elision from catch parameters and clarifies that copy elision cannot
occur from function parameters (which we already implemented).

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

13 years agoImplement core issue 1164, which concerns the partial ordering of
Douglas Gregor [Fri, 21 Jan 2011 17:29:42 +0000 (17:29 +0000)]
Implement core issue 1164, which concerns the partial ordering of
f(T&) and f(T&&).

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

13 years agoAdd unique_ptr example to test the use of rvalue references. I'll grow
Douglas Gregor [Fri, 21 Jan 2011 17:06:29 +0000 (17:06 +0000)]
Add unique_ptr example to test the use of rvalue references. I'll grow
this example further as more rvalue-reference features come online.

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

13 years agoAdd test for overload resolution's preference for binding an rvalue
Douglas Gregor [Fri, 21 Jan 2011 16:48:38 +0000 (16:48 +0000)]
Add test for overload resolution's preference for binding an rvalue
reference to an rvalue rather than binding a const-qualified lvalue
reference to that rvalue.

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

13 years agoEliminate an unused variable
Douglas Gregor [Fri, 21 Jan 2011 16:37:29 +0000 (16:37 +0000)]
Eliminate an unused variable

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

13 years agoUpdate the reference-binding implementation used for overload
Douglas Gregor [Fri, 21 Jan 2011 16:36:05 +0000 (16:36 +0000)]
Update the reference-binding implementation used for overload
resolution to match the latest C++0x working paper's semantics. The
implementation now matching up with the reference-binding
implementation used for initialization.

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

13 years agoMore testing to C++0x [temp.deduct.call]p3
Douglas Gregor [Fri, 21 Jan 2011 05:24:25 +0000 (05:24 +0000)]
More testing to C++0x [temp.deduct.call]p3

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

13 years agoImplement the special template argument deduction rule for T&& in a
Douglas Gregor [Fri, 21 Jan 2011 05:18:22 +0000 (05:18 +0000)]
Implement the special template argument deduction rule for T&& in a
call (C++0x [temp.deduct.call]p3).

As part of this, start improving the reference-binding implementation
used in the computation of implicit conversion sequences (for overload
resolution) to reflect C++0x semantics. It still needs more work and
testing, of course.

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

13 years agoSema: process non-inheritable attributes on function declarations early
Peter Collingbourne [Fri, 21 Jan 2011 02:08:54 +0000 (02:08 +0000)]
Sema: process non-inheritable attributes on function declarations early

This allows us to simplify the handling for the overloadable attribute,
removing a number of FIXMEs.

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

13 years agoSema: support for processing non-inheritable declaration attributes early
Peter Collingbourne [Fri, 21 Jan 2011 02:08:45 +0000 (02:08 +0000)]
Sema: support for processing non-inheritable declaration attributes early

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

13 years agoGeneralise support for non-inheritable attributes
Peter Collingbourne [Fri, 21 Jan 2011 02:08:36 +0000 (02:08 +0000)]
Generalise support for non-inheritable attributes

Inheritable attributes on declarations may be inherited by any later
redeclaration at merge time.  By contrast, a non-inheritable attribute
will not be inherited by later redeclarations.  Non-inheritable
attributes may be semantically analysed early, allowing them to
influence the redeclaration/overloading process.

Before this change, the "overloadable" attribute received special
handling to be treated as non-inheritable, while all other attributes
were treated as inheritable.  This patch generalises the concept,
while removing a FIXME.  Some CUDA location attributes are also marked
as non-inheritable in order to support special overloading semantics
(to be introduced in a later patch).

The patch introduces a new Attr subclass, InheritableAttr, from
which all inheritable attributes derive.  Non-inheritable attributes
simply derive from Attr.

N.B. I did not review every attribute to determine whether it should
be marked non-inheritable.  This can be done later on an incremental
basis, as this change does not affect default functionality.

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

13 years agoAdd more reference-binding examples from the C++0x working paper, all of which seem...
Douglas Gregor [Fri, 21 Jan 2011 01:11:43 +0000 (01:11 +0000)]
Add more reference-binding examples from the C++0x working paper, all of which seem to be working fine

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

13 years agoMove cheking of kext into canDevirtualizeMemberFunctionCalls().
Fariborz Jahanian [Fri, 21 Jan 2011 01:04:41 +0000 (01:04 +0000)]
Move cheking of kext into canDevirtualizeMemberFunctionCalls().
Improve on test case. Per Doug's comment. wip.

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

13 years agoImprove the diagnostic that complains about binding an rvalue
Douglas Gregor [Fri, 21 Jan 2011 01:04:33 +0000 (01:04 +0000)]
Improve the diagnostic that complains about binding an rvalue
reference to an lvalue.

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

13 years agoMore work to bring reference binding up to the latest C++0x
Douglas Gregor [Fri, 21 Jan 2011 00:52:42 +0000 (00:52 +0000)]
More work to bring reference binding up to the latest C++0x
specification. In particular, an rvalue reference can bind to an
initializer expression that is an lvalue if the referent type and the
initializer expression type are not reference-related. This is a newer
formulation to the previous "rvalue references can never bind to
lvalues" rule.

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

13 years agoWhen performing reference binding via a conversion function, perform
Douglas Gregor [Fri, 21 Jan 2011 00:27:08 +0000 (00:27 +0000)]
When performing reference binding via a conversion function, perform
type checking based on the actual reference type we're trying to bind
the result to, rather than stripping the reference.

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

13 years agoInitialize a variable, found by Ted.
Fariborz Jahanian [Thu, 20 Jan 2011 23:34:25 +0000 (23:34 +0000)]
Initialize a variable, found by Ted.

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

13 years agoFix a use of uninitialized variables, found by Ted!
Douglas Gregor [Thu, 20 Jan 2011 23:15:49 +0000 (23:15 +0000)]
Fix a use of uninitialized variables, found by Ted!

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

13 years agoRemoving debug printing logic from UninitializedValuesV2.
Ted Kremenek [Thu, 20 Jan 2011 21:25:34 +0000 (21:25 +0000)]
Removing debug printing logic from UninitializedValuesV2.

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

13 years agoRelax CFG assertions in UninitializedValuesV2 when
Ted Kremenek [Thu, 20 Jan 2011 21:25:31 +0000 (21:25 +0000)]
Relax CFG assertions in UninitializedValuesV2 when
handling pseudo-path sensitivity, and instead
use those assertion conditions as dynamic checks.
These assertions would be violated when analyzing
a CFG where some branches where optimized away
during CFG construction because their branch
conditions could be trivially determined.

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

13 years agoAdd test case for <rdar://problem/8891119>. In
Ted Kremenek [Thu, 20 Jan 2011 19:45:14 +0000 (19:45 +0000)]
Add test case for <rdar://problem/8891119>.  In
earlier revisions Clang was incorrectly warning
about an incomplete @implementation when a property
was getting synthesized.  This got fixed somewhere
down the line.

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

13 years agoAdd rudimentary path-sensitivity to UnintializedValuesV2
Ted Kremenek [Thu, 20 Jan 2011 17:37:17 +0000 (17:37 +0000)]
Add rudimentary path-sensitivity to UnintializedValuesV2
analysis for short-circuited operations.  For branch written like "if (x && y)",
we maintain two sets of dataflow values for the outgoing
branches.  This suppresses some common false positives
for -Wuninitialized-experimental.

This change introduces some assertion failures
when running on the LLVM codebase.  WIP.

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

13 years agoapple kext abi requires all vf calls, including qualified
Fariborz Jahanian [Thu, 20 Jan 2011 17:19:02 +0000 (17:19 +0000)]
apple kext abi requires all vf calls, including qualified
vf calls, be made indirect. This patch is towards that goal.

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

13 years agoEnhance AnalysisConsumer to also visit functions
Ted Kremenek [Thu, 20 Jan 2011 17:09:48 +0000 (17:09 +0000)]
Enhance AnalysisConsumer to also visit functions
and methods defined within 'namespace X { ... }'.

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

13 years agoMore tests for reference binding in the presence of rvalue
Douglas Gregor [Thu, 20 Jan 2011 17:04:36 +0000 (17:04 +0000)]
More tests for reference binding in the presence of rvalue
references. Note that we're currently failing reference binding to a
function lvalue.

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

13 years agoStart refactoring reference binding to more closely match the C++0x
Douglas Gregor [Thu, 20 Jan 2011 16:44:54 +0000 (16:44 +0000)]
Start refactoring reference binding to more closely match the C++0x
working paper's structure. The only functional change here is that we
now handling binding to array rvalues, which we would previously reject.

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

13 years agoDiagnose when a virtual member function marked final is overridden.
Anders Carlsson [Thu, 20 Jan 2011 16:25:36 +0000 (16:25 +0000)]
Diagnose when a virtual member function marked final is overridden.

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

13 years agoMerge test.
Rafael Espindola [Thu, 20 Jan 2011 16:11:21 +0000 (16:11 +0000)]
Merge test.

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

13 years agoAdd some tests for reference-collapsing and referencing binding
Douglas Gregor [Thu, 20 Jan 2011 16:08:06 +0000 (16:08 +0000)]
Add some tests for reference-collapsing and referencing binding
involving rvalue references, to start scoping out what is and what
isn't implemented. In the process, tweak some standards citations,
type desugaring, and teach the tentative parser about && in
ptr-operator.

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

13 years agoFix the computation of alignment for fields of packed+aligned structs.
John McCall [Thu, 20 Jan 2011 07:57:12 +0000 (07:57 +0000)]
Fix the computation of alignment for fields of packed+aligned structs.
Part of the fix for PR8413.

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

13 years agoWhen instantiating member functions, propagate whether the member function is marked...
Anders Carlsson [Thu, 20 Jan 2011 06:52:44 +0000 (06:52 +0000)]
When instantiating member functions, propagate whether the member function is marked 'final' and 'override'.

Also, call CheckOverrideControl when instantiating member functions.

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

13 years agoWhen checking for functions marked override, ignore dependent contexts.
Anders Carlsson [Thu, 20 Jan 2011 06:33:26 +0000 (06:33 +0000)]
When checking for functions marked override, ignore dependent contexts.

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

13 years agoMake CheckOverrideControl a member of Sema.
Anders Carlsson [Thu, 20 Jan 2011 06:29:02 +0000 (06:29 +0000)]
Make CheckOverrideControl a member of Sema.

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

13 years agoDiagnose virtual member functions marked override but not overriding any virtual...
Anders Carlsson [Thu, 20 Jan 2011 05:57:14 +0000 (05:57 +0000)]
Diagnose virtual member functions marked override but not overriding any virtual member functions.

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

13 years agoFix tests to be valid.
Anders Carlsson [Thu, 20 Jan 2011 05:55:43 +0000 (05:55 +0000)]
Fix tests to be valid.

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

13 years agoAdd IsMarkedOverride and IsMarkedFinal flags to FunctionDecl (to be used by CXXRecord...
Anders Carlsson [Thu, 20 Jan 2011 05:36:44 +0000 (05:36 +0000)]
Add IsMarkedOverride and IsMarkedFinal flags to FunctionDecl (to be used by CXXRecordDecl).

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

13 years agoChange the parser error to reflect that virt-specifiers are allowed on any class...
Anders Carlsson [Thu, 20 Jan 2011 04:38:09 +0000 (04:38 +0000)]
Change the parser error to reflect that virt-specifiers are allowed on any class member.

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

13 years agoOnly allow virtual member functions to be marked 'override' and 'final'.
Anders Carlsson [Thu, 20 Jan 2011 04:34:22 +0000 (04:34 +0000)]
Only allow virtual member functions to be marked 'override' and 'final'.

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

13 years agoAdd silly test case.
Anders Carlsson [Thu, 20 Jan 2011 04:07:46 +0000 (04:07 +0000)]
Add silly test case.

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

13 years agoPass the VirtSpecifiers along to Sema::ActOnCXXMemberDeclarator.
Anders Carlsson [Thu, 20 Jan 2011 03:57:25 +0000 (03:57 +0000)]
Pass the VirtSpecifiers along to Sema::ActOnCXXMemberDeclarator.

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

13 years agoLazily initialize the 'final' and 'override' contextual keywords as suggested by...
Anders Carlsson [Thu, 20 Jan 2011 03:47:08 +0000 (03:47 +0000)]
Lazily initialize the 'final' and 'override' contextual keywords as suggested by Doug.

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

13 years agoAdd more parser tests for the override control keywords.
Anders Carlsson [Thu, 20 Jan 2011 03:41:12 +0000 (03:41 +0000)]
Add more parser tests for the override control keywords.

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

13 years agoTurns out that the previous commit also fixes this :-)
Rafael Espindola [Thu, 20 Jan 2011 02:57:51 +0000 (02:57 +0000)]
Turns out that the previous commit also fixes this :-)

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

13 years agoFix PR8884 by skipping transparent contexts. The test is for LikageSpec. I
Rafael Espindola [Thu, 20 Jan 2011 02:26:24 +0000 (02:26 +0000)]
Fix PR8884 by skipping transparent contexts. The test is for LikageSpec. I
failed to find a case where an enum context would make a difference, but
found PR9007 on the way.

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

13 years agoAdd CharUnits::RoundUpToAlignment() to simplify rounding in character units.
Ken Dyck [Thu, 20 Jan 2011 01:59:55 +0000 (01:59 +0000)]
Add CharUnits::RoundUpToAlignment() to simplify rounding in character units.

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

13 years agoWhen building a user-defined conversion sequence, keep track of the
Douglas Gregor [Thu, 20 Jan 2011 01:32:05 +0000 (01:32 +0000)]
When building a user-defined conversion sequence, keep track of the
declaration that name lookup actually found, so that we can use it for
access checking later on. Fixes <rdar://problem/8876150>.

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

13 years agoSema::BuildCXXMemberCallExpr() can fail due to access or ambiguities,
Douglas Gregor [Thu, 20 Jan 2011 00:18:04 +0000 (00:18 +0000)]
Sema::BuildCXXMemberCallExpr() can fail due to access or ambiguities,
so allow it to propagate the failure outward. Fixes the crashing part
of <rdar://problem/8876150>.

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

13 years agoExplicitly track the number of call arguments provided when performing
Douglas Gregor [Wed, 19 Jan 2011 23:54:39 +0000 (23:54 +0000)]
Explicitly track the number of call arguments provided when performing
overload resolution, so that we only use that number of call arguments
for partial ordering. Fixes PR9006, a recent regression.

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

13 years agoEradicate any mention of C++0x concepts.
Douglas Gregor [Wed, 19 Jan 2011 23:15:20 +0000 (23:15 +0000)]
Eradicate any mention of C++0x concepts.

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

13 years agoVariadic templates are fully implemented.
Douglas Gregor [Wed, 19 Jan 2011 22:11:50 +0000 (22:11 +0000)]
Variadic templates are fully implemented.

Turn on the __has_feature switch for variadic templates, document
their completion, and put the ExtWarn into the c++0x-extensions
warning group.

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

13 years agoDowngrade the "variadic templates are a C++0x feature" error to an
Douglas Gregor [Wed, 19 Jan 2011 21:59:15 +0000 (21:59 +0000)]
Downgrade the "variadic templates are a C++0x feature" error to an
ExtWarn. We want variadic templates to be usable in libc++/libstdc++
headers even when we're in C++98/03 mode, since it's the only clean
way to implement TR1 <functional>.

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

13 years agoRefactor the dependence computation for DeclRefExpr so that we can
Douglas Gregor [Wed, 19 Jan 2011 21:52:31 +0000 (21:52 +0000)]
Refactor the dependence computation for DeclRefExpr so that we can
reuse it for BlockDeclRefExpr. Do so, fixing the dependence calculate
for BlockDeclRefExpr.

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

13 years agoImplement basic support for the use of variadic templates and blocks
Douglas Gregor [Wed, 19 Jan 2011 21:32:01 +0000 (21:32 +0000)]
Implement basic support for the use of variadic templates and blocks
together. In particular:
  - Handle the use of captured parameter pack names within blocks
  (BlockDeclRefExpr understands parameter packs now)
  - Handle the declaration and expansion of parameter packs within a block's
  parameter list, e.g., ^(Args ...args) { ... })
  - Handle instantiation of blocks where the return type was not
  explicitly specified. (unrelated, but necessary for my tests).

Together, these fixes should make blocks and variadic templates work
reasonably well together. Note that BlockDeclRefExpr is still broken
w.r.t. its computation of type and value dependence, which will still
cause problems for blocks in templates.

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

13 years agoTeach libclang to generate USRs containing parameter packs and pack expansions.
Douglas Gregor [Wed, 19 Jan 2011 20:50:07 +0000 (20:50 +0000)]
Teach libclang to generate USRs containing parameter packs and pack expansions.

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

13 years agoTeach libclang about SizeOfPackExpr.
Douglas Gregor [Wed, 19 Jan 2011 20:34:17 +0000 (20:34 +0000)]
Teach libclang about SizeOfPackExpr.

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

13 years agoImplement support for non-type template parameter packs whose type is
Douglas Gregor [Wed, 19 Jan 2011 20:10:05 +0000 (20:10 +0000)]
Implement support for non-type template parameter packs whose type is
a pack expansion, e.g., the parameter pack Values in:

  template<typename ...Types>
  struct Outer {
    template<Types ...Values>
    struct Inner;
  };

This new implementation approach introduces the notion of an
"expanded" non-type template parameter pack, for which we have already
expanded the types of the parameter pack (to, say, "int*, float*",
for Outer<int*, float*>) but have not yet expanded the values. Aside
from creating these expanded non-type template parameter packs, this
patch updates template argument checking and non-type template
parameter pack instantiation to make use of the appropriate types in
the parameter pack.

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

13 years agoNonTypeTemplateParmDecls always have TypeSourceInfo. There's no sense
Douglas Gregor [Wed, 19 Jan 2011 17:02:02 +0000 (17:02 +0000)]
NonTypeTemplateParmDecls always have TypeSourceInfo. There's no sense
in pretending otherwise.

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

13 years agoWarn about the use of unparenthesized |= in conditionals (which may be
Douglas Gregor [Wed, 19 Jan 2011 16:50:08 +0000 (16:50 +0000)]
Warn about the use of unparenthesized |= in conditionals (which may be
a typo for !=). Fixes PR9001, from Hans Wennborg!

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

13 years agoParse the optional semicolon after a C++ in-class member function
Douglas Gregor [Wed, 19 Jan 2011 16:41:58 +0000 (16:41 +0000)]
Parse the optional semicolon after a C++ in-class member function
definition, rather than complaining about it. Problem reported by
Marshall Clow.

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

13 years agoWhen building the copy expression for a __block variable, make sure
John McCall [Wed, 19 Jan 2011 11:48:09 +0000 (11:48 +0000)]
When building the copy expression for a __block variable, make sure
there's a respectable point of instantiation.  Also, make sure we do
this operation even when instantiating a dependently-typed variable.

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

13 years agoChange the canonical representation of array types to store qualifiers on the
John McCall [Wed, 19 Jan 2011 10:06:00 +0000 (10:06 +0000)]
Change the canonical representation of array types to store qualifiers on the
outermost array types and not on the element type.  Move the CanonicalType
member from Type to ExtQualsTypeCommonBase;  the canonical type on an ExtQuals
node includes the qualifiers on the ExtQuals.  Assorted optimizations enabled
by this change.

getQualifiers(), hasQualifiers(), etc. should all now implicitly look through
array types.

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

13 years agoChange QualType::getTypePtr() to return a const pointer, then change a
John McCall [Wed, 19 Jan 2011 06:33:43 +0000 (06:33 +0000)]
Change QualType::getTypePtr() to return a const pointer, then change a
thousand other things which were (generally inadvertantly) relying on that.

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

13 years agoFix name to match reality.
Nick Lewycky [Wed, 19 Jan 2011 05:59:39 +0000 (05:59 +0000)]
Fix name to match reality.

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

13 years agoReplace calls to getTypeSize() and getTypeAlign() with their 'InChars'
Ken Dyck [Wed, 19 Jan 2011 01:58:38 +0000 (01:58 +0000)]
Replace calls to getTypeSize() and getTypeAlign() with their 'InChars'
counterparts where char units are needed.

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

13 years agoAdd a unary minus operator.
Ken Dyck [Wed, 19 Jan 2011 01:44:40 +0000 (01:44 +0000)]
Add a unary minus operator.

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

13 years agoEmit DW_TAG_lexical_scope to surround foreach.
Devang Patel [Wed, 19 Jan 2011 01:36:36 +0000 (01:36 +0000)]
Emit DW_TAG_lexical_scope to surround foreach.

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

13 years agoDon't silently drop warning flags passed in to
Douglas Gregor [Wed, 19 Jan 2011 01:02:47 +0000 (01:02 +0000)]
Don't silently drop warning flags passed in to
clang_createTranslationUnitFromSourceFile().

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

13 years agolib/Sema/SemaExpr.cpp: __null should be LongLongTy on LLP64 Win64.
NAKAMURA Takumi [Wed, 19 Jan 2011 00:11:41 +0000 (00:11 +0000)]
lib/Sema/SemaExpr.cpp: __null should be LongLongTy on LLP64 Win64.

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

13 years agolib/CodeGen/TargetInfo.cpp: Fix coding style and erase an obsolete comment.
NAKAMURA Takumi [Wed, 19 Jan 2011 00:11:33 +0000 (00:11 +0000)]
lib/CodeGen/TargetInfo.cpp: Fix coding style and erase an obsolete comment.

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

13 years agoTeach UninitializedValuesV2 to implicitly reason about C++
Ted Kremenek [Tue, 18 Jan 2011 21:18:58 +0000 (21:18 +0000)]
Teach UninitializedValuesV2 to implicitly reason about C++
references by monitoring whether an access to
a variable is solely to compute it's lvalue or
to do an lvalue-to-rvalue conversion (i.e., a load).

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

13 years agoAdd unnamed_addr in CreateRuntimeVariable.
Rafael Espindola [Tue, 18 Jan 2011 21:07:57 +0000 (21:07 +0000)]
Add unnamed_addr in CreateRuntimeVariable.

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

13 years agoWhen redefining a macro don't warn twice if it's not used and don't warn for duplicate
Argyrios Kyrtzidis [Tue, 18 Jan 2011 19:50:15 +0000 (19:50 +0000)]
When redefining a macro don't warn twice if it's not used and don't warn for duplicate
definition by command line options. Fixes rdar://8875916.

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

13 years agoProperly do a float -> _Complex double conversion, fixes rdar://8875946.
Argyrios Kyrtzidis [Tue, 18 Jan 2011 18:49:33 +0000 (18:49 +0000)]
Properly do a float -> _Complex double conversion, fixes rdar://8875946.

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

13 years agoComment a wacky test case
Douglas Gregor [Tue, 18 Jan 2011 18:38:18 +0000 (18:38 +0000)]
Comment a wacky test case

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

13 years agoFix some unnecessarily complicated code for canonicalizing variably-modified
John McCall [Tue, 18 Jan 2011 08:40:38 +0000 (08:40 +0000)]
Fix some unnecessarily complicated code for canonicalizing variably-modified
parameter types.

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

13 years agoGeneralize some operations on qualifiers. QualType::getQualifiers() and
John McCall [Tue, 18 Jan 2011 07:41:22 +0000 (07:41 +0000)]
Generalize some operations on qualifiers.  QualType::getQualifiers() and
::getCVRQualifiers() now look through array types, like all the other
standard queries.  Also, make a 'split' variant of getUnqualifiedType().

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

13 years agoFix newlines.
Daniel Dunbar [Tue, 18 Jan 2011 05:36:08 +0000 (05:36 +0000)]
Fix newlines.

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