]> granicus.if.org Git - clang/log
clang
12 years ago[analyzer] Testing: test with all the non-experimental checker packages.
Anna Zaks [Tue, 8 Nov 2011 22:41:25 +0000 (22:41 +0000)]
[analyzer] Testing: test with all the non-experimental checker packages.

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

12 years ago[analyzer] Testing: support for regenerate reference output
Anna Zaks [Tue, 8 Nov 2011 22:41:22 +0000 (22:41 +0000)]
[analyzer] Testing: support for regenerate reference output

Change the flow of the SATestAdd so that it could be used for regenerating
the reference output without exiting with an error.

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

12 years ago[arcmt] Now that readonly properties are strong-by-default, do not add redundant...
Argyrios Kyrtzidis [Tue, 8 Nov 2011 22:10:58 +0000 (22:10 +0000)]
[arcmt] Now that readonly properties are strong-by-default, do not add redundant 'strong'.

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

12 years agoFix comment typos
Douglas Gregor [Tue, 8 Nov 2011 21:07:04 +0000 (21:07 +0000)]
Fix comment typos

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

12 years agoobjc-arc: 'readonly' property of retainable object
Fariborz Jahanian [Tue, 8 Nov 2011 20:58:53 +0000 (20:58 +0000)]
objc-arc: 'readonly' property of retainable object
type is strong by default too. // rdar://10410903

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

12 years agoSort contents of exports file. No functionality change.
Ted Kremenek [Tue, 8 Nov 2011 20:42:13 +0000 (20:42 +0000)]
Sort contents of exports file.  No functionality change.

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

12 years agoserialized diagnostics: serialize the version info in a separate meta block.
Ted Kremenek [Tue, 8 Nov 2011 20:27:29 +0000 (20:27 +0000)]
serialized diagnostics: serialize the version info in a separate meta block.

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

12 years ago[analyzer] Remove redundant check from DivZeroChecker
Anna Zaks [Tue, 8 Nov 2011 19:56:35 +0000 (19:56 +0000)]
[analyzer] Remove redundant check from DivZeroChecker

