]> granicus.if.org Git - clang/log
clang
13 years agoGather cached code completions after the first reparse, not after the
Douglas Gregor [Thu, 9 Dec 2010 21:27:43 +0000 (21:27 +0000)]
Gather cached code completions after the first reparse, not after the
second reparse.

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

13 years agoUpdate test.
Devang Patel [Thu, 9 Dec 2010 19:27:37 +0000 (19:27 +0000)]
Update test.
This test intends to catch invalid use of ".byte 256" in output. Now, the assert in MC will be triggered in such cases.

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

13 years agoFix type of last vector operand of Neon quad-register multiple-lane intrinsics.
Bob Wilson [Thu, 9 Dec 2010 18:58:31 +0000 (18:58 +0000)]
Fix type of last vector operand of Neon quad-register multiple-lane intrinsics.
The sensible thing would be to have these intrinsics take all quad-register
vector operands, but that's not what ARM did.  They made the last vector
operand always be a double-register type.  Since the lane number
must be a constant, the user can know which half of a quad-register contains
that lane, extract the high or low half of the vector, and adjust the lane
number accordingly.  The only advantage I can see for this is that it works
better when you want to multiply a quad-register value by a lane from a
double-register value, but I wouldn't have expected that to be the common
case.  Oh well -- at this point we just need to follow the spec.

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

13 years agoFix the names of the v[r]addhn and v[r]subhn Neon intrinsics.
Bob Wilson [Thu, 9 Dec 2010 18:31:16 +0000 (18:31 +0000)]
Fix the names of the v[r]addhn and v[r]subhn Neon intrinsics.
Their suffixes are supposed to reflect the source operand element type,
not the destination element type.  Radar 8746481.

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

13 years agoUse error_code instead of std::string* for MemoryBuffer.
Michael J. Spencer [Thu, 9 Dec 2010 17:36:38 +0000 (17:36 +0000)]
Use error_code instead of std::string* for MemoryBuffer.

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

13 years agoWhen an "inline" declaration was followed by a definition not marked
Douglas Gregor [Thu, 9 Dec 2010 16:59:22 +0000 (16:59 +0000)]
When an "inline" declaration was followed by a definition not marked
"inline", we weren't giving the definition weak linkage because the
"inline" bit wasn't propagated. This was a longstanding FIXME that,
somehow, hadn't triggered a bug in the wild. Fix this problem by
tracking whether any declaration was marked "inline", and clean up the
semantics of GNU's "extern inline" semantics calculation based on this
change.

Fixes <rdar://problem/8740363>.

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

13 years agoFix PR8760: IndirectFieldDecl Type was not updated during template instantiation.
Francois Pichet [Thu, 9 Dec 2010 10:07:54 +0000 (10:07 +0000)]
Fix PR8760: IndirectFieldDecl Type was not updated during template instantiation.

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

13 years agoAdd missing "s32" and "u32" variants of Neon vzip intrinsic.
Bob Wilson [Thu, 9 Dec 2010 07:01:08 +0000 (07:01 +0000)]
Add missing "s32" and "u32" variants of Neon vzip intrinsic.
Radar 8446277.

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

13 years agoAdd missing "p16" type variants for the Neon VREV32 intrinsics.
Bob Wilson [Thu, 9 Dec 2010 06:47:29 +0000 (06:47 +0000)]
Add missing "p16" type variants for the Neon VREV32 intrinsics.
Radar 8446277.

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

13 years agoFix another unnecessary-struct-padding issue.
Argyrios Kyrtzidis [Thu, 9 Dec 2010 02:47:58 +0000 (02:47 +0000)]
Fix another unnecessary-struct-padding issue.

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

13 years agoFix build.
Anders Carlsson [Thu, 9 Dec 2010 01:00:12 +0000 (01:00 +0000)]
Fix build.

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

13 years agoBefore determining the effect the alignment of base struct will have in the aligment...
Argyrios Kyrtzidis [Thu, 9 Dec 2010 00:35:20 +0000 (00:35 +0000)]
Before determining the effect the alignment of base struct will have in the aligment of the sub-struct,
take into account if the sub-struct is packed and its maximum field alignment.

Fixes rdar://8745206

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

