]> granicus.if.org Git - clang/log
clang
13 years agoAllow Microsoft attributes in a constructor's parameter list.
Francois Pichet [Mon, 31 Jan 2011 04:54:32 +0000 (04:54 +0000)]
Allow Microsoft attributes in a constructor's parameter list.
This fixes a few compile errors when parsing <regex> from MSVC 2008 with clang.

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

13 years agoWhen building with optimizations, emit vtables where the key is not in the
Anders Carlsson [Sun, 30 Jan 2011 20:45:54 +0000 (20:45 +0000)]
When building with optimizations, emit vtables where the key is not in the
current translation unit as available_externally.

This helps devirtualize the second example in PR3100, comment 18:

struct S { S() {}; virtual void xyzzy(); };
inline void foo(S *s) { s->xyzzy(); }
void bar() { S s; foo(&s); }

This involved four major changes:

1. In DefineUsedVTables, always mark virtual member functions as referenced for
   non-template classes and class template specializations.
2. In CodeGenVTables::ShouldEmitVTableInThisTU return true if optimizations are
   enabled, even if the key function is not implemented in this translation
   unit. We don't ever do this for code compiled with -fapple-kext, because we
   don't ever want to devirtualize virtual member function calls in that case.
3. Give the correct linkage for vtables where the key function is not defined.
4. Update the linkage for RTTI structures when necessary.

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

13 years agoAdd hardcoded -L/usr/lib after all -L options to the FreeBSD linker
Roman Divacky [Sun, 30 Jan 2011 08:12:24 +0000 (08:12 +0000)]
Add hardcoded -L/usr/lib after all -L options to the FreeBSD linker
invocation.

This mimics what gcc does and fixes libtool check for libraries.

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

13 years agoFix test.
Anders Carlsson [Sat, 29 Jan 2011 22:39:23 +0000 (22:39 +0000)]
Fix test.

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

13 years agoRemove dead code.
Anders Carlsson [Sat, 29 Jan 2011 22:15:18 +0000 (22:15 +0000)]
Remove dead code.

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

13 years agoWhen emitting RTTI for a non-class type, compute the visibility of the RTTI data...
Anders Carlsson [Sat, 29 Jan 2011 22:10:32 +0000 (22:10 +0000)]
When emitting RTTI for a non-class type, compute the visibility of the RTTI data based on the explicit visibility of the type.

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

13 years agoSupport for -plugin-arg- with -add-plugin
Nico Weber [Sat, 29 Jan 2011 21:21:49 +0000 (21:21 +0000)]
Support for -plugin-arg- with -add-plugin

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

13 years agoMove GetLLVMVisibility to CodeGenModule.
Anders Carlsson [Sat, 29 Jan 2011 20:59:35 +0000 (20:59 +0000)]
Move GetLLVMVisibility to CodeGenModule.

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

13 years agoUpdate tests.
Anders Carlsson [Sat, 29 Jan 2011 20:57:16 +0000 (20:57 +0000)]
Update tests.

I'm still not sure if having the typenames be visible with -hidden-weak-vtables, but I think it makes sense.

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

13 years agoAdd RTTIBuilder::GetAddrOfTypeName which uses the newly added CreateOrReplaceCXXRunti...
Anders Carlsson [Sat, 29 Jan 2011 20:36:11 +0000 (20:36 +0000)]
Add RTTIBuilder::GetAddrOfTypeName which uses the newly added CreateOrReplaceCXXRuntimeVariable.

Set the visibility for typeinfo names.

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

13 years agoChange CodeGenModule::setTypeVisibility to take a TypeVisibilityKind enum instead...
Anders Carlsson [Sat, 29 Jan 2011 20:24:48 +0000 (20:24 +0000)]
Change CodeGenModule::setTypeVisibility to take a TypeVisibilityKind enum instead of an "IsForRTTI" flag.

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

13 years agoAdd a test for RTTI visibility.
Anders Carlsson [Sat, 29 Jan 2011 19:52:22 +0000 (19:52 +0000)]
Add a test for RTTI visibility.

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

13 years agoReplace an isa/cast with a dyn_cast.
Anders Carlsson [Sat, 29 Jan 2011 19:41:00 +0000 (19:41 +0000)]
Replace an isa/cast with a dyn_cast.

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

