]> granicus.if.org Git - clang/log
clang
13 years agoRvalue references for *this: parse ref-qualifiers.
Douglas Gregor [Wed, 26 Jan 2011 03:43:54 +0000 (03:43 +0000)]
Rvalue references for *this: parse ref-qualifiers.

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

13 years agoUse RecordLayout::getBaseClassOffset() where CharUnits are needed instead of
Ken Dyck [Wed, 26 Jan 2011 02:17:08 +0000 (02:17 +0000)]
Use RecordLayout::getBaseClassOffset() where CharUnits are needed instead of
converting getBaseClassOffsetInBits() to CharUnits.

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

13 years ago[analyzer] Enable the self-init checker under command-line option '-analyzer-check...
Argyrios Kyrtzidis [Wed, 26 Jan 2011 01:26:50 +0000 (01:26 +0000)]
[analyzer] Enable the self-init checker under command-line option '-analyzer-check-objc-self-init' which by default
is enabled by the driver for '--analyze'.

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

13 years agoCorrect r124242 making sure function chunk that gets diagnosed is really about the...
Argyrios Kyrtzidis [Wed, 26 Jan 2011 01:26:44 +0000 (01:26 +0000)]
Correct r124242 making sure function chunk that gets diagnosed is really about the block.
Clairvoyance by John!

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

13 years ago[analyzer] Improve the diagnostic for the self-init checker. Suggestion by Ted!
Argyrios Kyrtzidis [Wed, 26 Jan 2011 01:26:41 +0000 (01:26 +0000)]
[analyzer] Improve the diagnostic for the self-init checker. Suggestion by Ted!

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

13 years agoTweak the rule for deciding if a provisional ivar is needed
Fariborz Jahanian [Wed, 26 Jan 2011 00:57:01 +0000 (00:57 +0000)]
Tweak the rule for deciding if a provisional ivar is needed
in default ivar synthesis.  Fixes // rdar://8913053.

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

13 years agoRemove CompilerInstance::getOutputFileList because it is unimplemented and unused.
Jeffrey Yasskin [Wed, 26 Jan 2011 00:18:08 +0000 (00:18 +0000)]
Remove CompilerInstance::getOutputFileList because it is unimplemented and unused.

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

13 years ago[analyzer] Do the self-init check only on NSObject subclasses. Patch by Jean-Daniel...
Argyrios Kyrtzidis [Tue, 25 Jan 2011 23:54:44 +0000 (23:54 +0000)]
[analyzer] Do the self-init check only on NSObject subclasses. Patch by Jean-Daniel Dupas!

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

13 years agoSpeculatively revert r124236
Douglas Gregor [Tue, 25 Jan 2011 23:49:36 +0000 (23:49 +0000)]
Speculatively revert r124236

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

13 years agoDiagnose calling convention attribute incompatibilities. Fixes rdar://8876096.
Argyrios Kyrtzidis [Tue, 25 Jan 2011 23:16:40 +0000 (23:16 +0000)]
Diagnose calling convention attribute incompatibilities. Fixes rdar://8876096.

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

13 years agoFix infinite loop during error diagnostics. Fixes rdar://8875304.
Argyrios Kyrtzidis [Tue, 25 Jan 2011 23:16:36 +0000 (23:16 +0000)]
Fix infinite loop during error diagnostics. Fixes rdar://8875304.

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

13 years agoChange error "function cannot return array type" -> "blocks cannot return array type...
Argyrios Kyrtzidis [Tue, 25 Jan 2011 23:16:33 +0000 (23:16 +0000)]
Change error "function cannot return array type" -> "blocks cannot return array type" when blocks are involved.
Addresses rdar://8876238.

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

13 years agoTweak return-noreturn.cpp test to have its original
Ted Kremenek [Tue, 25 Jan 2011 22:57:41 +0000 (22:57 +0000)]
Tweak return-noreturn.cpp test to have its original
contents, with the additional warning flag (and still marked XFAIL).

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

13 years agoFix regression in -Wreturn-type caused by not
Ted Kremenek [Tue, 25 Jan 2011 22:50:47 +0000 (22:50 +0000)]
Fix regression in -Wreturn-type caused by not
handling all CFGElement kinds.  While writing
the test case, it turned out that return-noreturn.cpp
wasn't actually testing anything since it has the wrong -W
flag.  That uncovered another regression with
the handling of destructors marked noreturn.  WIP.

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