13 years agoRemove extra namespace specifier.
Ted Kremenek [Thu, 9 Dec 2010 00:33:41 +0000 (00:33 +0000)]
Remove extra namespace specifier.

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

13 years agoRemove unused parameter. getContextDescriptor() and getOrCreateNameSpace().
Devang Patel [Thu, 9 Dec 2010 00:33:05 +0000 (00:33 +0000)]
Remove unused parameter. getContextDescriptor() and getOrCreateNameSpace().

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

13 years agoRemove unused parameter.
Devang Patel [Thu, 9 Dec 2010 00:25:29 +0000 (00:25 +0000)]
Remove unused parameter.

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

13 years agoTest case for r121323.
Devang Patel [Thu, 9 Dec 2010 00:11:12 +0000 (00:11 +0000)]
Test case for r121323.

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

13 years agoA typename specifier can end up referring to a unresolved using
Douglas Gregor [Thu, 9 Dec 2010 00:06:27 +0000 (00:06 +0000)]
A typename specifier can end up referring to a unresolved using
declaration that is a value in ill-formed code. Instead of crashing,
treat this as a dependent typename specifier and suggest that the
using add "typename" into the using declaration. Fixes <rdar://problem/8740998>.

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

13 years agoDenseMapInfo is a 'struct', not a 'class'.
Ted Kremenek [Thu, 9 Dec 2010 00:01:52 +0000 (00:01 +0000)]
DenseMapInfo is a 'struct', not a 'class'.

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

13 years agoAdd new libclang hooks for CXCursorSet, a
Ted Kremenek [Wed, 8 Dec 2010 23:43:14 +0000 (23:43 +0000)]
Add new libclang hooks for CXCursorSet, a
DenseMap-backed hashtable for doing client-side
management of CXCursors within a set.

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

13 years agoStart using DIBuilder. It provides cleaner interface.
Devang Patel [Wed, 8 Dec 2010 22:42:58 +0000 (22:42 +0000)]
Start using DIBuilder. It provides cleaner interface.

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

13 years agoStop using builtins for the "_lane" variants of saturating multiply intrinsics.
Bob Wilson [Wed, 8 Dec 2010 22:37:56 +0000 (22:37 +0000)]
Stop using builtins for the "_lane" variants of saturating multiply intrinsics.
Remove the "splat" parameter from the EmitNeonCall function, since it is no
longer needed.

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

13 years agoRemove the TypesCompatibleExprClass AST node. Merge its functionality into BinaryType...
Francois Pichet [Wed, 8 Dec 2010 22:35:30 +0000 (22:35 +0000)]
Remove the TypesCompatibleExprClass AST node. Merge its functionality into BinaryTypeTraitExpr.

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

13 years agoPut the "'typename' occurs outside of a template" and "'template'
Douglas Gregor [Wed, 8 Dec 2010 22:02:28 +0000 (22:02 +0000)]
Put the "'typename' occurs outside of a template" and "'template'
keyword occurs outside of a template" diagnostics under
-WC++0x-extensions.

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

13 years agoStop using clang builtins for Neon vabdl and vabal intrinsics.
Bob Wilson [Wed, 8 Dec 2010 21:39:47 +0000 (21:39 +0000)]
Stop using clang builtins for Neon vabdl and vabal intrinsics.

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

13 years agoDriver: M and MM should be grouped together, <rdar://problem/8744831>.
Daniel Dunbar [Wed, 8 Dec 2010 21:33:40 +0000 (21:33 +0000)]
Driver: M and MM should be grouped together, <rdar://problem/8744831>.

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

13 years agoStop using clang builtins for Neon vaba intrinsics.
Bob Wilson [Wed, 8 Dec 2010 20:09:54 +0000 (20:09 +0000)]
Stop using clang builtins for Neon vaba intrinsics.

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

13 years agoMake this test resilient to whether or not the Linux toolchain renders the
Chandler Carruth [Wed, 8 Dec 2010 19:11:45 +0000 (19:11 +0000)]
Make this test resilient to whether or not the Linux toolchain renders the
sysroot flag to the link command as a joined flag or a separate flag.

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

13 years agoFix BinaryOperator dispatch for RecursiveASTVisitor, from Benoit Perrot!
Douglas Gregor [Wed, 8 Dec 2010 17:15:44 +0000 (17:15 +0000)]
Fix BinaryOperator dispatch for RecursiveASTVisitor, from Benoit Perrot!

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

