]> granicus.if.org Git - clang/log
clang
13 years agoProvide fix-it for '.' <-> '->' for Objective-C ivar/property access.
Fariborz Jahanian [Tue, 28 Jun 2011 00:00:52 +0000 (00:00 +0000)]
Provide fix-it for '.' <-> '->' for Objective-C ivar/property access.
// rdar://7811841

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

13 years agoARC writeback isn't supposed to apply to local indirect pointers,
John McCall [Mon, 27 Jun 2011 23:59:58 +0000 (23:59 +0000)]
ARC writeback isn't supposed to apply to local indirect pointers,
only to pointers to locals.  But it should work inside blocks, too.

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

13 years agoMerge some calls to FoldingSetNodeID::AddInteger; assuming my measurements aren't...
Eli Friedman [Mon, 27 Jun 2011 23:58:21 +0000 (23:58 +0000)]
Merge some calls to FoldingSetNodeID::AddInteger; assuming my measurements aren't completely off, roughly a 1% speedup on SingleSource/UnitTests/ObjC/trivial-interface.m .

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

13 years agoDon't factor in visibility for templates and template arguments
John McCall [Mon, 27 Jun 2011 23:06:04 +0000 (23:06 +0000)]
Don't factor in visibility for templates and template arguments
for explicit specializations with their own explicit visibility.

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

13 years agoMerge this test into another.
John McCall [Mon, 27 Jun 2011 22:57:05 +0000 (22:57 +0000)]
Merge this test into another.

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

13 years agoCache the result of AttributeList::getKind(); it's relatively expensive to compute...
Eli Friedman [Mon, 27 Jun 2011 21:53:17 +0000 (21:53 +0000)]
Cache the result of AttributeList::getKind(); it's relatively expensive to compute, and we query it frequently enough that it showed up in a profile.

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

13 years agoFix PR10204 in a better way.
John McCall [Mon, 27 Jun 2011 21:24:11 +0000 (21:24 +0000)]
Fix PR10204 in a better way.

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

13 years agoUpdate test for r133934.
John McCall [Mon, 27 Jun 2011 21:23:26 +0000 (21:23 +0000)]
Update test for r133934.

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

13 years agoHandle nonnull attribute with optional argument number on
Fariborz Jahanian [Mon, 27 Jun 2011 21:12:03 +0000 (21:12 +0000)]
Handle nonnull attribute with optional argument number on
functions with arguments of transparent unions type.
// rdar://9584012

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

13 years ago[analyzer] Use UnknownVal when default-initializing arrays whose element types we...
Jordy Rose [Mon, 27 Jun 2011 20:36:38 +0000 (20:36 +0000)]
[analyzer] Use UnknownVal when default-initializing arrays whose element types we don't model, to distinguish them from uninitialized arrays (PR10163).

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

13 years agoMinor grammatical fix for error message. Radar 9681093.
Bob Wilson [Mon, 27 Jun 2011 20:25:49 +0000 (20:25 +0000)]
Minor grammatical fix for error message.  Radar 9681093.

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

13 years agoRevert parts of r133860 to fix a crash. Add a test.
Nico Weber [Mon, 27 Jun 2011 19:46:54 +0000 (19:46 +0000)]
Revert parts of r133860 to fix a crash. Add a test.

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

13 years ago[libclang] Avoid having the cursor of an expression replace the declaration cursor
Argyrios Kyrtzidis [Mon, 27 Jun 2011 19:42:23 +0000 (19:42 +0000)]
[libclang] Avoid having the cursor of an expression replace the declaration cursor
when the expression source range overlaps the declaration range.

This can happen for C++ constructor expressions whose range generally
include the variable declaration, e.g.:

  MyCXXClass foo; // Make sure pointing at 'foo' returns a VarDecl cursor.

rdar://9124499.

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

13 years ago[libclang] Avoid having the cursor of an expression "overwrite" the annotation of the
Argyrios Kyrtzidis [Mon, 27 Jun 2011 19:42:20 +0000 (19:42 +0000)]
[libclang] Avoid having the cursor of an expression "overwrite" the annotation of the
variable declaration that it belongs to.