13 years agoGet rid of an unneeded parameter from setGlobalVisibility.
Anders Carlsson [Sat, 29 Jan 2011 19:39:23 +0000 (19:39 +0000)]
Get rid of an unneeded parameter from setGlobalVisibility.

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

13 years agoGive VTTs the right visibility.
Anders Carlsson [Sat, 29 Jan 2011 19:34:19 +0000 (19:34 +0000)]
Give VTTs the right visibility.

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

13 years agoMake emitting a VTT a two-step process, much like emitting a VTable. You first get...
Anders Carlsson [Sat, 29 Jan 2011 19:16:51 +0000 (19:16 +0000)]
Make emitting a VTT a two-step process, much like emitting a VTable. You first get the address of the VTT, and then pass it to EmitVTTDefinition.

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

13 years agoUse CGM.CreateOrReplaceCXXRuntimeVariable in CGVTables.cpp
Anders Carlsson [Sat, 29 Jan 2011 18:25:07 +0000 (18:25 +0000)]
Use CGM.CreateOrReplaceCXXRuntimeVariable in CGVTables.cpp

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

13 years agoAdd a new function, to be used by CGRTTI, CGVTables and CGVTT (which each has their...
Anders Carlsson [Sat, 29 Jan 2011 18:20:20 +0000 (18:20 +0000)]
Add a new function, to be used by CGRTTI, CGVTables and CGVTT (which each has their own copy of this code).

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

13 years agoReplace a literal '8' with getCharWidth().
Ken Dyck [Sat, 29 Jan 2011 17:53:12 +0000 (17:53 +0000)]
Replace a literal '8' with getCharWidth().

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

13 years agoRemove IsDefinition from CodeGenModule::setTypeVisibility; it is always true.
Anders Carlsson [Sat, 29 Jan 2011 05:26:32 +0000 (05:26 +0000)]
Remove IsDefinition from CodeGenModule::setTypeVisibility; it is always true.

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

13 years agoWhen trying to get the most derived class, don't assume that we can ignore all casts...
Anders Carlsson [Sat, 29 Jan 2011 05:04:11 +0000 (05:04 +0000)]
When trying to get the most derived class, don't assume that we can ignore all casts. We can only ignore derived-to-base and no-op casts. Fixes selfhost.

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

13 years agoWhen calling a virtual member function on a base class and the most derived class...
Anders Carlsson [Sat, 29 Jan 2011 03:52:01 +0000 (03:52 +0000)]
When calling a virtual member function on a base class and the most derived class is marked 'final', we can devirtualize the call.

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

13 years agoWhen doing a derived-to-base class through a virtual class, we don't have to get...
Anders Carlsson [Sat, 29 Jan 2011 03:18:56 +0000 (03:18 +0000)]
When doing a derived-to-base class through a virtual class, we don't have to get the vbase offset from the vtable if the derived class is marked final.

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

13 years agoMore work to support -fapple-kext regarding
Fariborz Jahanian [Fri, 28 Jan 2011 23:42:29 +0000 (23:42 +0000)]
More work to support -fapple-kext regarding
indirect vf calls and addition of extra entry
at bottom of vtbls.

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

13 years agoDocument how to add an attribute to clang. This should be reviewed by someone
Jeffrey Yasskin [Fri, 28 Jan 2011 23:41:54 +0000 (23:41 +0000)]
Document how to add an attribute to clang.  This should be reviewed by someone
who actually knows how it works.

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

13 years agoFix some corner cases in the __is_base_of logic.
John McCall [Fri, 28 Jan 2011 22:02:36 +0000 (22:02 +0000)]
Fix some corner cases in the __is_base_of logic.

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

13 years agoAdd my new file to the CMake lists, sorry about that.
John McCall [Fri, 28 Jan 2011 20:10:46 +0000 (20:10 +0000)]
Add my new file to the CMake lists, sorry about that.

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

13 years agoMake the FreeBSD driver test more robust so it doesn't fail when there's a single...
Benjamin Kramer [Fri, 28 Jan 2011 18:28:30 +0000 (18:28 +0000)]
Make the FreeBSD driver test more robust so it doesn't fail when there's a single lib32 path.

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

13 years agoMove all the cleanups framework code into a single file.
John McCall [Fri, 28 Jan 2011 11:13:47 +0000 (11:13 +0000)]
Move all the cleanups framework code into a single file.
Pure motion.

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

13 years agoReorganize the value-dominance metaprogram and introduce a specialization
John McCall [Fri, 28 Jan 2011 10:53:53 +0000 (10:53 +0000)]
Reorganize the value-dominance metaprogram and introduce a specialization
for CodeGen's RValue type.

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

13 years agoConvert the exception-freeing cleanup over to the conditional cleanups code,
John McCall [Fri, 28 Jan 2011 08:37:24 +0000 (08:37 +0000)]
Convert the exception-freeing cleanup over to the conditional cleanups code,
fixing a crash which probably nobody was ever going to see.  In doing so,
fix a horrendous number of problems with the conditional-cleanups code.
Also, make conditional cleanups re-use the cleanup's activation variable,
which avoids some unfortunate repetitiveness.

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

13 years agoPR9037: Allow override, final, and new as an extension on inline members.
Nico Weber [Fri, 28 Jan 2011 06:07:34 +0000 (06:07 +0000)]
PR9037: Allow override, final, and new as an extension on inline members.

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

13 years agoNot really any point to testing control flow in this test without
John McCall [Fri, 28 Jan 2011 06:05:16 +0000 (06:05 +0000)]
Not really any point to testing control flow in this test without
ret duplication.

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

13 years agoUpdate exceptions.m for r124462.
Eric Christopher [Fri, 28 Jan 2011 05:13:18 +0000 (05:13 +0000)]
Update exceptions.m for r124462.

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

13 years agoGive OpaqueValueExpr a source location, because its source location
Douglas Gregor [Fri, 28 Jan 2011 02:26:04 +0000 (02:26 +0000)]
Give OpaqueValueExpr a source location, because its source location
might be queried in places where we absolutely require a valid
location (e.g., for template instantiation). Fixes some major
brokenness in the use of __is_convertible_to.

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

13 years agoAllow elision of invocations of move constructors from temporary objects.
Douglas Gregor [Thu, 27 Jan 2011 23:24:55 +0000 (23:24 +0000)]
Allow elision of invocations of move constructors from temporary objects.

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

13 years agoWhen producing IR for a lvalue-to-rvalue cast *as an lvalue*, only
Douglas Gregor [Thu, 27 Jan 2011 23:22:05 +0000 (23:22 +0000)]
When producing IR for a lvalue-to-rvalue cast *as an lvalue*, only
non-class prvalues actually require the realization of a
temporary. For everything else, we already have an lvalue (or class
prvalue) in the subexpression.

Note: we're missing some move elision in this case. I'll tackle that next.

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

13 years agoFix an objective-c rewriter bug rewriting a __block
Fariborz Jahanian [Thu, 27 Jan 2011 23:18:15 +0000 (23:18 +0000)]
Fix an objective-c rewriter bug rewriting a __block
variable declaration of a struct declared type.
// rdar://8918702

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

13 years agoTeach the evaluation of the __is_convertible_to trait to translate
Douglas Gregor [Thu, 27 Jan 2011 22:31:44 +0000 (22:31 +0000)]
Teach the evaluation of the __is_convertible_to trait to translate
access control errors into SFINAE errors, so that the trait provides
enough support to implement the C++0x std::is_convertible type trait.

To get there, the SFINAETrap now knows how to set up a SFINAE context
independent of any template instantiations or template argument
deduction steps, and (separately) can set a Sema flag to translate
access control errors into SFINAE errors. The latter can also be
useful if we decide that access control errors during template argument
deduction should cause substitution failure (rather than a hard error)
as has been proposed for C++0x.

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

13 years agoAdjust casing of attributes in examples.
Ted Kremenek [Thu, 27 Jan 2011 22:00:02 +0000 (22:00 +0000)]
Adjust casing of attributes in examples.

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

13 years agoSeparate the access-control diagnostics from other diagnostics that do not have SFINA...
Douglas Gregor [Thu, 27 Jan 2011 21:06:28 +0000 (21:06 +0000)]
Separate the access-control diagnostics from other diagnostics that do not have SFINAE behavior.

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

13 years agoDocument some serious badness in our evaluation of the type traits: we need to be...
Douglas Gregor [Thu, 27 Jan 2011 20:35:44 +0000 (20:35 +0000)]
Document some serious badness in our evaluation of the type traits: we need to be sure we have complete types in many cases

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

13 years agoImplement the Microsoft __is_convertible_to type trait, modeling the
Douglas Gregor [Thu, 27 Jan 2011 20:28:01 +0000 (20:28 +0000)]
Implement the Microsoft __is_convertible_to type trait, modeling the
semantics after the C++0x is_convertible type trait. This
implementation is not 100% complete, because it allows access errors
to be hard errors (rather than just evaluating false).

Original patch by Steven Watanabe!

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

13 years agoFixed parameter names.
Abramo Bagnara [Thu, 27 Jan 2011 19:55:10 +0000 (19:55 +0000)]
Fixed parameter names.

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

13 years agoFix download link.
Ted Kremenek [Thu, 27 Jan 2011 19:49:07 +0000 (19:49 +0000)]
Fix download link.

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

13 years agoAdd missing </a>
Ted Kremenek [Thu, 27 Jan 2011 19:42:34 +0000 (19:42 +0000)]
Add missing </a>

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

13 years agoUpdate checker build and post release notes.
Ted Kremenek [Thu, 27 Jan 2011 19:41:08 +0000 (19:41 +0000)]
Update checker build and post release notes.

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

13 years agoRevert r124217 because it didn't catch the actual error case it was trying to
Jeffrey Yasskin [Thu, 27 Jan 2011 19:17:54 +0000 (19:17 +0000)]
Revert r124217 because it didn't catch the actual error case it was trying to
catch:

  lock_guard(my_mutex);

declares a variable instead of creating a temporary.

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

13 years agoTeach -Wuninitialized about indirect goto. Fixes PR 9071.
Ted Kremenek [Thu, 27 Jan 2011 18:51:39 +0000 (18:51 +0000)]
Teach -Wuninitialized about indirect goto.  Fixes PR 9071.

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

13 years agoClean up the diagnostic text for delegating constructors
Douglas Gregor [Thu, 27 Jan 2011 18:50:39 +0000 (18:50 +0000)]
Clean up the diagnostic text for delegating constructors

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

13 years agoWire up attributes 'ns_consumed' and 'cf_consumed' in the static analyzer's ObjC...
Ted Kremenek [Thu, 27 Jan 2011 18:43:03 +0000 (18:43 +0000)]
Wire up attributes 'ns_consumed' and 'cf_consumed' in the static analyzer's ObjC retain/release checker.

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

13 years agoTest for previous commit
Douglas Gregor [Thu, 27 Jan 2011 18:39:26 +0000 (18:39 +0000)]
Test for previous commit

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

13 years agoAllow #pragma unused to be used on global variables like gcc. Fixes rdar://8793832.
Argyrios Kyrtzidis [Thu, 27 Jan 2011 18:16:48 +0000 (18:16 +0000)]
Allow #pragma unused to be used on global variables like gcc. Fixes rdar://8793832.

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

13 years agoTeach ASTUnit to save the specified target features, since
Douglas Gregor [Thu, 27 Jan 2011 18:02:58 +0000 (18:02 +0000)]
Teach ASTUnit to save the specified target features, since
TargetInfo::CreateTargetInfo() mangles the target options in a way
that is not idempotent. Fixes <rdar://problem/8807535>.

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

13 years agoAdd libclang functions to determine the const/volatile/restrict
Douglas Gregor [Thu, 27 Jan 2011 16:27:11 +0000 (16:27 +0000)]
Add libclang functions to determine the const/volatile/restrict
qualifiers on a CXType. Patch from Stefan Seefeld, test by me.

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

13 years ago[analyzer] Fix crash when handling dot syntax on 'super'.
Argyrios Kyrtzidis [Thu, 27 Jan 2011 16:17:11 +0000 (16:17 +0000)]
[analyzer] Fix crash when handling dot syntax on 'super'.

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

13 years agoTextDiagnosticPrinter.cpp: Show diagnostics as far as possible even with invalid...
Axel Naumann [Thu, 27 Jan 2011 10:55:51 +0000 (10:55 +0000)]
TextDiagnosticPrinter.cpp: Show diagnostics as far as possible even with invalid PresomedLoc, instead of just silencing it.

FileManager.cpp: Allow virtual files in nonexistent directories.
FileManager.cpp: Close FileDescriptor for virtual files that correspond to actual files.
FileManager.cpp: Enable virtual files to be created even for files that were flagged as NON_EXISTENT_FILE, e.g. by a prior (unsuccessful) addFile().

ASTReader.cpp: Read a PCH even if the original source files cannot be found.

Add a test for reading a PCH of a file that has been removed and diagnostics referencing that file.

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

13 years agoDo a proper recursive lookup when deciding whether a class's usual
John McCall [Thu, 27 Jan 2011 09:37:56 +0000 (09:37 +0000)]
Do a proper recursive lookup when deciding whether a class's usual
deallocation function has a two-argument form.  Store the result of this
check in new[] and delete[] nodes.

Fixes rdar://problem/8913519

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

13 years agoProvide Type::castAs<>, which is to getAs<> what cast<> is to dyn_cast<>.
John McCall [Thu, 27 Jan 2011 08:17:49 +0000 (08:17 +0000)]
Provide Type::castAs<>, which is to getAs<> what cast<> is to dyn_cast<>.
Also provide a method to grab the base element type of a type without
stressing out over qualifiers (but give it a nice scary name).

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

13 years agoFix whitespace.
NAKAMURA Takumi [Thu, 27 Jan 2011 07:10:08 +0000 (07:10 +0000)]
Fix whitespace.

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

13 years ago7bit-ize.
NAKAMURA Takumi [Thu, 27 Jan 2011 07:09:49 +0000 (07:09 +0000)]
7bit-ize.

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

13 years agoFix HTML highlighting and add missing line.
Ted Kremenek [Thu, 27 Jan 2011 07:02:03 +0000 (07:02 +0000)]
Fix HTML highlighting and add missing line.

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

13 years agoFix a few typos in HTML documentation.
Ted Kremenek [Thu, 27 Jan 2011 06:59:29 +0000 (06:59 +0000)]
Fix a few typos in HTML documentation.

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

13 years agoHook up attribute ns_consumes_self in the ObjC retain/release checker in the static...
Ted Kremenek [Thu, 27 Jan 2011 06:54:14 +0000 (06:54 +0000)]
Hook up attribute ns_consumes_self in the ObjC retain/release checker in the static analyzer.

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

13 years agoTweak -Wuninitialized fixit for '_Bool' types to be initialized to 0, and C++ 'bool...
Ted Kremenek [Thu, 27 Jan 2011 05:18:52 +0000 (05:18 +0000)]
Tweak -Wuninitialized fixit for '_Bool' types to be initialized to 0, and C++ 'bool' types to false.

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

13 years agoTeach -Wuninitialized to suggest "= false" for initializing bool variables.
Ted Kremenek [Thu, 27 Jan 2011 02:57:57 +0000 (02:57 +0000)]
Teach -Wuninitialized to suggest "= false" for initializing bool variables.

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

13 years agoNotes on dynamic array cookies in MSVC.
John McCall [Thu, 27 Jan 2011 02:46:02 +0000 (02:46 +0000)]
Notes on dynamic array cookies in MSVC.
My thanks to chapuni for his help in investigating this.

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

13 years agoImport three interesting bits that apply only to C++ methods.
John McCall [Thu, 27 Jan 2011 02:37:01 +0000 (02:37 +0000)]
Import three interesting bits that apply only to C++ methods.

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

13 years agoTeach -Wuninitialized not to assert when analyzing
Ted Kremenek [Thu, 27 Jan 2011 02:29:34 +0000 (02:29 +0000)]
Teach -Wuninitialized not to assert when analyzing
blocks that reference captured variables.

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

13 years agoTeach -Wuninitialized about ObjC fast enumeration loops.
Ted Kremenek [Thu, 27 Jan 2011 02:01:31 +0000 (02:01 +0000)]
Teach -Wuninitialized about ObjC fast enumeration loops.

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

13 years agoWhen we run into a template parameter that should have a default
Douglas Gregor [Thu, 27 Jan 2011 01:40:17 +0000 (01:40 +0000)]
When we run into a template parameter that should have a default
argument but doesn't (because previous template parameters had default
arguments), clear out all of the default arguments so that we maintain
the invariant that a template parameter has a default argument only if
subsequence template parameters also have default arguments.
Fixes a crash-on-invalid <rdar://problem/8913649>.

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