13 years agoFix two thinkos and add a test for importing the AST of a category
Douglas Gregor [Wed, 8 Dec 2010 16:41:55 +0000 (16:41 +0000)]
Fix two thinkos and add a test for importing the AST of a category
implementation.

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

13 years agoFix bug where annotate tokens was not working for BinaryTypeTraitExpr.
Francois Pichet [Wed, 8 Dec 2010 09:11:05 +0000 (09:11 +0000)]
Fix bug where annotate tokens was not working for BinaryTypeTraitExpr.
CIndex's EnqueueVisitor must visit elements backward apparently.

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

13 years agoFix test that didn't really test anything.
Francois Pichet [Wed, 8 Dec 2010 09:04:37 +0000 (09:04 +0000)]
Fix test that didn't really test anything.

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

13 years agoHandle parameter attributes when tentative parsing for function/variable disambiguation.
Argyrios Kyrtzidis [Wed, 8 Dec 2010 02:02:46 +0000 (02:02 +0000)]
Handle parameter attributes when tentative parsing for function/variable disambiguation.
Fixes rdar://8739801.

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

13 years agoSilence an unused variable warning.
Chandler Carruth [Wed, 8 Dec 2010 01:29:17 +0000 (01:29 +0000)]
Silence an unused variable warning.

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

13 years agoStop using clang builtins for Neon vadd[lw] and vsub[lw] intrinsics.
Bob Wilson [Wed, 8 Dec 2010 00:14:43 +0000 (00:14 +0000)]
Stop using clang builtins for Neon vadd[lw] and vsub[lw] intrinsics.

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

13 years agoStop using clang builtins for Neon vmlal{_n,_lane} and vmlsl{_n,_lane}.
Bob Wilson [Tue, 7 Dec 2010 23:54:55 +0000 (23:54 +0000)]
Stop using clang builtins for Neon vmlal{_n,_lane} and vmlsl{_n,_lane}.

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

13 years agoTest case.
John McCall [Tue, 7 Dec 2010 22:55:51 +0000 (22:55 +0000)]
Test case.

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

13 years agoBump up property conversion earlier in the initialization process. Fixes
John McCall [Tue, 7 Dec 2010 22:54:16 +0000 (22:54 +0000)]
Bump up property conversion earlier in the initialization process.  Fixes
the failed compile in PR8751.

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

13 years agoStop using a clang builtin for Neon vdup_lane intrinsics.
Bob Wilson [Tue, 7 Dec 2010 22:40:02 +0000 (22:40 +0000)]
Stop using a clang builtin for Neon vdup_lane intrinsics.

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

13 years agoStop using a clang builtin for Neon vmull_lane intrinsic.
Bob Wilson [Tue, 7 Dec 2010 22:03:46 +0000 (22:03 +0000)]
Stop using a clang builtin for Neon vmull_lane intrinsic.

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

13 years agoAdd a missing parameter, without which clang crashes for vqshlu_n intrinsics.
Bob Wilson [Tue, 7 Dec 2010 22:03:43 +0000 (22:03 +0000)]
Add a missing parameter, without which clang crashes for vqshlu_n intrinsics.

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

13 years agoImplement vmull and vmull_n intrinsics without using clang builtins.
Bob Wilson [Tue, 7 Dec 2010 20:03:04 +0000 (20:03 +0000)]
Implement vmull and vmull_n intrinsics without using clang builtins.

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

13 years agoImplement AST import for Objective-C property implementations
Douglas Gregor [Tue, 7 Dec 2010 18:32:03 +0000 (18:32 +0000)]
Implement AST import for Objective-C property implementations
(@synthesize and @dynamic).

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

13 years agoCast CachedLinkage to linkage to avoid "comparison between signed and unsigned intege...
Benjamin Kramer [Tue, 7 Dec 2010 15:51:48 +0000 (15:51 +0000)]
Cast CachedLinkage to linkage to avoid "comparison between signed and unsigned integer" warnings.

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

13 years agoImplement ASTImporter support for Objective-C category implementations.
Douglas Gregor [Tue, 7 Dec 2010 15:32:12 +0000 (15:32 +0000)]
Implement ASTImporter support for Objective-C category implementations.

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