This can happen for C++ constructor expressions whose range generally
include the variable declaration, e.g.:

  MyCXXClass foo; // Make sure we don't annotate 'foo' as a CallExpr cursor.

rdar://9124499.

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

13 years agolibprofile_rt may be installed as a dylib on Darwin.
Bill Wendling [Mon, 27 Jun 2011 19:15:03 +0000 (19:15 +0000)]
libprofile_rt may be installed as a dylib on Darwin.

If we cannot find the static library, use the dylib instead.

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

13 years agoReduce the size of the ExtInfo bitfield in FunctionType from 9 bits
Douglas Gregor [Mon, 27 Jun 2011 18:45:19 +0000 (18:45 +0000)]
Reduce the size of the ExtInfo bitfield in FunctionType from 9 bits
down to 8 by restricting the maximum allowed regparm value to 6
(previously it was 7). I need the extra bit in Type to handle
instantiation-dependence.

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

13 years agoWhen instantiating a C++ "new" expression, don't fake source locations
Douglas Gregor [Mon, 27 Jun 2011 16:55:54 +0000 (16:55 +0000)]
When instantiating a C++ "new" expression, don't fake source locations
for the '(' and ')' around the initializer unless we actually have an
initializer. Fixes PR10197, an issue where we were value-initializing
rather than default-initializing.

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

13 years agoCleanup a fixme by using a specific diagnostic for subscripting
Chandler Carruth [Mon, 27 Jun 2011 16:32:27 +0000 (16:32 +0000)]
Cleanup a fixme by using a specific diagnostic for subscripting
a pointer to void.

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

13 years agoImprove header search for MinGW(-w64), from Ruben Van Boxem!
Douglas Gregor [Mon, 27 Jun 2011 15:47:15 +0000 (15:47 +0000)]
Improve header search for MinGW(-w64), from Ruben Van Boxem!

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

13 years agoFix missing braces around two statements that were intended to be part
Chandler Carruth [Mon, 27 Jun 2011 08:31:58 +0000 (08:31 +0000)]
Fix missing braces around two statements that were intended to be part
of a single if block. This is really annoying to track down and test.
Silly changes to the test case caused it to stop showing up. I wish
there were a more concrete way of asserting that a note attaches to the
intended diagnostic.

This fixes PR10195.

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

13 years agoFactor out (some of) the checking for invalid forms of pointer
Chandler Carruth [Mon, 27 Jun 2011 08:02:19 +0000 (08:02 +0000)]
Factor out (some of) the checking for invalid forms of pointer
arithmetic into a couple of common routines. Use these to make the
messages more consistent in the various contexts, especially in terms of
consistently diagnosing binary operators with invalid types on both the
left- and right-hand side. Also, improve the grammar and wording of the
messages some, handling both two pointers and two (different) types.

The wording of function pointer arithmetic diagnostics still strikes me
as poorly phrased, and I worry this makes them slightly more awkward if
more consistent. I'm hoping to fix that with a follow-on patch and test
case that will also make them more helpful when a typedef or template
type parameter makes the type completely opaque.

Suggestions on better wording are very welcome, thanks to Richard Smith
for some initial help on that front.

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

13 years agoFix PR10187: when diagnosing a two-phase-lookup-related failure, don't assert that...
Richard Smith [Sun, 26 Jun 2011 22:19:54 +0000 (22:19 +0000)]
Fix PR10187: when diagnosing a two-phase-lookup-related failure, don't assert that any names we find are valid candidates for the call.

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

13 years agoCleanup cast IRGen a bit; no intended functionality change.
Eli Friedman [Sat, 25 Jun 2011 02:58:47 +0000 (02:58 +0000)]
Cleanup cast IRGen a bit; no intended functionality change.

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

13 years agoFix a couple more issues related to r133854:
Richard Smith [Sat, 25 Jun 2011 02:28:38 +0000 (02:28 +0000)]
Fix a couple more issues related to r133854:

When performing semantic analysis on a member declaration, fix the check for whether we are declaring a function to check for parenthesized declarators, declaration via decltype, etc.

Also fix the semantic check to not treat FuncType* as a function type.

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

13 years agoDo not apply the ARC move optimization to 'const'-qualified xvalues.
John McCall [Sat, 25 Jun 2011 02:26:44 +0000 (02:26 +0000)]
Do not apply the ARC move optimization to 'const'-qualified xvalues.

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

13 years agoLValue carries a type now, so simplify the main EmitLoad/Store APIs
John McCall [Sat, 25 Jun 2011 02:11:03 +0000 (02:11 +0000)]
LValue carries a type now, so simplify the main EmitLoad/Store APIs
by removing the redundant type parameter.

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

13 years agoMark the multiply which occurs as part of performing pointer
John McCall [Sat, 25 Jun 2011 01:32:37 +0000 (01:32 +0000)]
Mark the multiply which occurs as part of performing pointer
arithmetic on a VLA as 'nsw', per discussion with djg, and
implement pointer arithmetic (other than array accesses) and
pointer subtraction for VLA types.

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

13 years agoWhen deciding how to parse "= something" as part of a member
Douglas Gregor [Sat, 25 Jun 2011 00:56:27 +0000 (00:56 +0000)]
When deciding how to parse "= something" as part of a member
declaration, determine whether the declaration will end up declaring a
function using semantic criteria (e.g., it will have function type)
rather than purely syntactic criteria (e.g., it has the form of a
function declarator). Fixes <rdar://problem/9670557>.

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

13 years agoobjc-arc/mrc: Allow ns_returns_not_retained attribute on properties
Fariborz Jahanian [Sat, 25 Jun 2011 00:17:46 +0000 (00:17 +0000)]
objc-arc/mrc: Allow ns_returns_not_retained attribute on properties
to turn off warning on those properties which follow Cocoa naming
convention for retaining objects and yet they were not meant for
such purposes. Also, perform consistancy checking for declared
getters of such methods. // rdar://9636091

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

13 years agoTwo more test cases which have been long uncommitted.
John McCall [Fri, 24 Jun 2011 23:30:52 +0000 (23:30 +0000)]
Two more test cases which have been long uncommitted.

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

13 years agoTest case for r133840, neglectfully uncommitted.
John McCall [Fri, 24 Jun 2011 23:29:50 +0000 (23:29 +0000)]
Test case for r133840, neglectfully uncommitted.

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

13 years agoHonor objc_precise_lifetime in GC mode by feeding the value
John McCall [Fri, 24 Jun 2011 23:21:27 +0000 (23:21 +0000)]
Honor objc_precise_lifetime in GC mode by feeding the value
in the variable to an inline asm which gets run when the variable
goes out of scope.

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

13 years agoRevert "Shorten some ARM builtin names by removing unnecessary "neon" prefix."
Bob Wilson [Fri, 24 Jun 2011 22:13:26 +0000 (22:13 +0000)]
Revert "Shorten some ARM builtin names by removing unnecessary "neon" prefix."
Sorry, this was a bad idea.  Within clang these builtins are in a separate
"ARM" namespace, but the actual builtin names should clearly distinguish tha
they are target specific.

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

13 years agoFix struct member's scope. Patch by Xi Wang.
Devang Patel [Fri, 24 Jun 2011 22:00:59 +0000 (22:00 +0000)]
Fix struct member's scope. Patch by Xi Wang.

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

13 years agoChange the IR-generation of VLAs so that we capture bounds,
John McCall [Fri, 24 Jun 2011 21:55:10 +0000 (21:55 +0000)]
Change the IR-generation of VLAs so that we capture bounds,
not sizes;  so that we use well-typed allocas;  and so that we
properly recurse through the full set of variably-modified types.

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

13 years agoShorten some ARM builtin names by removing unnecessary "neon" prefix.
Bob Wilson [Fri, 24 Jun 2011 21:32:46 +0000 (21:32 +0000)]
Shorten some ARM builtin names by removing unnecessary "neon" prefix.

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