13 years agoCope with parenthesized function declarators when emitting a
Douglas Gregor [Thu, 27 Jan 2011 01:30:16 +0000 (01:30 +0000)]
Cope with parenthesized function declarators when emitting a
diagnostic about ref-qualifiers where they do not belong.

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

13 years agoFix a horrible bug in our handling of C-style casting, where a C-style
Douglas Gregor [Thu, 27 Jan 2011 00:58:17 +0000 (00:58 +0000)]
Fix a horrible bug in our handling of C-style casting, where a C-style
derived-to-base cast that also casts away constness (one of the cases
for static_cast followed by const_cast) would be treated as a bit-cast
rather than a derived-to-base class, causing miscompiles and
heartburn.

Fixes <rdar://problem/8913298>.

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

13 years agoFixes an IRgen bug where __block variable is
Fariborz Jahanian [Wed, 26 Jan 2011 23:08:27 +0000 (23:08 +0000)]
Fixes an IRgen bug where __block variable is
referenced in the block-literal initializer
of that variable. // rdar://8893785

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

13 years agoUpdate C++0x status web page
Douglas Gregor [Wed, 26 Jan 2011 21:35:14 +0000 (21:35 +0000)]
Update C++0x status web page

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

13 years agomake `make` work in examples/PrintFucntionNames on Mac. I checked that it still works...
Nico Weber [Wed, 26 Jan 2011 21:28:52 +0000 (21:28 +0000)]
make `make` work in examples/PrintFucntionNames on Mac. I checked that it still works on Linux.

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