13 years agoFix PR8720 by printing an error message with a substring that the gcc testsuite searc...
Rafael Espindola [Tue, 7 Dec 2010 15:23:23 +0000 (15:23 +0000)]
Fix PR8720 by printing an error message with a substring that the gcc testsuite searches for.

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

13 years agoPR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
Jay Foad [Tue, 7 Dec 2010 08:25:34 +0000 (08:25 +0000)]
PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

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

13 years agoExtern the ASTImporter to import @implementation declarations.
Douglas Gregor [Tue, 7 Dec 2010 01:26:03 +0000 (01:26 +0000)]
Extern the ASTImporter to import @implementation declarations.

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

13 years agoAdd Neon vreinterpret intrinsics.
Bob Wilson [Tue, 7 Dec 2010 01:12:51 +0000 (01:12 +0000)]
Add Neon vreinterpret intrinsics.
Radar 8681774.

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

13 years agoMake whitespace more consistent.
Bob Wilson [Tue, 7 Dec 2010 01:12:48 +0000 (01:12 +0000)]
Make whitespace more consistent.

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

13 years agoFix enumerator not handled in switch warnings.
Francois Pichet [Tue, 7 Dec 2010 00:55:57 +0000 (00:55 +0000)]
Fix enumerator not handled in switch warnings.

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

13 years agoKill FullExpr, as it was not, in fact, used anywhere in the code base.
John McCall [Tue, 7 Dec 2010 00:47:33 +0000 (00:47 +0000)]
Kill FullExpr, as it was not, in fact, used anywhere in the code base.
I'm not opposed to the idea in concept, but there's no point in preserving
abortive experiments.

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

13 years agoUse Sema::MaybeCreateExprWithCleanups() only after we've checked for a NULL/invalid...
Douglas Gregor [Tue, 7 Dec 2010 00:41:46 +0000 (00:41 +0000)]
Use Sema::MaybeCreateExprWithCleanups() only after we've checked for a NULL/invalid expression

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

13 years agoFix compile error: comma at end of enumerator list.
Francois Pichet [Tue, 7 Dec 2010 00:21:00 +0000 (00:21 +0000)]
Fix compile error:  comma at end of enumerator list.

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

13 years agoType traits intrinsic implementation: __is_base_of(T, U)
Francois Pichet [Tue, 7 Dec 2010 00:08:36 +0000 (00:08 +0000)]
Type traits intrinsic implementation: __is_base_of(T, U)
New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics.

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

13 years agoUse atomic operations for libclang's object count tracking.
Douglas Gregor [Tue, 7 Dec 2010 00:05:48 +0000 (00:05 +0000)]
Use atomic operations for libclang's object count tracking.

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

13 years agoObjective-C pointer conversions to 'id' or qualified 'id' subsume
Douglas Gregor [Mon, 6 Dec 2010 22:09:19 +0000 (22:09 +0000)]
Objective-C pointer conversions to 'id' or qualified 'id' subsume
cv-qualification conversions. More specifically, there's an implicit
cv-qualification conversion (even one that drops qualifiers) when
converting to 'id' or qualified 'id'. Fixes <rdar://problem/8734046>.

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

13 years agoSplit out a function to do lvalue conversion on objects; this is basically
John McCall [Mon, 6 Dec 2010 20:48:59 +0000 (20:48 +0000)]
Split out a function to do lvalue conversion on objects;  this is basically
FunctionArrayLvalueConversion but without the function/array decay.  Generally
this is only appropriate for use sites that know the type of the expression
and thus that it can't be subject to the decays.

Also make sure we do lvalue-to-rvalue on the bases of ivar references.

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

13 years agoc/objc/c++'98 are basically done, but we want '0x support.
Chris Lattner [Mon, 6 Dec 2010 19:46:27 +0000 (19:46 +0000)]
c/objc/c++'98 are basically done, but we want '0x support.
Add "clang indent" as a possible project, we really really
need it. :)

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

13 years agoRemove a fixme which was fixed in a previous commit.
Argyrios Kyrtzidis [Mon, 6 Dec 2010 19:36:50 +0000 (19:36 +0000)]
Remove a fixme which was fixed in a previous commit.

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