13 years agoNo need to warn if 'unavailable' method/property
Fariborz Jahanian [Fri, 24 Jun 2011 20:31:37 +0000 (20:31 +0000)]
No need to warn if 'unavailable' method/property
is not implemented. // rdar://9651605

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

13 years agoobjc-arc: Give more descriptive diagnostics when
Fariborz Jahanian [Fri, 24 Jun 2011 20:00:03 +0000 (20:00 +0000)]
objc-arc: Give more descriptive diagnostics when
making unsafe assignment of a retainable
object, Per John's request.

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

13 years agoOnly do delayed diagnostics if there were no errors when parsing the decl.
Argyrios Kyrtzidis [Fri, 24 Jun 2011 19:59:27 +0000 (19:59 +0000)]
Only do delayed diagnostics if there were no errors when parsing the decl.

Fixes crash in http://llvm.org/PR10109 & rdar://9584039.

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

13 years ago[arcmt] Add test for rdar://9601437.
Argyrios Kyrtzidis [Fri, 24 Jun 2011 18:41:23 +0000 (18:41 +0000)]
[arcmt] Add test for rdar://9601437.

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

13 years agoobjc-arc: Check on a variety of unsafe assignment of retained
Fariborz Jahanian [Fri, 24 Jun 2011 18:25:34 +0000 (18:25 +0000)]
objc-arc: Check on a variety of unsafe assignment of retained
objects.  // rdar://9495837

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

13 years agoFix comments.
Bob Wilson [Fri, 24 Jun 2011 18:08:10 +0000 (18:08 +0000)]
Fix comments.

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

13 years agoAllow Lexer::getLocForEndOfToken to return the location just passed the macro instant...
Argyrios Kyrtzidis [Fri, 24 Jun 2011 17:58:59 +0000 (17:58 +0000)]
Allow Lexer::getLocForEndOfToken to return the location just passed the macro instantiation
if the location given points at the last token of the macro instantiation.

Fixes rdar://9045701.

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

13 years agoIn TextDiagnosticPrinter::EmitCaretDiagnostic, don't always drop fixits if the caret...
Argyrios Kyrtzidis [Fri, 24 Jun 2011 17:28:31 +0000 (17:28 +0000)]
In TextDiagnosticPrinter::EmitCaretDiagnostic, don't always drop fixits if the caret location
points to a macro instantiation.

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

13 years agoAllow the fixit for missing ':' in the ?: ternary operator if it is pointing
Argyrios Kyrtzidis [Fri, 24 Jun 2011 17:28:29 +0000 (17:28 +0000)]
Allow the fixit for missing ':' in the ?: ternary operator if it is pointing
at the start of a macro instantiation.

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

13 years agoSourceManager::isAtStartOfMacroInstantiation should check not only if the location
Argyrios Kyrtzidis [Fri, 24 Jun 2011 17:28:26 +0000 (17:28 +0000)]
SourceManager::isAtStartOfMacroInstantiation should check not only if the location
is at the first token but that the location's offset is not inside the token as well.

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

13 years agounittests/Basic/FileManagerTest.cpp: Unbreak Win32, mingw and msvc.
NAKAMURA Takumi [Fri, 24 Jun 2011 14:10:29 +0000 (14:10 +0000)]
unittests/Basic/FileManagerTest.cpp: Unbreak Win32, mingw and msvc.

LLVM_ON_WIN32 is defined in llvm/Config/config.h.
IMO, it might be enough with _WIN32 in most cases, LLVM_ON_xxx could be deprecated.

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

13 years agoFix unused label warning.
Jay Foad [Fri, 24 Jun 2011 09:29:56 +0000 (09:29 +0000)]
Fix unused label warning.

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