13 years agoAdd __has_feature(cxx_reference_qualified_functions); update tests and
Douglas Gregor [Wed, 26 Jan 2011 21:25:54 +0000 (21:25 +0000)]
Add __has_feature(cxx_reference_qualified_functions); update tests and
documentation.

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

13 years agoImplement the restriction that a function with a ref-qualifier cannot
Douglas Gregor [Wed, 26 Jan 2011 21:20:37 +0000 (21:20 +0000)]
Implement the restriction that a function with a ref-qualifier cannot
overload a function without a ref-qualifier (C++0x
[over.load]p2). This, apparently, completes the implementation of
rvalue references for *this.

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

13 years agoHandle C-style casts to rvalue reference types that cast away constness.
Douglas Gregor [Wed, 26 Jan 2011 21:04:06 +0000 (21:04 +0000)]
Handle C-style casts to rvalue reference types that cast away constness.

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

13 years agoImprove the extension warning for the use of ref-qualifiers, to
Douglas Gregor [Wed, 26 Jan 2011 20:35:32 +0000 (20:35 +0000)]
Improve the extension warning for the use of ref-qualifiers, to
distinguish them from rvalue references. Using the rvalue-references
warning was weird when the ref-qualifier was '&'.

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

13 years agoWhen mangling a qualified array type, push the qualifiers down to the
John McCall [Wed, 26 Jan 2011 20:05:40 +0000 (20:05 +0000)]
When mangling a qualified array type, push the qualifiers down to the
element type.  Fixes rdar://problem/8913416.

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