13 years agoUse the unused merge() function, fixing an minor, unintended change I
Douglas Gregor [Mon, 6 Dec 2010 18:50:56 +0000 (18:50 +0000)]
Use the unused merge() function, fixing an minor, unintended change I
introduced in r121023.

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

13 years agoRe-implement caching for the linkage calculation of declarations.
Douglas Gregor [Mon, 6 Dec 2010 18:36:25 +0000 (18:36 +0000)]
Re-implement caching for the linkage calculation of declarations.

My previous attempt at solving the compile-time problem with many
redeclarations of the same entity cached both linkage and visibility,
while this patch only tackles linkage. There are several reasons for
this difference:

  - Linkage is a language concept, and is evaluated many times during
    semantic analysis and codegen, while visibility is only a
    code-generation concept that is evaluated only once per (unique)
    declaration. Hence, we *must* optimize linkage calculations but
    don't need to optimize visibility computation.
  - Once we know the linkage of a declaration, subsequent
    redeclarations can't change that linkage. Hence, cache
    invalidation is far simpler than for visibility, where a later
    redeclaration can completely change the visibility.
  - We have 3 spare bits in Decl to store the linkage cache, so the
    cache doesn't increase the size of declarations. With the
    visibility+linkage cache, NamedDecl got larger.

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

13 years agoDo unary conversions on vararg arguments and *then* special-case float.
John McCall [Mon, 6 Dec 2010 18:36:11 +0000 (18:36 +0000)]
Do unary conversions on vararg arguments and *then* special-case float.
Fixes PR8742.

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

13 years agoUse Sema's MarkDeclarationReferenced, which takes care of templates, instead of calli...
Argyrios Kyrtzidis [Mon, 6 Dec 2010 17:51:53 +0000 (17:51 +0000)]
Use Sema's MarkDeclarationReferenced, which takes care of templates, instead of calling Decl's setUsed directly.
Thanks to John for the hint!

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

13 years agoUse the source location of the parameter, when it makes sense, for diagnostics in...
Argyrios Kyrtzidis [Mon, 6 Dec 2010 17:51:50 +0000 (17:51 +0000)]
Use the source location of the parameter, when it makes sense, for diagnostics in HandleCleanupAttr.

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

13 years agoRevert r120808, my previous implementation of caching for the linkage
Douglas Gregor [Mon, 6 Dec 2010 17:49:01 +0000 (17:49 +0000)]
Revert r120808, my previous implementation of caching for the linkage
and visibility of declarations, because it was extremely messy and it
increased the size of NamedDecl.

An improved implementation is forthcoming.

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

13 years agoAdd BlocksAttr assert on __block specific
Fariborz Jahanian [Mon, 6 Dec 2010 17:28:17 +0000 (17:28 +0000)]
Add BlocksAttr assert on __block specific
routines.

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

13 years agoUn-templatetize this method. It's definition is out of line in the .cpp file,
Chandler Carruth [Mon, 6 Dec 2010 09:23:57 +0000 (09:23 +0000)]
Un-templatetize this method. It's definition is out of line in the .cpp file,
so that's not a valid thing to do at all. Instead, switch to a ValueDecl
argument, the template isn't really necessary here.

When handling the types explicitly in the code, it becomes awkward to cerate
the CXXBaseOrMemberInitializer object in so many places. Re-flow the code to
calculate the Init expression first, and then create the initializer. If this
is too gross, we can factor the init expression logic into helper functions,
but it's not past my threshold yet.

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

13 years agoRename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical
John McCall [Mon, 6 Dec 2010 08:20:24 +0000 (08:20 +0000)]
Rename CXXExprWithTemporaries -> ExprWithCleanups;  there's no theoretical
reason this is limited to C++, and it's certainly not limited to temporaries.

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

13 years ago__block variables require us to evaluate the RHS of an assignment before
John McCall [Mon, 6 Dec 2010 06:10:02 +0000 (06:10 +0000)]
__block variables require us to evaluate the RHS of an assignment before
the LHS, or else the pointer might be invalid.  This is kindof dumb, but
go ahead and make sure we're doing that for l-value scalar assignment,
which fixes a miscompile of obj-c++.dg/block-seq.mm.

Leave a FIXME for how to solve this problem for agg __blocks.

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