13 years agoThis patch started as an attempt to fix up the horrid naming
Sean Hunt [Fri, 24 Jun 2011 02:11:39 +0000 (02:11 +0000)]
This patch started as an attempt to fix up the horrid naming
conventions. I then discovered a typo in the using declaration bit in
LookupSpecialMember. This led to discovering [namespace.udecl]p15, which
clang implements incorrectly. Thus I've added a comment and implemented
the code consistently with the rest of clang - that is incorrectly.

And because I don't want to include tests of something incorrect, I've
ripped the test out.

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

13 years agoRename objc_lifetime -> objc_ownership, and modify diagnostics to talk about 'ownersh...
Argyrios Kyrtzidis [Fri, 24 Jun 2011 00:08:59 +0000 (00:08 +0000)]
Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about 'ownership', not 'lifetime'.

rdar://9477613.

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

13 years agoWhen forming a cycle in objc's inheritance hierarchy,
Fariborz Jahanian [Thu, 23 Jun 2011 23:16:19 +0000 (23:16 +0000)]
When forming a cycle in objc's inheritance hierarchy,
diagnose it properly and don't throw clang into an
infinit loop. // rdar://9653341

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

13 years agoUnbreak the CMake build.
Sean Hunt [Thu, 23 Jun 2011 22:24:13 +0000 (22:24 +0000)]
Unbreak the CMake build.

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

13 years ago[arcmt] Fully migrate ObjC++ classes, rdar://9660007.
Argyrios Kyrtzidis [Thu, 23 Jun 2011 21:21:33 +0000 (21:21 +0000)]
[arcmt] Fully migrate ObjC++ classes, rdar://9660007.

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

13 years ago[arcmt] Remove rewriteAllocCopyWithZone transformation; not needed anymore.
Argyrios Kyrtzidis [Thu, 23 Jun 2011 21:21:28 +0000 (21:21 +0000)]
[arcmt] Remove rewriteAllocCopyWithZone transformation; not needed anymore.

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

13 years agoApparently at some point in the past I forgot how 'continue'
John McCall [Thu, 23 Jun 2011 21:18:31 +0000 (21:18 +0000)]
Apparently at some point in the past I forgot how 'continue'
works in a 'while(false)' loop.  Simplify this code;  it was
complicated only in anticipation of C++0x lambdas, and it can
become complicated again when those happen. :)

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

13 years agoImprove on warning when objc pointer is used in
Fariborz Jahanian [Thu, 23 Jun 2011 21:17:59 +0000 (21:17 +0000)]
Improve on warning when objc pointer is used in
c++ catch in fragile abi - per Eli's request.

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

13 years agoRemove superfluous comment
Douglas Gregor [Thu, 23 Jun 2011 20:49:34 +0000 (20:49 +0000)]
Remove superfluous comment

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

13 years agoMove definition of template <typename T> void Decl::dropAttr
Fariborz Jahanian [Thu, 23 Jun 2011 20:24:38 +0000 (20:24 +0000)]
Move definition of template <typename T> void Decl::dropAttr
to its header to avoid an explicit instantiation.

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

13 years agoBump Token::Kind from an unsigned char to an unsigned short, from Anton Lokhmotov
Douglas Gregor [Thu, 23 Jun 2011 20:15:25 +0000 (20:15 +0000)]
Bump Token::Kind from an unsigned char to an unsigned short, from Anton Lokhmotov

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

13 years agoSupport for catching objc pointer objects in c++ catch-statement
Fariborz Jahanian [Thu, 23 Jun 2011 19:00:08 +0000 (19:00 +0000)]
Support for catching objc pointer objects in c++ catch-statement
in fragile abi mode and some other cleanups. // rdar://8940528

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

13 years agoFix Sema::CheckVectorOperands so that it doesn't try to insert a cast expression...
Eli Friedman [Thu, 23 Jun 2011 18:10:35 +0000 (18:10 +0000)]
Fix Sema::CheckVectorOperands so that it doesn't try to insert a cast expression into the LHS of a compound assignment.  Fixes compound assignment of various "compatible" vector types, including NEON-vector and gcc-vector types.

<rdar://problem/9640356>

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