13 years agoSpeculatively implement a tweak to the C++0x overload resolution rules
Douglas Gregor [Tue, 25 Jan 2011 22:19:32 +0000 (22:19 +0000)]
Speculatively implement a tweak to the C++0x overload resolution rules
for reference binding (C++ [over.rank.ics]p3b1sb4), so that we prefer
the binding of an lvalue reference to a function lvalue over the
binding of an rvalue reference. This change resolves the ambiguity
with std::forward and lvalue references to function types in a way
that seems consistent with the original rvalue references proposal.

My proposed wording for this change is shown in
isBetterReferenceBindingKind(); we'll try to get this change adopted
in the C++0x working paper as well.

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

13 years agoUnbreak CMake build.
Ted Kremenek [Tue, 25 Jan 2011 22:10:37 +0000 (22:10 +0000)]
Unbreak CMake build.

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

13 years agoDon't try and symbolicate unions; we don't reason
Ted Kremenek [Tue, 25 Jan 2011 21:08:47 +0000 (21:08 +0000)]
Don't try and symbolicate unions; we don't reason
about them yet.  Fixes crash reported in PR 9049.

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

13 years agoAdd -add-plugin flag, which runs plugins in addition to codegen.
Nico Weber [Tue, 25 Jan 2011 20:34:14 +0000 (20:34 +0000)]
Add -add-plugin flag, which runs plugins in addition to codegen.

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

13 years agoAdd an attribute to forbid temporary instances of a type. This allows class
Jeffrey Yasskin [Tue, 25 Jan 2011 20:08:12 +0000 (20:08 +0000)]
Add an attribute to forbid temporary instances of a type.  This allows class
authors to write

  class __attribute__((forbid_temporaries)) Name { ... };

when they want to force users to name all variables of the type. This protects
people from doing things like creating a scoped_lock that only lives for a
single statement instead of an entire scope.

The warning produced by this attribute can be disabled by
-Wno-forbid-temporaries.

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

13 years agoFix the ranking of reference bindings during overload resolution
Douglas Gregor [Tue, 25 Jan 2011 19:39:31 +0000 (19:39 +0000)]
Fix the ranking of reference bindings during overload resolution
(C++0x [over.ics.rank]p3) when one binding is an lvalue reference and
the other is an rvalue reference that binds to an rvalue. In
particular, we were using the predict "is an rvalue reference" rather
than "is an rvalue reference that binds to an rvalue", which was
incorrect in the one case where an rvalue reference can bind to an
lvalue: function references.

This particular issue cropped up with std::forward, where Clang was
picking an std::forward overload while forwarding an (lvalue)
reference to a function. However (and unfortunately!), the right
answer for this code is that the call to std::forward is
ambiguous. Clang now gets that right, but we need to revisit the
std::forward implementation in libc++.

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

13 years agoRecycle memory for GRStates that are never referenced
Ted Kremenek [Tue, 25 Jan 2011 19:13:54 +0000 (19:13 +0000)]
Recycle memory for GRStates that are never referenced
by ExplodedNodes.  This leads to about a 4-8%
reduction in memory footprint when analyzing
functions in sqlite3.

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

13 years agoTeach -Wuninitialized-experimental to also warn
Ted Kremenek [Tue, 25 Jan 2011 19:13:48 +0000 (19:13 +0000)]
Teach -Wuninitialized-experimental to also warn
about uninitialized variables captured by blocks.

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

13 years agoTweak wording of static analyzer diagnostic
Ted Kremenek [Tue, 25 Jan 2011 19:13:42 +0000 (19:13 +0000)]
Tweak wording of static analyzer diagnostic
for a block capturing the value of an uninitialized
variable.

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

13 years agoTeach TemplateSpecializationTypeLoc::initializeArgLocs() to actually
Douglas Gregor [Tue, 25 Jan 2011 19:13:18 +0000 (19:13 +0000)]
Teach TemplateSpecializationTypeLoc::initializeArgLocs() to actually
generate meaningful [*] template argument location information.

[*] Well, as meaningful as possible, given that this entire code path
is a hack for when we've lost type-source information.

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

13 years agoMove unnamed_addr after the function arguments on Sabre's request.
Rafael Espindola [Tue, 25 Jan 2011 19:10:24 +0000 (19:10 +0000)]
Move unnamed_addr after the function arguments on Sabre's request.

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

13 years agoAdd test for PR8629
Douglas Gregor [Tue, 25 Jan 2011 18:11:52 +0000 (18:11 +0000)]
Add test for PR8629

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