13 years agoClarify the logic for when to build an overloaded binop. In particular,
John McCall [Mon, 6 Dec 2010 05:26:58 +0000 (05:26 +0000)]
Clarify the logic for when to build an overloaded binop.  In particular,
build one when either of the operands calls itself type-dependent;
previously we were building when one of the operand types was dependent,
which is not always the same thing and which can lead to unfortunate
inconsistencies later.  Fixes PR8739.

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

13 years agoMark SVal constructors 'explicit'.
Ted Kremenek [Sun, 5 Dec 2010 23:36:20 +0000 (23:36 +0000)]
Mark SVal constructors 'explicit'.

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

13 years agoRename Environment::LookupExpr() to
Ted Kremenek [Sun, 5 Dec 2010 23:36:15 +0000 (23:36 +0000)]
Rename Environment::LookupExpr() to
Environment::lookupExpr() and move its implementation
out-of-line.

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

13 years agoRemove unused method GRState::LookupExpr().
Ted Kremenek [Sun, 5 Dec 2010 23:36:01 +0000 (23:36 +0000)]
Remove unused method GRState::LookupExpr().

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

13 years agoFix a bug in the emission of __real/__imag l-values on scalar operands.
John McCall [Sun, 5 Dec 2010 02:00:02 +0000 (02:00 +0000)]
Fix a bug in the emission of __real/__imag l-values on scalar operands.
Fix a bug in the emission of complex compound assignment l-values.
Introduce a method to emit an expression whose value isn't relevant.
Make that method evaluate its operand as an l-value if it is one.
Fixes our volatile compliance in C++.

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

13 years agoPut each test in class-layout.cpp into a separate namespace.
Anders Carlsson [Sun, 5 Dec 2010 00:08:52 +0000 (00:08 +0000)]
Put each test in class-layout.cpp into a separate namespace.

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

13 years agoAdd a LayoutBase member function. No functionality change.
Anders Carlsson [Sat, 4 Dec 2010 23:59:48 +0000 (23:59 +0000)]
Add a LayoutBase member function. No functionality change.

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

13 years agoReplace calls to AppendBytes with calls to AppendPadding when the bytes appended...
Anders Carlsson [Sat, 4 Dec 2010 23:53:18 +0000 (23:53 +0000)]
Replace calls to AppendBytes with calls to AppendPadding when the bytes appended are padding.

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

13 years agoFix rewriter to match recent changes in property ref
Fariborz Jahanian [Sat, 4 Dec 2010 21:22:13 +0000 (21:22 +0000)]
Fix rewriter to match recent changes in property ref
AST.

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

13 years agoSilly special case: never load when dereferencing void*.
John McCall [Sat, 4 Dec 2010 12:43:24 +0000 (12:43 +0000)]
Silly special case:  never load when dereferencing void*.

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

13 years agoFirst pass at implementing the intent of ANSI C DR106.
John McCall [Sat, 4 Dec 2010 12:29:11 +0000 (12:29 +0000)]
First pass at implementing the intent of ANSI C DR106.

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

13 years agodyn_cast else unreachable -> cast
John McCall [Sat, 4 Dec 2010 09:57:16 +0000 (09:57 +0000)]
dyn_cast else unreachable -> cast

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

13 years agoMore anonymous struct/union redesign. This one deals with anonymous field used in...
Francois Pichet [Sat, 4 Dec 2010 09:14:42 +0000 (09:14 +0000)]
More anonymous struct/union redesign. This one deals with anonymous field used in a constructor initializer list:

struct X {
  X() : au_i1(123) {}
  union {
    int au_i1;
    float au_f1;
  };
};

clang will now deal with au_i1 explicitly as an IndirectFieldDecl.

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

13 years agoDon't crash when initializing a subaggregate in C from a property r-value.
John McCall [Sat, 4 Dec 2010 09:03:57 +0000 (09:03 +0000)]
Don't crash when initializing a subaggregate in C from a property r-value.

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

13 years agoMake IgnoreParenLValueCasts skip __extension__ nodes like IgnoreParens().
John McCall [Sat, 4 Dec 2010 08:24:19 +0000 (08:24 +0000)]
Make IgnoreParenLValueCasts skip __extension__ nodes like IgnoreParens().
Abramo noticed this.

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