Analysis by Ted:
"
    if (stateZero && !stateNotZero) {

is checking to see if:

  (A)  "it is possible for the value to be zero"   (stateZero)

    AND

  (B) "it is not possible for the value to be non-zero"  (!stateNotZero)

That said, the only way for both B to be true AND A to be false is if the path is completely infeasible by the time we reach the divide-by-zero check.  For the most part (all cases?), such cases should automatically get pruned out at branches (i.e., an infeasible path gets dropped), which is the case in our tests.  So the question is whether or not such an infeasible path might not get dropped earlier?  I can't envision any right now.

Indeed, the rest of the checker assumes that if the bug condition didn't fire then 'stateNotZero' is non-NULL:

    C.addTransition(stateNotZero);
"

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

12 years ago[analyzer] Testing: Display the number of reported differences in the main log.
Anna Zaks [Tue, 8 Nov 2011 19:56:31 +0000 (19:56 +0000)]
[analyzer] Testing: Display the number of reported differences in the main log.

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

12 years agoThis test isn't portable to non-x86 platforms; specify a triple.
Eli Friedman [Tue, 8 Nov 2011 19:55:32 +0000 (19:55 +0000)]
This test isn't portable to non-x86 platforms; specify a triple.

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

12 years agoMark the overloaded atomic builtins as having custom type checking,
Douglas Gregor [Tue, 8 Nov 2011 19:45:38 +0000 (19:45 +0000)]
Mark the overloaded atomic builtins as having custom type checking,
which they do. This avoids all of the default argument promotions that
we (1) don't want, and (2) undo during that custom type checking, and
makes sure that we don't run into trouble during template
instantiation. Fixes PR11320.

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

12 years agoMisc fixes for clang driver on Mips Linux. Patch by Simon Atanasyan.
Eli Friedman [Tue, 8 Nov 2011 19:43:37 +0000 (19:43 +0000)]
Misc fixes for clang driver on Mips Linux.  Patch by Simon Atanasyan.

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

12 years agoFrom Vassil Vassilev: add checks for removing Decls for more use cases.
Axel Naumann [Tue, 8 Nov 2011 18:21:06 +0000 (18:21 +0000)]
From Vassil Vassilev: add checks for removing Decls for more use cases.

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

12 years agoAdd a default system include of '/include'. This isn't particularly
Chandler Carruth [Tue, 8 Nov 2011 17:19:47 +0000 (17:19 +0000)]
Add a default system include of '/include'. This isn't particularly
useful when using Clang as a system-compiler, but its harmless. When
using Clang as a cross-compiler, this can be very handy as quite a few
toolchains ship their libc headers here rather than under
'/usr/include'.

For reference, this is the beginning of my work to also make the Clang
driver more suitable as a cross-compiler.

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

12 years ago[arcmt] Now that properties are strong by default, avoid adding redundant '(strong)'
Argyrios Kyrtzidis [Tue, 8 Nov 2011 05:56:11 +0000 (05:56 +0000)]
[arcmt] Now that properties are strong by default, avoid adding redundant '(strong)'
property attribute.

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

12 years ago[arcmt] NSViewController does not support weak.
Argyrios Kyrtzidis [Tue, 8 Nov 2011 05:56:08 +0000 (05:56 +0000)]
[arcmt] NSViewController does not support weak.

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

12 years agoCheck pointer types for arguments of Neon load/store macros. rdar://9958031
Bob Wilson [Tue, 8 Nov 2011 05:04:11 +0000 (05:04 +0000)]
Check pointer types for arguments of Neon load/store macros. rdar://9958031

The Neon load/store intrinsics need to be implemented as macros to avoid
hiding alignment attributes on the pointer arguments, and the macros can
only evaluate those pointer arguments once (in case they have side effects),
so it has been hard to get the right type checking for those pointers.
I tried various alternatives in the arm_neon.h header, but it's much more
straightforward to just check directly in Sema.

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

12 years agoMisc fixes to pcmp*stri.
Eli Friedman [Tue, 8 Nov 2011 04:13:51 +0000 (04:13 +0000)]
Misc fixes to pcmp*stri.

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

12 years agoFix the layout of vb-tables and vf-tables in the MS C++ ABI.
John McCall [Tue, 8 Nov 2011 04:01:03 +0000 (04:01 +0000)]
Fix the layout of vb-tables and vf-tables in the MS C++ ABI.
Based on work by Dmitry Sokolov!

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

12 years agolib/CodeGen/CGBuiltin.cpp: Tweak the identifier "Type" to appease msvc.
NAKAMURA Takumi [Tue, 8 Nov 2011 03:27:04 +0000 (03:27 +0000)]
lib/CodeGen/CGBuiltin.cpp: Tweak the identifier "Type" to appease msvc.

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

12 years agoTypePrinter: print OpenCL address space names. Patch by Richard
Peter Collingbourne [Tue, 8 Nov 2011 02:52:58 +0000 (02:52 +0000)]
TypePrinter: print OpenCL address space names.  Patch by Richard
Membarth, test case by myself.

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

12 years agoDeclPrinter: print the declaration's storage class specifier as
Peter Collingbourne [Tue, 8 Nov 2011 02:52:52 +0000 (02:52 +0000)]
DeclPrinter: print the declaration's storage class specifier as
written, instead of the resolved storage class, which might not be
legal to specify on the declaration (such as out-of-line definitions
of static class members in C++, and __local variables in OpenCL).
Initial patch by Richard Membarth.

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

12 years agoSome tests missed from r144056.
Richard Smith [Tue, 8 Nov 2011 02:18:13 +0000 (02:18 +0000)]
Some tests missed from r144056.

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

12 years ago[arcmt] When we already removed a __weak, don't try to change it to __unsafe_unretained
Argyrios Kyrtzidis [Tue, 8 Nov 2011 02:02:38 +0000 (02:02 +0000)]
[arcmt] When we already removed a __weak, don't try to change it to __unsafe_unretained
later on, or we will end up with a redundant '__unsafe_unretained'.

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

12 years agoRevert r143972, which didn't actually compile under -Wnon-virtual-dtor.
Matt Beaumont-Gay [Tue, 8 Nov 2011 01:53:17 +0000 (01:53 +0000)]
Revert r143972, which didn't actually compile under -Wnon-virtual-dtor.

(TIL: -Wnon-virtual-dtor is not in -Wall.)

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

12 years agoFix a cluster of related issues involving value-dependence and constant
Richard Smith [Tue, 8 Nov 2011 01:31:09 +0000 (01:31 +0000)]
Fix a cluster of related issues involving value-dependence and constant
expression evaluation:
 - When folding a non-value-dependent expression, we may try to use the
   initializer of a value-dependent variable. If that happens, give up.
 - In C++98, actually check that a const, non-volatile DeclRefExpr inside an ICE
   is of integral or enumeration type (a reference isn't OK!)
 - In C++11, DeclRefExprs for objects of const literal type initialized with
   value-dependent expressions are themselves value-dependent.
 - So are references initialized with value-dependent expressions (though this
   case is missing from the C++11 standard, along with many others).

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

12 years agoClean up type flags for overloaded Neon builtins. No functional change.
Bob Wilson [Tue, 8 Nov 2011 01:16:11 +0000 (01:16 +0000)]
Clean up type flags for overloaded Neon builtins.  No functional change.

This patch just adds a simple NeonTypeFlags class to replace the various
hardcoded constants that had been used until now.  Unfortunately I couldn't
figure out a good way to avoid duplicating that class between clang and
TableGen, but since it's small and rarely changes, that's not so bad.

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

12 years ago[analyzer] Testing infrastructure: flush the output between projects.
Anna Zaks [Tue, 8 Nov 2011 00:27:56 +0000 (00:27 +0000)]
[analyzer] Testing infrastructure: flush the output between projects.

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

12 years agoThere are some crazy cases that LookupMethodInReceiverType
John McCall [Mon, 7 Nov 2011 22:49:50 +0000 (22:49 +0000)]
There are some crazy cases that LookupMethodInReceiverType
doesn't duplicate, but they all surface as implicit
properties.  It's also a useful optimization to not
duplicate the implicit getter lookup.  So, trust the
getter lookup that was already done in these cases.

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

12 years ago[analyzer] Make sure scan-build catches all clang failures.
Anna Zaks [Mon, 7 Nov 2011 22:38:10 +0000 (22:38 +0000)]
[analyzer] Make sure scan-build catches all clang failures.

scan-build ignores clang failures in some cases, which might lead to
silent failure suppression. For example, if clang command line
argument is wrong. (Addresses radar://10406598)

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

12 years agoconstexpr: static data members declared constexpr are required to have an
Richard Smith [Mon, 7 Nov 2011 22:16:17 +0000 (22:16 +0000)]
constexpr: static data members declared constexpr are required to have an
initializer; all other constexpr variables are merely required to be
initialized. In particular, a user-provided constexpr default constructor can be
used for such initialization.

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

12 years agoWhen we notice that a member function is defined with "= delete" or "=
Douglas Gregor [Mon, 7 Nov 2011 20:56:01 +0000 (20:56 +0000)]
When we notice that a member function is defined with "= delete" or "=
default", make a note of which is used when creating the
initial declaration. Previously, we would wait until later to handle
default/delete as a definition, but this is too late: when adding the
declaration, we already treated the declaration as "user-provided"
when in fact it was merely "user-declared".

Fixes PR10861 and PR10442, along with a bunch of FIXMEs.

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

12 years agoWhitespace.
Chad Rosier [Mon, 7 Nov 2011 19:52:29 +0000 (19:52 +0000)]
Whitespace.

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

12 years agoTablegenify -g options.
Chad Rosier [Mon, 7 Nov 2011 19:51:54 +0000 (19:51 +0000)]
Tablegenify -g options.

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

12 years agoRemove test with int128 printing since it breaks on some platforms.
Richard Trieu [Mon, 7 Nov 2011 19:30:35 +0000 (19:30 +0000)]
Remove test with int128 printing since it breaks on some platforms.

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

12 years agoAdd missing part of test
Douglas Gregor [Mon, 7 Nov 2011 18:54:12 +0000 (18:54 +0000)]
Add missing part of test

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

12 years agoASTConsumer::handleTopLevelDecl will end up getting called for
Douglas Gregor [Mon, 7 Nov 2011 18:53:57 +0000 (18:53 +0000)]
ASTConsumer::handleTopLevelDecl will end up getting called for
function template instantiations. Fixes <rdar://problem/10398005> / PR11312.

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

12 years ago[arcmt] Fix handling NSMakeCollectable inside an objc method.
Argyrios Kyrtzidis [Mon, 7 Nov 2011 18:46:50 +0000 (18:46 +0000)]
[arcmt] Fix handling NSMakeCollectable inside an objc method.

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

12 years ago[arcmt] In GC, handle (assign) @properties.
Argyrios Kyrtzidis [Mon, 7 Nov 2011 18:46:46 +0000 (18:46 +0000)]
[arcmt] In GC, handle (assign) @properties.

-Move __strong/__weak added to a property type to the property attribute,
e.g.  "@property (assign) __weak Foo *prop;" --> "@property (weak) Foo *prop;"

-Remove (assign) in a property so that it becomes strong-by-default in ARC.

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

12 years ago[arcmt] Map property decls to their GC attributes.
Argyrios Kyrtzidis [Mon, 7 Nov 2011 18:40:32 +0000 (18:40 +0000)]
[arcmt] Map property decls to their GC attributes.

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

12 years agoAdd support for printing integer literals of type short, unsigned short,
Richard Trieu [Mon, 7 Nov 2011 18:40:31 +0000 (18:40 +0000)]
Add support for printing integer literals of type short, unsigned short,
__int128_t and __uint128_t.  Short and unsigned short integer literals support
is only to work around a crasher as reported in PR11179 and will be removed
once Clang no longer builds short integer literals.

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

12 years ago[arcmt] In GC, change '__weak' -> '__unsafe_unretained' when applied
Argyrios Kyrtzidis [Mon, 7 Nov 2011 18:40:29 +0000 (18:40 +0000)]
[arcmt] In GC, change '__weak' -> '__unsafe_unretained' when applied
to objects of classes that don't support ARC weak

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

12 years agoWhen applying ARC __weak to a non-objc pointer, do not give error that
Argyrios Kyrtzidis [Mon, 7 Nov 2011 18:40:21 +0000 (18:40 +0000)]
When applying ARC __weak to a non-objc pointer, do not give error that
__weak is unsupported by the deployment target, since it is going to be
ignored anyway.

Makes it easier for incremental migration from GC.

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

12 years agoBetter fix for -Wnon-virtual-dtor
Matt Beaumont-Gay [Mon, 7 Nov 2011 18:30:47 +0000 (18:30 +0000)]
Better fix for -Wnon-virtual-dtor

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

12 years agoRemove duplicate listings for core.DivideZero
Matt Beaumont-Gay [Mon, 7 Nov 2011 18:00:03 +0000 (18:00 +0000)]
Remove duplicate listings for core.DivideZero

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

12 years agoDrastically simplify the mapping from the declaration corresponding to
Douglas Gregor [Mon, 7 Nov 2011 17:43:18 +0000 (17:43 +0000)]
Drastically simplify the mapping from the declaration corresponding to
the injected-class-name of a class (or class template) to the
declaration that results from substituting the given template
arguments. Previously, we would actually perform a substitution into
the injected-class-name type and then retrieve the resulting
declaration. However, in certain, rare circumstances involving
deeply-nested member templates, we would get the wrong substitution
arguments.

This new approach just matches up the declaration with a declaration
that's part of the current context (or one of its parents), which will
either be an instantiation (during template instantiation) or the
declaration itself (during the definition of the template). This is
both more efficient (we're avoiding a substitution) and more correct
(we can't get the template arguments wrong in the member-template
case).

Fixes <rdar://problem/9676205>.

Reinstated, now that we have the fix in r143967.

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

12 years agoTighten up the conditions under which we consider ourselves to be
Douglas Gregor [Mon, 7 Nov 2011 17:33:42 +0000 (17:33 +0000)]
Tighten up the conditions under which we consider ourselves to be
entering the context of a nested-name-specifier. Fixes
<rdar://problem/10397846>.

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

12 years agoAppease -Wnon-virtual-dtor
Matt Beaumont-Gay [Mon, 7 Nov 2011 17:16:31 +0000 (17:16 +0000)]
Appease -Wnon-virtual-dtor

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

12 years agoFix an unsafe use of Twine.
Benjamin Kramer [Mon, 7 Nov 2011 16:02:25 +0000 (16:02 +0000)]
Fix an unsafe use of Twine.

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

12 years agoConstant expression evaluation: support for arrays.
Richard Smith [Mon, 7 Nov 2011 09:22:26 +0000 (09:22 +0000)]
Constant expression evaluation: support for arrays.

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

12 years agoRip out one of the features I added for the driver-include-management.
Chandler Carruth [Mon, 7 Nov 2011 09:17:31 +0000 (09:17 +0000)]
Rip out one of the features I added for the driver-include-management.
We don't actually need a separate flag for non-sysrooted paths as the
driver has to manage the sysroot anyways. The driver is not infrequently
adding paths to the header search based on their existence on the
filesystem. For that, it has to add the sysroot anyways, we should pass
it on down to CC1 already joined. More importantly, the driver cannot in
all cases distinguish between sysrooted paths and paths that are
relative to the Clang binary's installation directory. Essentially, we
always need to ignore the system root for these internal header search
options. It turns out in most of the places we were already providing
the system root in the driver, and then another one in CC1 so this fixes
several bugs.

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

12 years agoFix Linux libc++ usage. Somehow this slipped through during the port.
Chandler Carruth [Mon, 7 Nov 2011 09:01:17 +0000 (09:01 +0000)]
Fix Linux libc++ usage. Somehow this slipped through during the port.

Test cases for this and all the rest of the port are still in the works,
but will wait for a fixed computer and post 3.0 merging...

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

12 years agoFix 32-bit build bots and remove some casting-away-const warnings.
Richard Smith [Mon, 7 Nov 2011 07:31:09 +0000 (07:31 +0000)]
Fix 32-bit build bots and remove some casting-away-const warnings.

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

12 years agoColorize. (this is consistent with the coloring in diagnostics.html, but perhaps...
David Blaikie [Mon, 7 Nov 2011 06:28:33 +0000 (06:28 +0000)]
Colorize. (this is consistent with the coloring in diagnostics.html, but perhaps that's a bit out of date because it doesn't look like current clang behavior)

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

12 years ago[analyzer] Add the Checker Developer Manual to the menu.
Anna Zaks [Mon, 7 Nov 2011 05:40:51 +0000 (05:40 +0000)]
[analyzer] Add the Checker Developer Manual to the menu.
It's still under construction but has enough info to be useful.

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

12 years ago[analyzer] Add overview and checker registration to the checker developer manual.
Anna Zaks [Mon, 7 Nov 2011 05:36:29 +0000 (05:36 +0000)]
[analyzer] Add overview and checker registration to the checker developer manual.

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

12 years agoRip out CK_GetObjCProperty.
John McCall [Mon, 7 Nov 2011 05:09:54 +0000 (05:09 +0000)]
Rip out CK_GetObjCProperty.

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

12 years agoConstant expression evaluation: preserve subobject designator when flattening a
Richard Smith [Mon, 7 Nov 2011 05:07:52 +0000 (05:07 +0000)]
Constant expression evaluation: preserve subobject designator when flattening a
core constant value down to an APValue.

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

12 years agoRip the ObjCPropertyRef l-value kind out of IR-generation.
John McCall [Mon, 7 Nov 2011 03:59:57 +0000 (03:59 +0000)]
Rip the ObjCPropertyRef l-value kind out of IR-generation.

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

12 years agoRemove duplicate word & unnecessary conditional.
David Blaikie [Mon, 7 Nov 2011 03:30:03 +0000 (03:30 +0000)]
Remove duplicate word & unnecessary conditional.

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

12 years agoMove tests to the appropriate directory to match the spec hierarchy.
David Blaikie [Mon, 7 Nov 2011 03:27:58 +0000 (03:27 +0000)]
Move tests to the appropriate directory to match the spec hierarchy.

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

12 years agoAllow constexpr variables' initializers to be folded in C++11 mode. This
Richard Smith [Mon, 7 Nov 2011 03:22:51 +0000 (03:22 +0000)]
Allow constexpr variables' initializers to be folded in C++11 mode. This
partially undoes the revert in r143491, but does not introduce any new instances
of the underlying issue (which is not yet fixed) in code which does not use
the 'constexpr' keyword.

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

12 years agoBegin lifting some of the one-off checking logic into generic helper
Chandler Carruth [Sun, 6 Nov 2011 23:39:37 +0000 (23:39 +0000)]
Begin lifting some of the one-off checking logic into generic helper
routines on the base toolchain class.

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

12 years agoMove the GCC installation detection logic down into the Generic_GCC
Chandler Carruth [Sun, 6 Nov 2011 23:39:34 +0000 (23:39 +0000)]
Move the GCC installation detection logic down into the Generic_GCC
toolchain. The logic is mostly generic already, and where possible
should be made more generic. Also, it has no impact other than to expose
a set of methods which each toolchain can then query to setup their
desired configuration. These should be available to toolchains beyond
just Linux.

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

12 years agoRemove an old OpenSUSE hack that is no longer needed -- it is exactly
Chandler Carruth [Sun, 6 Nov 2011 23:10:49 +0000 (23:10 +0000)]
Remove an old OpenSUSE hack that is no longer needed -- it is exactly
the same as a directory added further down in the new logic.

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

12 years agoRemove the HasMultilib check. It was essentially useless. The driver now
Chandler Carruth [Sun, 6 Nov 2011 23:09:05 +0000 (23:09 +0000)]
Remove the HasMultilib check. It was essentially useless. The driver now
looks for evidence of a multilib installation, and adds the appropriate
bits to the search paths.

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

12 years agoCorrecting grammar.
David Blaikie [Sun, 6 Nov 2011 22:28:03 +0000 (22:28 +0000)]
Correcting grammar.

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

12 years agoUse StringRef's case transformation methods.
Benjamin Kramer [Sun, 6 Nov 2011 20:36:48 +0000 (20:36 +0000)]
Use StringRef's case transformation methods.

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

12 years ago[arcmt] In GC, error for __strong/__weak on non-objc pointers.
Argyrios Kyrtzidis [Sun, 6 Nov 2011 18:58:23 +0000 (18:58 +0000)]
[arcmt] In GC, error for __strong/__weak on non-objc pointers.

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

12 years ago[arcmt] In GC, clear redundant __strong's.
Argyrios Kyrtzidis [Sun, 6 Nov 2011 18:58:17 +0000 (18:58 +0000)]
[arcmt] In GC, clear redundant __strong's.

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

12 years agoMake sure when setting AttributesAsWritten of a property that they do not
Argyrios Kyrtzidis [Sun, 6 Nov 2011 18:58:12 +0000 (18:58 +0000)]
Make sure when setting AttributesAsWritten of a property that they do not
include ownership qualifiers from the type.

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

12 years ago[arcmt] Make PropertiesRewriter::getPropertyType return the unqualified type.
Argyrios Kyrtzidis [Sun, 6 Nov 2011 18:58:07 +0000 (18:58 +0000)]
[arcmt] Make PropertiesRewriter::getPropertyType return the unqualified type.

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

12 years ago[arcmt] Collect all the places where GC attributes __strong/__weak occur.
Argyrios Kyrtzidis [Sun, 6 Nov 2011 18:58:03 +0000 (18:58 +0000)]
[arcmt] Collect all the places where GC attributes __strong/__weak occur.

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

12 years ago[arcmt] Refactor PropertiesRewriter to use MigrationContext.
Argyrios Kyrtzidis [Sun, 6 Nov 2011 18:57:57 +0000 (18:57 +0000)]
[arcmt] Refactor PropertiesRewriter to use MigrationContext.

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

12 years agotest/Driver/crash-cleanup.c: Remove "XFAIL: mingw32" corresponding to r143876.
NAKAMURA Takumi [Sun, 6 Nov 2011 16:59:41 +0000 (16:59 +0000)]
test/Driver/crash-cleanup.c: Remove "XFAIL: mingw32" corresponding to r143876.

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

12 years agoThe version objects need to actually store the version strings; they
Chandler Carruth [Sun, 6 Nov 2011 10:51:30 +0000 (10:51 +0000)]
The version objects need to actually store the version strings; they
aren't guaranteed to live long enough otherwise.

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

12 years agoThrow the switch and move all Linux header search over to the GCC
Chandler Carruth [Sun, 6 Nov 2011 10:31:01 +0000 (10:31 +0000)]
Throw the switch and move all Linux header search over to the GCC
detection system that is providing the library paths and crt object
files.

This, modulo any bugs that need to be shaken out, resolves numerous bugs
with how we handle header paths. Here are a few that I know of:
- We no longer need to enumerate all GCC versions searched.
- OpenSUSE searched GCC versions in the wrong order.
- There were typos when selecting various patterns, etc.
- We aren't stating quite some many directories now.
- SysRoot didn't always work in a reasonable way.

I'm working on tests for this, but the tests are making me and Lit sad.
The real testing for this type of driver change is to try it out on
various distributions. I'll hit the common ones right away, and start
more thorough testing tomorrow after some sleep.

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

12 years agoAdd a missing triple spotted by inspecting and testing of the include
Chandler Carruth [Sun, 6 Nov 2011 10:30:58 +0000 (10:30 +0000)]
Add a missing triple spotted by inspecting and testing of the include
path triples. Also order the 32-bit triples a bit more reasonably.

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

12 years agoUnbreak gcc build.
Benjamin Kramer [Sun, 6 Nov 2011 09:50:13 +0000 (09:50 +0000)]
Unbreak gcc build.

For some reason clang and msvc accept this, but gcc doesn't.

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

12 years agoLift the GCCVersion type into the header file and start persisting it in
Chandler Carruth [Sun, 6 Nov 2011 09:39:46 +0000 (09:39 +0000)]
Lift the GCCVersion type into the header file and start persisting it in
the detected GCC installation. This allows us to expose another aspect
of what we detected: the GCC version. This will be used shortly.

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

12 years agoMake format string 64 bit safe.
Benjamin Kramer [Sun, 6 Nov 2011 09:34:11 +0000 (09:34 +0000)]
Make format string 64 bit safe.

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

12 years agoSwitch some of these interfaces from std::string to StringRef and Twine.
Chandler Carruth [Sun, 6 Nov 2011 09:21:54 +0000 (09:21 +0000)]
Switch some of these interfaces from std::string to StringRef and Twine.
This will facilitate further use and recombinations of them.

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

12 years agotest/Driver/crash-cleanup.c: Mark as XFAIL: mingw32, for investigating.
NAKAMURA Takumi [Sun, 6 Nov 2011 09:11:35 +0000 (09:11 +0000)]
test/Driver/crash-cleanup.c: Mark as XFAIL: mingw32, for investigating.

"XFAIL: msys" has no effect, due to XFAIL inspects triplet, and msys build does not use *-msys-* but *-mingw32.

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

12 years agoChange the AST representation of operations on Objective-C
John McCall [Sun, 6 Nov 2011 09:01:30 +0000 (09:01 +0000)]
Change the AST representation of operations on Objective-C
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions.  It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.

Most of the effort here is in dealing with the various
clients of the AST.  I've gone ahead and simplified the
ObjC rewriter's use of properties;  other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily.  Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.

I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.

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

12 years agoTake a better approach to detecting and selecting multiarch include
Chandler Carruth [Sun, 6 Nov 2011 08:21:07 +0000 (08:21 +0000)]
Take a better approach to detecting and selecting multiarch include
directories. This way we stop at the first multiarch directory found on
the system. This achieves the real intended result of pruning
non-existent directories.

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

12 years agoRevert r143864, as the problem I was actually looking at can be solved
Chandler Carruth [Sun, 6 Nov 2011 08:21:04 +0000 (08:21 +0000)]
Revert r143864, as the problem I was actually looking at can be solved
a better way. The more I think about it the more worried I am that this
hammer is simply too large. We should only be reaching out to the
filesystem when doing interesting "detection" things, not gratuitously.

Original commit message:
Start pruning down the set of flags passed to CC1 for header search.
This cleans up the CC1 invocations, and reduces the overhead there.
We're still hammering the filesystem looking for the C++ standard
libraries though.

The only reservation I have about this policy is the case of virtualized
files inside of CC1, but it's not clear what the best way to solve that
is. The Driver consistently queries the actual filesystem to make its
decisions. Changing that would be a very large undertaking. It might be
worthwhile, but it's not an immediate goal.

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

12 years agoStart pruning down the set of flags passed to CC1 for header search.
Chandler Carruth [Sun, 6 Nov 2011 07:31:36 +0000 (07:31 +0000)]
Start pruning down the set of flags passed to CC1 for header search.
This cleans up the CC1 invocations, and reduces the overhead there.
We're still hammering the filesystem looking for the C++ standard
libraries though.

The only reservation I have about this policy is the case of virtualized
files inside of CC1, but it's not clear what the best way to solve that
is. The Driver consistently queries the actual filesystem to make its
decisions. Changing that would be a very large undertaking. It might be
worthwhile, but it's not an immediate goal.

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

12 years agoThis test was assuming that /usr/include was in the system header search
Chandler Carruth [Sun, 6 Nov 2011 06:59:15 +0000 (06:59 +0000)]
This test was assuming that /usr/include was in the system header search
path. That assumption should never have been true, but it was until
I fixed it. Now that its fixed, add a triple here to get correct
behavior even on Windows.

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

12 years agoXFAIL crash-cleanup.c only on Darwin and msys.
Peter Collingbourne [Sun, 6 Nov 2011 04:32:01 +0000 (04:32 +0000)]
XFAIL crash-cleanup.c only on Darwin and msys.

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

12 years agoXFAIL test until Peter has a chance to investigate.
Chad Rosier [Sun, 6 Nov 2011 03:42:36 +0000 (03:42 +0000)]
XFAIL test until Peter has a chance to investigate.

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

12 years agoFixing -g break caused by a dead reference to a temporary introduced in r143732.
David Blaikie [Sun, 6 Nov 2011 01:53:39 +0000 (01:53 +0000)]
Fixing -g break caused by a dead reference to a temporary introduced in r143732.

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

12 years agoAdd the depfile as a result file so that it is deleted if we crash,
Peter Collingbourne [Sun, 6 Nov 2011 00:40:05 +0000 (00:40 +0000)]
Add the depfile as a result file so that it is deleted if we crash,
and prevent the diagnostic preprocessor run from writing a depfile.

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

12 years agoSwitch Lit to directly query the driver for the builtin inclue path.
Chandler Carruth [Sat, 5 Nov 2011 23:29:28 +0000 (23:29 +0000)]
Switch Lit to directly query the driver for the builtin inclue path.
Thanks to Peter for pointing out how easy this is to do. I'm now much
happier with this solution.

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

12 years agoEnhance the GCC version parsing and comparison logic to handle some more
Chandler Carruth [Sat, 5 Nov 2011 23:24:30 +0000 (23:24 +0000)]
Enhance the GCC version parsing and comparison logic to handle some more
edge cases and have better behavior. Specifically, we should actually
prefer the general '4.6' version string over the '4.6.1' string, as
'4.6.2' should be able to replace it without breaking rpaths or any
other place that these paths have been embedded. Debian-based
distributions are already using a path structure with symlinks to
achieve in-place upgrades for patch versions. Now our parsing reflects
this and we select the shorter paths instead of the longer paths.

A separate issue was that we would not parse a leading patch version
number even in the presence of a suffix. The above change makes this
more problematic as it would cause a suffix being added to make us treat
the entire thing as patch-version-agnostic, which it isn't. This changes
the logic to distinguish between '4.4.x' and 4.4.1-x', and retain that
the latter has *some* patch number information. Currently, we always
bias toward the shorter and more canonical version strings. If it
becomes important we can add more Debian like rules to produce sequences
such as '4.4.1b' > '4.4.1' > '4.4.1-rc3' > '4.4.1-rc2' > '4.4.1-pre5',
but I'm very doubtful this will ever matter or be desirable.

I've made the tests for this logic a bit more interesting, and added
some specific tests for logic that is now different.

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

12 years agoRemove a pointless member. I have no idea why I made this not a local
Chandler Carruth [Sat, 5 Nov 2011 22:23:14 +0000 (22:23 +0000)]
Remove a pointless member. I have no idea why I made this not a local
variable to begin with... As I'm planning to add include root
information to this object, this would have caused confusion. It didn't
even *actually* hold the include root by the time we were done with it.

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

12 years agoRemove a no-longer needed helper function. Thanks for implementing this
Chandler Carruth [Sat, 5 Nov 2011 22:23:11 +0000 (22:23 +0000)]
Remove a no-longer needed helper function. Thanks for implementing this
Michael!

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

12 years agoMove the GCC installation detection helper a member of the Linux
Chandler Carruth [Sat, 5 Nov 2011 22:07:51 +0000 (22:07 +0000)]
Move the GCC installation detection helper a member of the Linux
toolchain instead of merely using it in the constructor. This will allow
us to query it when building include paths as well as the file search
paths built in the constructor. I've lifted as little of it as I could
into the header file.

Eventually this will likely sink down into some of the Generic
toolchains and be used on more platforms, but I'm starting on Linux so
I can work out all the APIs needed there, where it is easiest to test
and we have the most pressing need.

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

12 years agoRemove support for Gentoo subversion-ebuild installed llvm-gcc libstdc++
Chandler Carruth [Sat, 5 Nov 2011 21:26:18 +0000 (21:26 +0000)]
Remove support for Gentoo subversion-ebuild installed llvm-gcc libstdc++
headers. As llvm-gcc is dead, and I have no idea if this ever really
worked, I think it's time for it to go. More importantly, it makes it
harder to generalize the include search logic. If someone really wants
these to work, they can set the CPLUS_INCLUDE_PATH environment variable.

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

12 years agoTeach lit to ask the Clang it is running what version string to use
Chandler Carruth [Sat, 5 Nov 2011 20:55:50 +0000 (20:55 +0000)]
Teach lit to ask the Clang it is running what version string to use
rather than presuming that it is 3.0. This is extra important as the
version should be 3.1, but CMake hasn't caught up with the times.
That'll be fixed in a separate commit.

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

12 years agoMove the Linux header searching from the Frontend to the Driver. This is
Chandler Carruth [Sat, 5 Nov 2011 20:17:13 +0000 (20:17 +0000)]
Move the Linux header searching from the Frontend to the Driver. This is
the first (and diff-noisiest) step to making Linux header searching
tremendously more principled and less brittle. Note that this step
should have essentially no functional impact. We still search the exact
same set of paths in the exact same order. The only change here is where
the code implementing such a search lives.

This has one obvious negative impact -- we now pass a ludicrous number
of flags to the CC1 layer. That should go away as I re-base this logic
on the logic to detect a GCC installation. I want to do this in two
phases so the bots can tell me if this step alone breaks something, and
so that the diffs of the refactoring make more sense.

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