13 years agoRvalue references for *this: explicitly keep track of whether a
Douglas Gregor [Wed, 26 Jan 2011 19:41:18 +0000 (19:41 +0000)]
Rvalue references for *this: explicitly keep track of whether a
reference binding is for the implicit object parameter of a member
function with a ref-qualifier. My previous comment, that we didn't
need to track this explicitly, was wrong: we do in fact get
rvalue-references-prefer-rvalues overloading with ref-qualifiers.

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

13 years agoRvalue references for *this: implement the implicit conversion rules
Douglas Gregor [Wed, 26 Jan 2011 19:30:28 +0000 (19:30 +0000)]
Rvalue references for *this: implement the implicit conversion rules
for the implicit object argument to a non-static member function with
a ref-qualifier (C++0x [over.match.funcs]p4).

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

13 years agoUn-nest the meat of this function.
John McCall [Wed, 26 Jan 2011 19:21:13 +0000 (19:21 +0000)]
Un-nest the meat of this function.

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

13 years agoFix some obvious bugs in the conditional-cleanup code and then make the
John McCall [Wed, 26 Jan 2011 19:15:39 +0000 (19:15 +0000)]
Fix some obvious bugs in the conditional-cleanup code and then make the
dtor cleanup use it.

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

13 years agoMove InheritableAttr::isInherited to Attr
Peter Collingbourne [Wed, 26 Jan 2011 18:07:13 +0000 (18:07 +0000)]
Move InheritableAttr::isInherited to Attr

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