13 years agoMinor tweak to my last patch per Doug's comment.
Fariborz Jahanian [Thu, 23 Jun 2011 18:04:27 +0000 (18:04 +0000)]
Minor tweak to my last patch per Doug's comment.

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

13 years agocmake+lit: final cleanup related to the recent churn
Andrew Trick [Thu, 23 Jun 2011 18:00:48 +0000 (18:00 +0000)]
cmake+lit: final cleanup related to the recent churn

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

13 years agoRemove multiple use of weak_import attribute on
Fariborz Jahanian [Thu, 23 Jun 2011 17:50:10 +0000 (17:50 +0000)]
Remove multiple use of weak_import attribute on
same declaration. Templatize dropAttr for general use.

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

13 years agoRemove weak_import attribute on new declaration.
Fariborz Jahanian [Thu, 23 Jun 2011 16:18:44 +0000 (16:18 +0000)]
Remove weak_import attribute on new declaration.
// rdar://9538608

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

13 years agofix autoconf build from r133710
Dylan Noblesmith [Thu, 23 Jun 2011 13:50:47 +0000 (13:50 +0000)]
fix autoconf build from r133710

Sorry! This commit worked in CMake, but
CXX_INCLUDE_ROOT is defined in a different
config.h for autoconf.

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

13 years agoavoid using config.h in public headers
Dylan Noblesmith [Thu, 23 Jun 2011 12:20:57 +0000 (12:20 +0000)]
avoid using config.h in public headers

This is the only usage in clang's headers, and it's for a define
that only exists on CMake builds for the sake of the MSVC compiler,
so just use an ifdef instead.

Also add an include for config.h in a file that actually needs it,
and was picking it up by accident indirectly.

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

13 years agoAdd documentation about __has_feature(cxx_delegationg_constructors)
Sean Hunt [Thu, 23 Jun 2011 06:11:37 +0000 (06:11 +0000)]
Add documentation about __has_feature(cxx_delegationg_constructors)

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

13 years agoFix this test on machines that don't run clang -cc1as when asked to assemble.
Nick Lewycky [Thu, 23 Jun 2011 05:38:06 +0000 (05:38 +0000)]
Fix this test on machines that don't run clang -cc1as when asked to assemble.

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

13 years agoFix a minor copy-paste-o that broke the stylesheets
Sean Hunt [Thu, 23 Jun 2011 01:22:53 +0000 (01:22 +0000)]
Fix a minor copy-paste-o that broke the stylesheets

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

13 years agoFix a bunch of HTML compliance problems with LanguageExtensions.html
Sean Hunt [Thu, 23 Jun 2011 01:21:01 +0000 (01:21 +0000)]
Fix a bunch of HTML compliance problems with LanguageExtensions.html

One weird thing is the addition of several <a name=""> tags where
previously there were id attributes on the <h3> tags. This is because
the id attribute must begin with a letter, not an underscore. The name
attribute is not so constrained, so links will continue to work.

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

13 years agoMove all of Sema's member-access-related checking out of SemaExpr.cpp
Douglas Gregor [Thu, 23 Jun 2011 00:49:38 +0000 (00:49 +0000)]
Move all of Sema's member-access-related checking out of SemaExpr.cpp
and into a new file, SemaExprMember.cpp, bringing SemaExpr.cpp just
under 10,000 lines of code (ugh). No functionality change, although I
intend to do some refactoring of this code to address PR8368 at some
point in the "near" future.

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

13 years agoRevert "-fexceptions does not, in fact, enable C++ exceptions"
Sean Hunt [Thu, 23 Jun 2011 00:42:53 +0000 (00:42 +0000)]
Revert "-fexceptions does not, in fact, enable C++ exceptions"

In fact it does. For the driver anyway, and not cc1 which I'm supposed
to pretend doesn't exist.

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

13 years agoAllow unavailable function calls inside unavailable functions in C++/ObjC++ as well...
Argyrios Kyrtzidis [Thu, 23 Jun 2011 00:41:50 +0000 (00:41 +0000)]
Allow unavailable function calls inside unavailable functions in C++/ObjC++ as well. rdar://9660196

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