13 years agoDon't insert class templates into the DynamicClasses vector.
Anders Carlsson [Tue, 25 Jan 2011 18:08:22 +0000 (18:08 +0000)]
Don't insert class templates into the DynamicClasses vector.

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

13 years agoBe a bit more defensive about setting the temporary base location
Douglas Gregor [Tue, 25 Jan 2011 17:51:48 +0000 (17:51 +0000)]
Be a bit more defensive about setting the temporary base location
during template instantiation. This code needs to eventually die, but
this little tweak fixes PR8629, where bad location information slipped
through to the location of a class template instantiation.

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

13 years agoImplement the rvalue-reference deduction transformation (from T&& ->
Douglas Gregor [Tue, 25 Jan 2011 17:19:08 +0000 (17:19 +0000)]
Implement the rvalue-reference deduction transformation (from T&& ->
T) when taking the address of an overloaded function or matching a
specialization to a template (C++0x [temp.deduct.type]p10). Fixes
PR9044.

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

13 years agoWhen performing a glvalue-to-xvalue static_cast that involves a
Douglas Gregor [Tue, 25 Jan 2011 16:13:26 +0000 (16:13 +0000)]
When performing a glvalue-to-xvalue static_cast that involves a
derived-to-base conversion, set the cast kind and base path
appropriately.

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

13 years agoDocument the ns_returns_retained, ns_consumed, etc. attributes.
John McCall [Tue, 25 Jan 2011 04:26:21 +0000 (04:26 +0000)]
Document the ns_returns_retained, ns_consumed, etc. attributes.

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

13 years agoChange the wording of the bad-decl-for-attribute warning and error
John McCall [Tue, 25 Jan 2011 03:51:08 +0000 (03:51 +0000)]
Change the wording of the bad-decl-for-attribute warning and error
to make it clear that we're talking about the declarations and not the types.

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

13 years agoAdd the ns_consumes_self, ns_consumed, cf_consumed, and ns_returns_autoreleased
John McCall [Tue, 25 Jan 2011 03:31:58 +0000 (03:31 +0000)]
Add the ns_consumes_self, ns_consumed, cf_consumed, and ns_returns_autoreleased
attributes for the benefit of the static analyzer.

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

13 years agoDowngrade the error about rvalue references to an extension warning
Douglas Gregor [Tue, 25 Jan 2011 02:17:32 +0000 (02:17 +0000)]
Downgrade the error about rvalue references to an extension warning
and turn on __has_feature(cxx_rvalue_references). The core rvalue
references proposal seems to be fully implemented now, pending lots
more testing.

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

13 years ago[analyzer] Handle the dot syntax for properties in the ExprEngine.
Argyrios Kyrtzidis [Tue, 25 Jan 2011 00:04:03 +0000 (00:04 +0000)]
[analyzer] Handle the dot syntax for properties in the ExprEngine.

We translate property accesses to obj-c messages by simulating "loads" or "stores" to properties
using a pseudo-location SVal kind (ObjCPropRef).

Checkers can now reason about obj-c messages for both explicit message expressions and implicit
messages due to property accesses.

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

13 years ago[analyzer] Introduce ExprEngine::VisitObjCMessage for handling general ObjCMessages...
Argyrios Kyrtzidis [Tue, 25 Jan 2011 00:03:57 +0000 (00:03 +0000)]
[analyzer] Introduce ExprEngine::VisitObjCMessage for handling general ObjCMessages (both message expressions and property access)
and use it in ExprEngine::VisitObjCMessageExpr.

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

13 years ago[analyzer] Introduce ObjCMessage which represents both explicit ObjC message expressi...
Argyrios Kyrtzidis [Tue, 25 Jan 2011 00:03:53 +0000 (00:03 +0000)]
[analyzer] Introduce ObjCMessage which represents both explicit ObjC message expressions and implicit
messages that are sent for handling properties in dot syntax.

Replace all direct uses of ObjCMessageExpr in the checkers and checker interface with ObjCMessage.

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

13 years agoIn a ObjCMessageExpr with the super class as receiver, 'super' is actually a ObjCInte...
Argyrios Kyrtzidis [Tue, 25 Jan 2011 00:03:48 +0000 (00:03 +0000)]
In a ObjCMessageExpr with the super class as receiver, 'super' is actually a ObjCInterfaceType.

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

13 years ago[analyzer] Simplify GetReceiverType function in BasicObjCFoundationChecks.cpp; no...
Argyrios Kyrtzidis [Tue, 25 Jan 2011 00:03:45 +0000 (00:03 +0000)]
[analyzer] Simplify GetReceiverType function in BasicObjCFoundationChecks.cpp; no functionality change.

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

13 years agoRevert r124146 for now. It appears to be failing on a few platforms.
Eric Christopher [Mon, 24 Jan 2011 23:07:03 +0000 (23:07 +0000)]
Revert r124146 for now. It appears to be failing on a few platforms.

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

13 years agopre/post increase/decrease for AltiVec vectors
Anton Yartsev [Mon, 24 Jan 2011 20:55:22 +0000 (20:55 +0000)]
pre/post increase/decrease for AltiVec vectors

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

13 years agoEnhance the diagnostic for referring to a typedef with an elaborated name to be
Nick Lewycky [Mon, 24 Jan 2011 19:01:04 +0000 (19:01 +0000)]
Enhance the diagnostic for referring to a typedef with an elaborated name to be
as useful in a templated context as it is without templates. Fixes PR8755!

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

13 years agoDisallow function template partial specializations, from Hans
Douglas Gregor [Mon, 24 Jan 2011 18:54:39 +0000 (18:54 +0000)]
Disallow function template partial specializations, from Hans
Wennborg! Fixes PR8295.

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

13 years agoEliminate the use of getTypeForDecl from clang_getCursorType() and
Douglas Gregor [Mon, 24 Jan 2011 18:44:28 +0000 (18:44 +0000)]
Eliminate the use of getTypeForDecl from clang_getCursorType() and
clang_getDeclObjCTypeEncoding(); use ASTContext's methods instead,
which will (lazily) create the type as needed. Otherwise, we can end
up with null QualTypes.

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

13 years agoNote the need for --param=build_config=whatever in the Hacking Clang document, from...
Douglas Gregor [Mon, 24 Jan 2011 18:04:58 +0000 (18:04 +0000)]
Note the need for --param=build_config=whatever in the Hacking Clang document, from Yuri Gribov

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

13 years agoImprove the printing of C++ construction expressions, from Yuri Gribov!
Douglas Gregor [Mon, 24 Jan 2011 17:25:03 +0000 (17:25 +0000)]
Improve the printing of C++ construction expressions, from Yuri Gribov!

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

13 years agoUse attributes for all the override control specifiers.
Anders Carlsson [Mon, 24 Jan 2011 16:26:15 +0000 (16:26 +0000)]
Use attributes for all the override control specifiers.

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

13 years agoRe-instate r123977/r123978, my updates of the reference-binding
Douglas Gregor [Mon, 24 Jan 2011 16:14:37 +0000 (16:14 +0000)]
Re-instate r123977/r123978, my updates of the reference-binding
implementation used by overload resolution to support rvalue
references. The original commits caused PR9026 and some
hard-to-reproduce self-host breakage.

The only (crucial!) difference between this commit and the previous
commits is that we now properly check the SuppressUserConversions flag
before attempting to perform a second user-defined conversion in
reference binding, breaking the infinite recursion chain of
user-defined conversions.

Rvalue references should be working a bit better now.

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

13 years agoCheck whether DependentScopeDeclRefExpr's NestedNameSpecifier exists before accessing...
Axel Naumann [Mon, 24 Jan 2011 15:44:00 +0000 (15:44 +0000)]
Check whether DependentScopeDeclRefExpr's NestedNameSpecifier exists before accessing it, both for consistency (see StmtPrinter::VisitDeclRefExpr()) and for other use cases of dependent types.

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

13 years agoEliminate the last reference to concepts, from Jean-Daniel Dupas
Douglas Gregor [Mon, 24 Jan 2011 15:22:41 +0000 (15:22 +0000)]
Eliminate the last reference to concepts, from Jean-Daniel Dupas

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

13 years agoFix the __has_attribute example; we don't have an override attribute anymore.
Anders Carlsson [Mon, 24 Jan 2011 03:54:51 +0000 (03:54 +0000)]
Fix the __has_attribute example; we don't have an override attribute anymore.

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

13 years agofix some typos, patch by Jonathan Wakely!
Chris Lattner [Mon, 24 Jan 2011 03:47:59 +0000 (03:47 +0000)]
fix some typos, patch by Jonathan Wakely!

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

13 years agofix a broken example, PR9005, patch by Jonathan Wakely!
Chris Lattner [Mon, 24 Jan 2011 03:47:34 +0000 (03:47 +0000)]
fix a broken example, PR9005, patch by Jonathan Wakely!

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

13 years agoremove some crazy leftover thing.
Chris Lattner [Mon, 24 Jan 2011 02:53:58 +0000 (02:53 +0000)]
remove some crazy leftover thing.

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

13 years agoWhen building a type info struct for EH, we always want it to have linkonce_odr linkage.
Anders Carlsson [Mon, 24 Jan 2011 02:12:11 +0000 (02:12 +0000)]
When building a type info struct for EH, we always want it to have linkonce_odr linkage.

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

13 years agoChange CodeGenModule::getVTableLinkage to be a non-static member function.
Anders Carlsson [Mon, 24 Jan 2011 02:04:33 +0000 (02:04 +0000)]
Change CodeGenModule::getVTableLinkage to be a non-static member function.

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

13 years ago"Name" a bool parameter.
Anders Carlsson [Mon, 24 Jan 2011 01:59:49 +0000 (01:59 +0000)]
"Name" a bool parameter.

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

13 years agoUse CharUnits for the offset amount of RegionRawOffset.
Ken Dyck [Mon, 24 Jan 2011 01:55:39 +0000 (01:55 +0000)]
Use CharUnits for the offset amount of RegionRawOffset.

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

13 years agoRemove private toCharUnits() helper method, replacing with calls to
Ken Dyck [Mon, 24 Jan 2011 01:28:50 +0000 (01:28 +0000)]
Remove private toCharUnits() helper method, replacing with calls to
ASTContext::toCharUnitsFromBits().

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

13 years agoMark VTables and RTTI data linkonce_odr instead of weak_odr, with the exception of...
Anders Carlsson [Mon, 24 Jan 2011 00:46:19 +0000 (00:46 +0000)]
Mark VTables and RTTI data linkonce_odr instead of weak_odr, with the exception of explicit template instantiations, which have to be weak_odr.

This fixes PR6996.

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

13 years agoGet rid of [[hiding]], [[override]] and [[base_check]].
Anders Carlsson [Sun, 23 Jan 2011 21:33:18 +0000 (21:33 +0000)]
Get rid of [[hiding]], [[override]] and [[base_check]].

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

13 years agoGet rid of the [[final]] C++0x attribute.
Anders Carlsson [Sun, 23 Jan 2011 21:07:30 +0000 (21:07 +0000)]
Get rid of the [[final]] C++0x attribute.

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

13 years agoAdd support for the --noexecstack option. Fixes PR8762.
Rafael Espindola [Sun, 23 Jan 2011 17:58:26 +0000 (17:58 +0000)]
Add support for the --noexecstack option. Fixes PR8762.

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

13 years agoTeach -Wuninitialized-experimental about sizeof().
Ted Kremenek [Sun, 23 Jan 2011 17:53:04 +0000 (17:53 +0000)]
Teach -Wuninitialized-experimental about sizeof().

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

13 years agoTweak diagnostic:
Ted Kremenek [Sun, 23 Jan 2011 17:21:34 +0000 (17:21 +0000)]
Tweak diagnostic:

  error: no super class declared in @interface for 'XXX'

to be:

  error: 'X' cannot use 'super' because it is a root class

The latter explains what the user actually did wrong.

Fixes: <rdar://problem/8904409>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124074 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoNull initialize a few variables flagged by
Ted Kremenek [Sun, 23 Jan 2011 17:04:59 +0000 (17:04 +0000)]
Null initialize a few variables flagged by
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.

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

13 years agoAccept the C++0x override control keywords as an extension in C++98. This is OK since...
Anders Carlsson [Sat, 22 Jan 2011 23:01:49 +0000 (23:01 +0000)]
Accept the C++0x override control keywords as an extension in C++98. This is OK since the new syntax is unambiguous and can't be confused with C++98 syntax. If anyone disagrees, please shout!

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

13 years agoImplement [class.derived]p8.
Anders Carlsson [Sat, 22 Jan 2011 22:23:37 +0000 (22:23 +0000)]
Implement [class.derived]p8.

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

13 years agoSerialize and deserialize IsMarkedFinal/IsMarkedExplicit.
Anders Carlsson [Sat, 22 Jan 2011 18:11:02 +0000 (18:11 +0000)]
Serialize and deserialize IsMarkedFinal/IsMarkedExplicit.

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

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