13 years agoRemove Attr::isMerged; it is not used any more and redundant with
Peter Collingbourne [Wed, 26 Jan 2011 18:07:07 +0000 (18:07 +0000)]
Remove Attr::isMerged; it is not used any more and redundant with
InheritableAttr

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

13 years agoRvalue references for *this: allow functions to be overloaded based on
Douglas Gregor [Wed, 26 Jan 2011 17:47:49 +0000 (17:47 +0000)]
Rvalue references for *this: allow functions to be overloaded based on
the presence and form of a ref-qualifier. Note that we do *not* yet
implement the restriction in C++0x [over.load]p2 that requires either
all non-static functions with a given parameter-type-list to have a
ref-qualifier or none of them to have a ref-qualifier.

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

13 years agoRvalue references for *this: add name mangling for ref-qualifiers,
Douglas Gregor [Wed, 26 Jan 2011 17:36:28 +0000 (17:36 +0000)]
Rvalue references for *this: add name mangling for ref-qualifiers,
using rules that I just made up this morning. This encoding has now
been proposed to the Itanium C++ ABI group for inclusion, but of
course it's still possible that the mangling will change.

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

13 years agoRvalue references for *this: tentative parsing and template argument deduction.
Douglas Gregor [Wed, 26 Jan 2011 16:50:54 +0000 (16:50 +0000)]
Rvalue references for *this: tentative parsing and template argument deduction.

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