13 years agoClean up the heart of the caching code and miss fewer edge cases.
Sean Hunt [Thu, 23 Jun 2011 00:26:20 +0000 (00:26 +0000)]
Clean up the heart of the caching code and miss fewer edge cases.

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

13 years ago-fexceptions does not, in fact, enable C++ exceptions
Sean Hunt [Wed, 22 Jun 2011 23:49:12 +0000 (23:49 +0000)]
-fexceptions does not, in fact, enable C++ exceptions

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

13 years agolit support for REQUIRES: asserts.
Andrew Trick [Wed, 22 Jun 2011 23:23:49 +0000 (23:23 +0000)]
lit support for REQUIRES: asserts.

Take #2. Don't piggyback on the existing config.build_mode. Instead,
define a new lit feature for each build feature we need (currently
just "asserts"). Teach both autoconf'd and cmake'd Makefiles to define
this feature within test/lit.site.cfg. This doesn't require any lit
harness changes and should be more robust across build systems.

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

13 years agoCheck for placeholders early on in
Douglas Gregor [Wed, 22 Jun 2011 23:21:00 +0000 (23:21 +0000)]
Check for placeholders early on in
Sema::CreateUnaryExprOrTypeTraitExpr() rather than recursing in some
cases. Fixes <rdar://problem/9659191>.

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

13 years agoFix a think-o that amazingly didn't show up until I started writing
Sean Hunt [Wed, 22 Jun 2011 22:13:13 +0000 (22:13 +0000)]
Fix a think-o that amazingly didn't show up until I started writing
implicit move tests.

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

13 years agoIssue warning if weak_import attribute is added to an already
Fariborz Jahanian [Wed, 22 Jun 2011 22:08:50 +0000 (22:08 +0000)]
Issue warning if weak_import attribute is added to an already
declared variable and ignore it. // rdar://9538608

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