13 years agoSilence "comparison between signed and unsigned integer expressions" warnings.
Benjamin Kramer [Sat, 4 Dec 2010 08:16:05 +0000 (08:16 +0000)]
Silence "comparison between signed and unsigned integer expressions" warnings.

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

13 years agoRemove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn't
John McCall [Sat, 4 Dec 2010 08:14:53 +0000 (08:14 +0000)]
Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn't
be required, and then fix up some missing loads on overloaded-operator
paths which that exposed.

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

13 years agoWhen deciding whether to complain about the type of a boolean condition, use
John McCall [Sat, 4 Dec 2010 06:09:13 +0000 (06:09 +0000)]
When deciding whether to complain about the type of a boolean condition, use
the type of the expression *after* array/function decay.

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

13 years agoApparently properties.m does not always fail; make it.
John McCall [Sat, 4 Dec 2010 05:22:10 +0000 (05:22 +0000)]
Apparently properties.m does not always fail;  make it.

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

13 years agoFix this test case on no-asserts builds by not trying to match the basic
John McCall [Sat, 4 Dec 2010 05:19:12 +0000 (05:19 +0000)]
Fix this test case on no-asserts builds by not trying to match the basic
block line.

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

13 years agoAlthough we currently have explicit lvalue-to-rvalue conversions, they're
John McCall [Sat, 4 Dec 2010 03:47:34 +0000 (03:47 +0000)]
Although we currently have explicit lvalue-to-rvalue conversions, they're
not actually frequently used, because ImpCastExprToType only creates a node
if the types differ.  So explicitly create an ICE in the lvalue-to-rvalue
conversion code in DefaultFunctionArrayLvalueConversion() as well as several
other new places, and consistently deal with the consequences throughout the
compiler.

In addition, introduce a new cast kind for loading an ObjCProperty l-value,
and make sure we emit those nodes whenever an ObjCProperty l-value appears
that's not on the LHS of an assignment operator.

This breaks a couple of rewriter tests, which I've x-failed until future
development occurs on the rewriter.

Ted Kremenek kindly contributed the analyzer workarounds in this patch.

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

13 years agoTest case for the l-value base only being evaluated once.
John McCall [Sat, 4 Dec 2010 03:11:00 +0000 (03:11 +0000)]
Test case for the l-value base only being evaluated once.

Also, move the l-value emission code into CGObjC.cpp and teach it, for
completeness, to store away self for a super send.

Also, inline the super cases for property gets and sets and make them
use the correct result type for implicit getter/setter calls.

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

13 years agoKill the KVC l-value kind and calculate the base expression when emitting
John McCall [Sat, 4 Dec 2010 02:32:38 +0000 (02:32 +0000)]
Kill the KVC l-value kind and calculate the base expression when emitting
the l-value.

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

13 years agoImplement -cl-std=
Peter Collingbourne [Sat, 4 Dec 2010 01:51:40 +0000 (01:51 +0000)]
Implement -cl-std=

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

13 years agoImplement -cl-mad-enable
Peter Collingbourne [Sat, 4 Dec 2010 01:51:33 +0000 (01:51 +0000)]
Implement -cl-mad-enable

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

13 years agoImplement -cl-fast-relaxed-math
Peter Collingbourne [Sat, 4 Dec 2010 01:51:23 +0000 (01:51 +0000)]
Implement -cl-fast-relaxed-math

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

13 years agoImplement -cl-unsafe-math-optimizations
Peter Collingbourne [Sat, 4 Dec 2010 01:51:14 +0000 (01:51 +0000)]
Implement -cl-unsafe-math-optimizations

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

13 years agoImplement -cl-finite-math-only
Peter Collingbourne [Sat, 4 Dec 2010 01:51:05 +0000 (01:51 +0000)]
Implement -cl-finite-math-only

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

13 years agoImplement -cl-single-precision-constant
Peter Collingbourne [Sat, 4 Dec 2010 01:50:56 +0000 (01:50 +0000)]
Implement -cl-single-precision-constant

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

13 years agoImplement -cl-opt-disable
Peter Collingbourne [Sat, 4 Dec 2010 01:50:45 +0000 (01:50 +0000)]
Implement -cl-opt-disable

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

13 years agoRefactor optimisation level code
Peter Collingbourne [Sat, 4 Dec 2010 01:50:36 +0000 (01:50 +0000)]
Refactor optimisation level code

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