13 years agoReference qualifiers for *this: implement C++0x [expr.mptr.oper]p6,
Douglas Gregor [Wed, 26 Jan 2011 16:40:18 +0000 (16:40 +0000)]
Reference qualifiers for *this: implement C++0x [expr.mptr.oper]p6,
the restrictions on .* and ->* for ref-qualified pointer-to-member
functions.

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

13 years agoClean up the C++0x __has_feature tests. Specifically:
Douglas Gregor [Wed, 26 Jan 2011 15:36:03 +0000 (15:36 +0000)]
Clean up the C++0x __has_feature tests. Specifically:
  - Don't publicize a C++0x feature through __has_feature if we aren't
    in C++0x mode (even if the feature is available only with a
    warning).
  - "auto" is not implemented well enough for its __has_feature to be
    turned on.
  - Fix the test of C++0x __has_feature to actually test what we're
  trying to test. Searching for the substring "foo" when our options
  are "foo" and "no_foo" doesn't work :)

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

13 years agoReinstate r124236 (tweaking the rvalue-reference overload resolution
Douglas Gregor [Wed, 26 Jan 2011 14:52:12 +0000 (14:52 +0000)]
Reinstate r124236 (tweaking the rvalue-reference overload resolution
rules), now that we've actually have a clean build for me to sully.

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

13 years agoRvalue references for *this:
Douglas Gregor [Wed, 26 Jan 2011 05:01:58 +0000 (05:01 +0000)]
Rvalue references for *this:

  - Add ref-qualifiers to the type system; they are part of the
  canonical type. Print & profile ref-qualifiers
  - Translate the ref-qualifier from the Declarator chunk for
    functions to the function type.
  - Diagnose mis-uses of ref-qualifiers w.r.t. static member
  functions, free functions, constructors, destructors, etc.
  - Add serialization and deserialization of ref-qualifiers.

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

13 years agoTeach -Wreturn-type that destructors can appear
Ted Kremenek [Wed, 26 Jan 2011 04:49:52 +0000 (04:49 +0000)]
Teach -Wreturn-type that destructors can appear
after a 'return' in a CFGBlock.  This accidentally
was working before, but the false assumption that
'return' always appeared at the end of the block
was uncovered by a recent change.

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

13 years agoMerge -Wuninitialized-experimental into -Wuninitialized.
Ted Kremenek [Wed, 26 Jan 2011 04:49:48 +0000 (04:49 +0000)]
Merge -Wuninitialized-experimental into -Wuninitialized.

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

13 years agoTweak -Wuninitialized-experimental to not emit
Ted Kremenek [Wed, 26 Jan 2011 04:49:43 +0000 (04:49 +0000)]
Tweak -Wuninitialized-experimental to not emit
a warning for uses of an uninitialized variable
when the use is a void cast, e.g. (void) x.

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

13 years agoBetter framework for conditional cleanups; untested as yet.
John McCall [Wed, 26 Jan 2011 04:00:11 +0000 (04:00 +0000)]
Better framework for conditional cleanups;  untested as yet.
I'm separately committing this because it incidentally changes some
block orderings and minor IR issues, like using a phi instead of
an unnecessary alloca.

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

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