13 years agotest/Unit: Fixup lit.cfg to allow running inside test/Unit (with llvm-config in
Daniel Dunbar [Wed, 22 Jun 2011 21:46:43 +0000 (21:46 +0000)]
test/Unit: Fixup lit.cfg to allow running inside test/Unit (with llvm-config in
path).

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

13 years agoAlloa catching Objective-C id's being thrown with C++ throw
Fariborz Jahanian [Wed, 22 Jun 2011 20:21:51 +0000 (20:21 +0000)]
Alloa catching Objective-C id's being thrown with C++ throw
in Darwin's fragile abi mode.  // rdar://8940528

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

13 years agoChanges ParenListExpr to always require a type.
Manuel Klimek [Wed, 22 Jun 2011 20:02:16 +0000 (20:02 +0000)]
Changes ParenListExpr to always require a type.
Removes dead code found in the process.
Adds a test to verify that ParenListExprs do not have NULL types.

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

13 years agoCopy diagnostic pragmas to the preprocessed output, from Richard Osborne!
Douglas Gregor [Wed, 22 Jun 2011 19:41:48 +0000 (19:41 +0000)]
Copy diagnostic pragmas to the preprocessed output, from Richard Osborne!

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

13 years agoFix the starting location of the Fix-It note for suspicious precedence
Douglas Gregor [Wed, 22 Jun 2011 18:41:08 +0000 (18:41 +0000)]
Fix the starting location of the Fix-It note for suspicious precedence
issues between a bitwise operator and a comparison operator. Fixes
<rdar://problem/9637759>.

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

13 years agoWhen instantiating a function template declaration that was expressed
Douglas Gregor [Wed, 22 Jun 2011 18:16:25 +0000 (18:16 +0000)]
When instantiating a function template declaration that was expressed
via a typedef of a function, make sure to synthesize parameter
declarations. Fixes PR9654 / <rdar://problem/9257497>.

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

13 years ago[arcmt] Make -Warc-unsafe-retained-assign an error when migrating. rdar://8939557
Argyrios Kyrtzidis [Wed, 22 Jun 2011 18:03:59 +0000 (18:03 +0000)]
[arcmt] Make -Warc-unsafe-retained-assign an error when migrating. rdar://8939557

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

13 years agoPut all ARC-related warnings into the "arc" diagnostic group.
Argyrios Kyrtzidis [Wed, 22 Jun 2011 18:03:56 +0000 (18:03 +0000)]
Put all ARC-related warnings into the "arc" diagnostic group.

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

13 years agoChange "cannot assign retained object.." warning to "assigning retained object.."
Argyrios Kyrtzidis [Wed, 22 Jun 2011 18:03:53 +0000 (18:03 +0000)]
Change "cannot assign retained object.." warning to "assigning retained object.."

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

13 years agoBuild and use libcompiler_rt whenever possible.
Eric Christopher [Wed, 22 Jun 2011 17:41:40 +0000 (17:41 +0000)]
Build and use libcompiler_rt whenever possible.

Patch by Jean-Daniel Dupas!

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

13 years agoTry to silence GCC warning
Douglas Gregor [Wed, 22 Jun 2011 16:43:25 +0000 (16:43 +0000)]
Try to silence GCC warning

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

13 years agoobjc-arc: Allow unbridged cast of retainable object to
Fariborz Jahanian [Wed, 22 Jun 2011 16:36:45 +0000 (16:36 +0000)]
objc-arc: Allow unbridged cast of retainable object to
integral as it is not transferring ownership..
// rdar://9619861

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

13 years agoImplement the C++0x move optimization for Automatic Reference Counting
Douglas Gregor [Wed, 22 Jun 2011 16:32:26 +0000 (16:32 +0000)]
Implement the C++0x move optimization for Automatic Reference Counting
objects, so that we steal the retain count of a temporary __strong
pointer (zeroing out that temporary), eliding a retain/release
pair. Addresses <rdar://problem/9364932>.

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

13 years agoWhen binding a reference to an Automatic Reference Counting temporary,
Douglas Gregor [Wed, 22 Jun 2011 16:12:01 +0000 (16:12 +0000)]
When binding a reference to an Automatic Reference Counting temporary,
retain/release the temporary object appropriately. Previously, we
would only perform the retain/release operations when the reference
would extend the lifetime of the temporary, but this does the wrong
thing across calls.

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

13 years agoGive MaterializeTemporaryExpr the exact type of the lvalue it binds
Douglas Gregor [Wed, 22 Jun 2011 15:05:02 +0000 (15:05 +0000)]
Give MaterializeTemporaryExpr the exact type of the lvalue it binds
to, including cv-qualifications.

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

13 years agoFix typo in comment
Douglas Gregor [Wed, 22 Jun 2011 14:41:20 +0000 (14:41 +0000)]
Fix typo in comment

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

13 years agoReplace the existing forms of ConstantArray::get() with a single form
Jay Foad [Wed, 22 Jun 2011 09:24:39 +0000 (09:24 +0000)]
Replace the existing forms of ConstantArray::get() with a single form
that takes an ArrayRef.

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

13 years agoIntroduce DelayedCleanupPool useful for simplifying clean-up of certain resources...
Argyrios Kyrtzidis [Wed, 22 Jun 2011 06:09:49 +0000 (06:09 +0000)]
Introduce DelayedCleanupPool useful for simplifying clean-up of certain resources that, while their
lifetime is well-known and restricted, cleaning them up manually is easy to miss and cause a leak.

Use it to plug the leaking of TemplateIdAnnotation objects. rdar://9634138.

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

13 years agoOnly do config-time substitution of LLVM_BUILD_MODE in
Andrew Trick [Wed, 22 Jun 2011 05:44:01 +0000 (05:44 +0000)]
Only do config-time substitution of LLVM_BUILD_MODE in
test/lit.site.cfg, not Unit/test/lit.site.cfg.

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

13 years agoActually, you know, fix the problem.
Sean Hunt [Wed, 22 Jun 2011 02:58:46 +0000 (02:58 +0000)]
Actually, you know, fix the problem.

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