]> granicus.if.org Git - clang/log
clang
14 years agoUpdate users manual comments on X86 and ARM support.
Daniel Dunbar [Sun, 19 Sep 2010 19:26:59 +0000 (19:26 +0000)]
Update users manual comments on X86 and ARM support.

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

14 years agoFixes IRgen bug in objc++ reference binding of a
Fariborz Jahanian [Sat, 18 Sep 2010 20:47:25 +0000 (20:47 +0000)]
Fixes IRgen bug in objc++ reference binding of a
getter expression.
Fixes // rdar://8437240

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

14 years agoProblem with gnu conditional extension with missing
Fariborz Jahanian [Sat, 18 Sep 2010 19:38:38 +0000 (19:38 +0000)]
Problem with gnu conditional extension with missing
LHS and when conditional expression is an array. Since
it will be decayed, saved expression must be saved with
decayed expression. This is necessary to preserve semantics
of this extension (and prevent an IRGen crash which expects
an array to always be decayed). I am sure there will be other
cases in c++ (aggregate conditionals for example) when saving of the
expression must happen after some transformation on conditional
expression has happened.
Doug, please review.  Fixes // rdar://8446940

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

14 years agoGive the Objective-C _cmd an "unlikely" code completion priority; it's
Douglas Gregor [Sat, 18 Sep 2010 15:16:27 +0000 (15:16 +0000)]
Give the Objective-C _cmd an "unlikely" code completion priority; it's
very rarely used.

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

14 years agodo not rely on the implicit-dereference semantics of dyn_cast_or_null
Gabor Greif [Sat, 18 Sep 2010 13:00:17 +0000 (13:00 +0000)]
do not rely on the implicit-dereference semantics of dyn_cast_or_null

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

14 years agostatic local variables with destructors don't require a global destructor
John McCall [Sat, 18 Sep 2010 05:25:11 +0000 (05:25 +0000)]
static local variables with destructors don't require a global destructor
unless we're on a platform without __cxa_atexit (or use thereof has been
disabled).  This patch actually just disables the check completely for
static locals, but I've filed http://llvm.org/bugs/show_bug.cgi?id=8176 to
track the platform-specific fix.

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

14 years agoAdjust a fixup's starting branch if it's being resolved because
John McCall [Sat, 18 Sep 2010 02:24:39 +0000 (02:24 +0000)]
Adjust a fixup's starting branch if it's being resolved because
it reached the outermost scope and it hasn't yet been forwarded
to a cleanup.  Fixed PR8175.

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

14 years agoAdd another text for code completion after recovery
Douglas Gregor [Sat, 18 Sep 2010 02:10:40 +0000 (02:10 +0000)]
Add another text for code completion after recovery

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

14 years agoContinue parsing more postfix expressions, even after semantic
Douglas Gregor [Sat, 18 Sep 2010 01:28:11 +0000 (01:28 +0000)]
Continue parsing more postfix expressions, even after semantic
errors. Improves code completion in yet another case.

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

14 years agoAdded '|' delimiter to separate inline asm multiple alternative constraints for Clang...
John Thompson [Sat, 18 Sep 2010 01:15:13 +0000 (01:15 +0000)]
Added '|' delimiter to separate inline asm multiple alternative constraints for Clang side of support.

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

14 years agoAdd more error checking to attribute vecreturn
John Thompson [Sat, 18 Sep 2010 01:12:07 +0000 (01:12 +0000)]
Add more error checking to attribute vecreturn

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

14 years agoFix a bug with binding l-values to elided temporaries, and leave a couple
John McCall [Sat, 18 Sep 2010 00:58:34 +0000 (00:58 +0000)]
Fix a bug with binding l-values to elided temporaries, and leave a couple
helpful asserts behind.

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

14 years agoformatted everything to fit within 80 columns
Anton Yartsev [Sat, 18 Sep 2010 00:39:16 +0000 (00:39 +0000)]
formatted everything to fit within 80 columns

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

14 years agoTestcase for r114239.
Bill Wendling [Sat, 18 Sep 2010 00:26:29 +0000 (00:26 +0000)]
Testcase for r114239.

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

14 years agoRevert r114244 since it breaks a test in Analysis.
Tom Care [Sat, 18 Sep 2010 00:17:17 +0000 (00:17 +0000)]
Revert r114244 since it breaks a test in Analysis.

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

14 years agoIdempotentOperationChecker no longer reports errors that are post-dominated by a...
Tom Care [Sat, 18 Sep 2010 00:06:34 +0000 (00:06 +0000)]
IdempotentOperationChecker no longer reports errors that are post-dominated by a sink. This fixes some false positives that were flagged because a path was incomplete (usually in a loop).

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

14 years agoThe MMX shift-with-immediate builtins require the equivalent
Bill Wendling [Fri, 17 Sep 2010 23:46:16 +0000 (23:46 +0000)]
The MMX shift-with-immediate builtins require the equivalent
shift-with-immediate LLVM intrinsics.

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

14 years agoRemove FIXME. The type is correct.
Bill Wendling [Fri, 17 Sep 2010 23:45:24 +0000 (23:45 +0000)]
Remove FIXME. The type is correct.

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

14 years agoSema/transparent_union: Make sure to add implicit cast when constructing
Daniel Dunbar [Fri, 17 Sep 2010 23:21:43 +0000 (23:21 +0000)]
Sema/transparent_union: Make sure to add implicit cast when constructing
implicit union values for the transparent_union extension.

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

14 years agoTweak in DeclPrinter printing of uses of copy constructors. Patch by Jim Goodnow II.
Ted Kremenek [Fri, 17 Sep 2010 23:04:38 +0000 (23:04 +0000)]
Tweak in DeclPrinter printing of uses of copy constructors.  Patch by Jim Goodnow II.

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

14 years agoUpdate test
Douglas Gregor [Fri, 17 Sep 2010 23:01:08 +0000 (23:01 +0000)]
Update test

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

14 years agoImprove recovery when the middle expression of a ternary operator is ill-formed
Douglas Gregor [Fri, 17 Sep 2010 22:41:34 +0000 (22:41 +0000)]
Improve recovery when the middle expression of a ternary operator is ill-formed

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

14 years agoWhen we run into an error parsing or type-checking the left-hand side
Douglas Gregor [Fri, 17 Sep 2010 22:25:06 +0000 (22:25 +0000)]
When we run into an error parsing or type-checking the left-hand side
of a binary expression, continue on and parse the right-hand side of
the binary expression anyway, but don't call the semantic actions to
type-check. Previously, we would see the error and then, effectively,
skip tokens until the end of the statement.

The result should be more useful recovery, both in the normal case
(we'll actually see errors beyond the first one in a statement), but
it also helps code completion do a much better job, because we do
"real" code completion on the right-hand side of an invalid binary
expression rather than completing with the recovery completion. For
example, given

  x = p->y

if there is no variable named "x", we can still complete after the p->
as a member expression. Along the recovery path, we would have
completed after the "->" as if we were in an expression context, which
is mostly useless.

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

14 years agoDiagnose use of incomplete type on method argument type of
Fariborz Jahanian [Fri, 17 Sep 2010 22:07:07 +0000 (22:07 +0000)]
Diagnose use of incomplete type on method argument type of
method definitions instead of crashing in code gen.
Fixes radar 8421082.

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

14 years agoUpdate C++0x status
Douglas Gregor [Fri, 17 Sep 2010 21:37:49 +0000 (21:37 +0000)]
Update C++0x status

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

14 years agofix rdar://8445858 - __sync_* intrinsics erroneously reject ObjC pointers
Chris Lattner [Fri, 17 Sep 2010 21:12:38 +0000 (21:12 +0000)]
fix rdar://8445858 - __sync_* intrinsics erroneously reject ObjC pointers

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

14 years agoOnly assignment operator triggers property setter call.
Fariborz Jahanian [Fri, 17 Sep 2010 20:45:45 +0000 (20:45 +0000)]
Only assignment operator triggers property setter call.
Fixes radar 8437253.

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

14 years agoWhen traversing an InitListExpr, there may not be a syntactic form;
Douglas Gregor [Fri, 17 Sep 2010 20:26:51 +0000 (20:26 +0000)]
When traversing an InitListExpr, there may not be a syntactic form;
check for NULL and visit the InitListExpr we have if there is no
syntactic form.

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

14 years agoDriver: implement driver automagic support for -lcc_kext
Shantonu Sen [Fri, 17 Sep 2010 18:39:08 +0000 (18:39 +0000)]
Driver: implement driver automagic support for -lcc_kext

Rewrite linker arguments to use libclang_rt.cc_kext.a
instead of gcc-specific libcc_kext.a

Resolves Radar 7808495

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

14 years agoAdd a -ftrapv-handler= option which allows a handler to invoke instead of simply...
David Chisnall [Fri, 17 Sep 2010 18:29:54 +0000 (18:29 +0000)]
Add a -ftrapv-handler= option which allows a handler to invoke instead of simply aborting when a signed operation overflows.  This mirrors the (GCC-incompatible) behaviour from clang 1.0 and 1.1 when -ftrapv was specified, but allows the handler to be defined for each compilation unit.

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

14 years agoUse a temporary file for output which gets renamed after all the writing is finished.
Argyrios Kyrtzidis [Fri, 17 Sep 2010 17:38:48 +0000 (17:38 +0000)]
Use a temporary file for output which gets renamed after all the writing is finished.

This mainly prevents failures and/or crashes when multiple processes try to read/write the same PCH file. (rdar://8392711&8294781); suggestion & review by Daniel!

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

14 years agoFix test for no-asserts builds.
John McCall [Fri, 17 Sep 2010 17:03:41 +0000 (17:03 +0000)]
Fix test for no-asserts builds.

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

14 years agoPatch to add IRgen support for Gnu's conditional operator
Fariborz Jahanian [Fri, 17 Sep 2010 15:51:28 +0000 (15:51 +0000)]
Patch to add IRgen support for Gnu's conditional operator
extension when missing LHS. This patch covers scalar
conditionals only. Others are wip.
(pr7726, radar 8353567).

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

14 years agorename variable, 'Type' seems to be present in
Gabor Greif [Fri, 17 Sep 2010 10:21:45 +0000 (10:21 +0000)]
rename variable, 'Type' seems to be present in
the enclosing scope, which confuses gcc v3.4 to no end

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

14 years agoDriver/DarwinClang: Add GCC libexec paths so we can find the cc1 binaries if we
Daniel Dunbar [Fri, 17 Sep 2010 08:22:12 +0000 (08:22 +0000)]
Driver/DarwinClang: Add GCC libexec paths so we can find the cc1 binaries if we
ever use fallback.
 - Not necessary for clang as a compiler, but useful for testing purposes.

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

14 years agoIRgen: Change CodeGenPasses to be a PassManager, so it can have CallGraphSCC or
Daniel Dunbar [Fri, 17 Sep 2010 07:35:16 +0000 (07:35 +0000)]
IRgen: Change CodeGenPasses to be a PassManager, so it can have CallGraphSCC or
Module. Patch by Mike Gist!

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

14 years agoReapply "Driver/Darwin: Time for another spin at switching to the DarwinClang",
Daniel Dunbar [Fri, 17 Sep 2010 04:25:28 +0000 (04:25 +0000)]
Reapply "Driver/Darwin: Time for another spin at switching to the DarwinClang",
now that eprintf symbol issue is resolved.

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

14 years agoRevert "Driver/Darwin: Time for another spin at switching to the DarwinClang
Daniel Dunbar [Fri, 17 Sep 2010 03:46:37 +0000 (03:46 +0000)]
Revert "Driver/Darwin: Time for another spin at switching to the DarwinClang
toolchain.", while I investigate the totally non-surprising ensuing breakage.

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

14 years agoFix this test to use -cc1.
Daniel Dunbar [Fri, 17 Sep 2010 02:47:35 +0000 (02:47 +0000)]
Fix this test to use -cc1.

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

14 years agoDriver: Support -dumpmachine.
Daniel Dunbar [Fri, 17 Sep 2010 02:47:28 +0000 (02:47 +0000)]
Driver: Support -dumpmachine.

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

14 years agoCurrently we're initializing the vtable pointers of a class only after
John McCall [Fri, 17 Sep 2010 02:31:44 +0000 (02:31 +0000)]
Currently we're initializing the vtable pointers of a class only after
the bases are completely initialized.  This won't work --- base
initializer expressions can rely on the vtables having been set up.
Check for uses of 'this' in the initializers and force a vtable
initialization if found.

This might not be good enough;  we might need to extend this to handle
the possibility of arbitrary code finding an external reference to this
(not yet completely-constructed!) object and accessing through it,
in which case we'll probably find ourselves doing a lot more unnecessary
stores.

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

14 years agoDriver/Darwin: Time for another spin at switching to the DarwinClang toolchain.
Daniel Dunbar [Fri, 17 Sep 2010 01:56:41 +0000 (01:56 +0000)]
Driver/Darwin: Time for another spin at switching to the DarwinClang toolchain.

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

14 years agoDriver: Fix spelling of AddCXXStdlibLibArgs, which I copy-n-pasto'd.
Daniel Dunbar [Fri, 17 Sep 2010 01:20:05 +0000 (01:20 +0000)]
Driver: Fix spelling of AddCXXStdlibLibArgs, which I copy-n-pasto'd.

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

14 years agoDriver/DarwinClang: The new toolchain definition is going to drop the -L inside
Daniel Dunbar [Fri, 17 Sep 2010 01:16:06 +0000 (01:16 +0000)]
Driver/DarwinClang: The new toolchain definition is going to drop the -L inside
the GCC dir. Unfortunately, this breaks -lstdc++ on SnowLeopard, etc. because
the libstdc++ dylib was hiding there. Workaround this by providing the path to
the right -lstdc++.6 (the only version used in recent memory) if we can't see an
obvious -lstdc++, but can find = -lstdc++.6.

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

14 years agoWhen emitting a new-expression inside a conditional expression,
John McCall [Fri, 17 Sep 2010 00:50:28 +0000 (00:50 +0000)]
When emitting a new-expression inside a conditional expression,
the cleanup might not be dominated by the allocation code.
In this case, we have to store aside all the delete arguments
in case we need them later.  There's room for optimization here
in cases where we end up not actually needing the cleanup in
different branches (or being able to pop it after the
initialization code).

Also make sure we only call this operator delete along the path
where we actually allocated something.

Fixes rdar://problem/8439196.

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

14 years agoDriver: Add magic handling for "reserved library names", starting with
Daniel Dunbar [Fri, 17 Sep 2010 00:45:02 +0000 (00:45 +0000)]
Driver: Add magic handling for "reserved library names", starting with
-lstdc++. This is the best gross solution for a gross problem.

This issue is that historically, GCC has add -L options to its internally
library directories. This has allowed users and platforms to end up depending on
the layout of GCC's internal library directories.

We want to correct this mistake by eliminating that -L, but this means that
existing libraries which are in the GCC lib dir won't be found. We are going to
handle this by treating those -l names as "reserved", and requiring toolchains
to know how to add the right full path to the reserved library.

The immediately side effect of this is that users trying to use -L to find their
own -lstdc++ will need to start using -nostdlib (which is a good idea
anyway). Another side effect is that -stdlib=libc++ -lstdc++ will now do the
"right" thing, for curious definitions of right.

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

14 years agoHandle '#line' in '-E' that has an empty file name. Fixes <rdar://problem/8439412>.
Ted Kremenek [Fri, 17 Sep 2010 00:41:18 +0000 (00:41 +0000)]
Handle '#line' in '-E' that has an empty file name.  Fixes <rdar://problem/8439412>.

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

14 years agoDriver: Factor out AddLinkerInputs() function.
Daniel Dunbar [Fri, 17 Sep 2010 00:24:54 +0000 (00:24 +0000)]
Driver: Factor out AddLinkerInputs() function.

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

14 years agoDriver: Add a toolchain hook for whether the system has native LLVM support.
Daniel Dunbar [Fri, 17 Sep 2010 00:24:52 +0000 (00:24 +0000)]
Driver: Add a toolchain hook for whether the system has native LLVM support.

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

14 years agoWhen dealing with an anonymous enumeration declared in function
Douglas Gregor [Thu, 16 Sep 2010 23:58:57 +0000 (23:58 +0000)]
When dealing with an anonymous enumeration declared in function
prototype scope, temporarily set the context of the enumeration
declaration to the translation unit. We do the same thing for
parameters, until we have an actual function declaration on which to
hang them. Fixes <rdar://problem/8435682>.

There is more work to do in this area, since we have existing bugs
with tags being declared/defined in function parameter lists. This fix
is correct, and we'll end up extending it when we deal with those
existing bugs.

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

14 years agoIRgen/ABI/x86-32: Realign indirect arguments when the ABI requires us to pass
Daniel Dunbar [Thu, 16 Sep 2010 20:42:06 +0000 (20:42 +0000)]
IRgen/ABI/x86-32: Realign indirect arguments when the ABI requires us to pass
them with a smaller alignment than the rest of codegen expects.

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

14 years agoIRgen/ABI: Add support for realigning structures which are passed by indirect
Daniel Dunbar [Thu, 16 Sep 2010 20:42:02 +0000 (20:42 +0000)]
IRgen/ABI: Add support for realigning structures which are passed by indirect
reference.

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

14 years agoIRgen/ABI/x86_32/Darwin: On Darwin, only structures with SSE vector types get passed
Daniel Dunbar [Thu, 16 Sep 2010 20:42:00 +0000 (20:42 +0000)]
IRgen/ABI/x86_32/Darwin: On Darwin, only structures with SSE vector types get passed
with a non-default-stack-ABI-alignment (of 16).
 - This fixes the ABI convenient, but breaks codegen since we now have
   underaligned arguments. Marginal improvement overall though, and will be
   fixed in next commit.

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

14 years agoIRgen/x86_32/Linux: Linux seems to align all stack objects to 4 bytes, unlike
Daniel Dunbar [Thu, 16 Sep 2010 20:41:56 +0000 (20:41 +0000)]
IRgen/x86_32/Linux: Linux seems to align all stack objects to 4 bytes, unlike
Darwin. Checked vs the handiest Linux llvm-gcc I had around, someone on Linux is
welcome to investigate more.

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

14 years agoadd a compatibility note about vector builtins
Chris Lattner [Thu, 16 Sep 2010 18:17:55 +0000 (18:17 +0000)]
add a compatibility note about vector builtins

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

14 years agoimprove the "enumeration value 'g' not handled in switch"
Chris Lattner [Thu, 16 Sep 2010 17:09:42 +0000 (17:09 +0000)]
improve the "enumeration value 'g' not handled in switch"
warning to handle multiple enumerators with one warning.

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

14 years agoSwap the priorities of constants and types, so that we prefer types.
Douglas Gregor [Thu, 16 Sep 2010 16:21:35 +0000 (16:21 +0000)]
Swap the priorities of constants and types, so that we prefer types.

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

14 years agoRemoves unused setter.
Fariborz Jahanian [Thu, 16 Sep 2010 16:14:34 +0000 (16:14 +0000)]
Removes unused setter.

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

14 years agoDon't add two code-completion results for the same selector; it
Douglas Gregor [Thu, 16 Sep 2010 16:06:31 +0000 (16:06 +0000)]
Don't add two code-completion results for the same selector; it
doesn't add any value. Instead, we'll just take the first method with
that selector that we find and create a completion for it.

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

14 years agoWhen collecting Objective-C methods for message send completions, be
Douglas Gregor [Thu, 16 Sep 2010 15:34:59 +0000 (15:34 +0000)]
When collecting Objective-C methods for message send completions, be
sure to visit the protocols of protocols.

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

14 years agoImplement code completion for Objective-C class message sends that are
Douglas Gregor [Thu, 16 Sep 2010 15:14:18 +0000 (15:14 +0000)]
Implement code completion for Objective-C class message sends that are
missing the opening bracket '[', e.g.,

  NSArray <CC>

at function scope. Previously, we would only give trivial completions
(const, volatile, etc.), because we're in a "declaration name"
scope. Now, we also provide completions for class methods of NSArray,
e.g.,

  alloc

Note that we already had support for this after the first argument,
e.g.,

  NSArray method:x <CC>

would get code completion for class methods of NSArray whose selector
starts with "method:". This was already present because we recover
as if NSArray method:x were a class message send missing the opening
bracket (which was committed in r114057).

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

14 years agoFix a silly typo and its pasteo. Thanks to Francois Pichet for noticing my mistake
Douglas Gregor [Thu, 16 Sep 2010 13:54:00 +0000 (13:54 +0000)]
Fix a silly typo and its pasteo. Thanks to Francois Pichet for noticing my mistake

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

14 years agoRight, there are *two* cases of pr-value class-type expressions that don't
John McCall [Thu, 16 Sep 2010 06:57:56 +0000 (06:57 +0000)]
Right, there are *two* cases of pr-value class-type expressions that don't
derive from temporaries of the same type.  Black-list member expressions
as well.

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

14 years agoOpportunistically use the C++ personality function in ObjC++
John McCall [Thu, 16 Sep 2010 06:16:50 +0000 (06:16 +0000)]
Opportunistically use the C++ personality function in ObjC++
translation units that don't catch ObjC types.  rdar://problem/8434851

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

14 years agoBasic: Add f{dim,ma,max,min}[lf]? builtins.
Daniel Dunbar [Thu, 16 Sep 2010 05:20:04 +0000 (05:20 +0000)]
Basic: Add f{dim,ma,max,min}[lf]? builtins.

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

14 years agoRefactored BugReporter to refer to EndNode as ErrorNode. We currently make the assump...
Tom Care [Thu, 16 Sep 2010 03:50:38 +0000 (03:50 +0000)]
Refactored BugReporter to refer to EndNode as ErrorNode. We currently make the assumption that EndNode == ErrorNode, but upcoming changes will break this.

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

14 years agoTidy up.
Zhongxing Xu [Thu, 16 Sep 2010 03:28:18 +0000 (03:28 +0000)]
Tidy up.

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

14 years agoFurther beautification: this pointer can now be typed.
John McCall [Thu, 16 Sep 2010 03:16:41 +0000 (03:16 +0000)]
Further beautification:  this pointer can now be typed.

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

14 years agoInitialize AggValueSlot's flags along all paths, plus minor beautification.
John McCall [Thu, 16 Sep 2010 03:13:23 +0000 (03:13 +0000)]
Initialize AggValueSlot's flags along all paths, plus minor beautification.
Prospective fix for broken commit in r114045.

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

14 years agoFix the clang build after Zhongxing Xu's commit.
John McCall [Thu, 16 Sep 2010 03:09:43 +0000 (03:09 +0000)]
Fix the clang build after Zhongxing Xu's commit.

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

14 years agoImplement automatic bracket insertion for Objective-C class message
Douglas Gregor [Thu, 16 Sep 2010 01:51:54 +0000 (01:51 +0000)]
Implement automatic bracket insertion for Objective-C class message
sends. These are far trickier than instance messages, because we
typically have something like

  NSArray alloc]

where it appears to be a declaration of a variable named "alloc" up
until we see the ']' (or a ':'), and at that point we can't backtrace.
So, we use a combination of syntactic and semantic disambiguation to
treat this as a message send only when the type is an Objective-C type
and it has the syntax of a class message send (which would otherwise
be ill-formed).

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

14 years agoIntroduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patch
Zhongxing Xu [Thu, 16 Sep 2010 01:25:47 +0000 (01:25 +0000)]
Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patch
and discussions with Ted and Jordy.

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

14 years agobuild: Add support for a CLANG_ORDER_FILE build variable to specify the path to
Daniel Dunbar [Thu, 16 Sep 2010 00:42:38 +0000 (00:42 +0000)]
build: Add support for a CLANG_ORDER_FILE build variable to specify the path to
the order file to use for the clang executable.

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

14 years agoDo not warn about empty bodies for 'if' statements if the body is expanded from a...
Ted Kremenek [Thu, 16 Sep 2010 00:37:05 +0000 (00:37 +0000)]
Do not warn about empty bodies for 'if' statements if the body is expanded from a macro.

Fixes <rdar://problem/8436021>.

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

14 years agoPatch to move RequiresGCollection bit to
Fariborz Jahanian [Thu, 16 Sep 2010 00:20:07 +0000 (00:20 +0000)]
Patch to move RequiresGCollection bit to
AggValueSlot slot.

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

14 years agoFor self-comparison warning, check the source location of both the LHS and RHS to...
Ted Kremenek [Thu, 16 Sep 2010 00:03:01 +0000 (00:03 +0000)]
For self-comparison warning, check the source location of both the LHS and RHS to see if they
are expanded from macros (and if so, omit the warning).  Previously we were just looking at the
location of the binary expression.

Fixes <rdar://problem/8435950>.

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

14 years agoHandle bracket insertion for Objective-C class messages in a very
Douglas Gregor [Wed, 15 Sep 2010 23:19:31 +0000 (23:19 +0000)]
Handle bracket insertion for Objective-C class messages in a very
narrow, almost useless case where we're inside a parenthesized
expression, e.g.,

  (NSArray alloc])

The solution to the general case still eludes me.

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

14 years agoTweak comment as suggested by Sebastian.
John McCall [Wed, 15 Sep 2010 20:59:13 +0000 (20:59 +0000)]
Tweak comment as suggested by Sebastian.

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

14 years agoWhile handling change of file, check if _current_ file is already seen or not. If...
Devang Patel [Wed, 15 Sep 2010 20:50:40 +0000 (20:50 +0000)]
While handling change of file, check if _current_ file is already seen or not. If current file is seen then it indicates that end of previous file's lexical scope.
This fixes radar 8396182.

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

14 years agoMacro definitions in AST files have their own IDs.
Sebastian Redl [Wed, 15 Sep 2010 19:54:06 +0000 (19:54 +0000)]
Macro definitions in AST files have their own IDs.

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

14 years agoInitialize TypeOrExpr to NULL to silence a false-positive uninitialized warning
Nick Lewycky [Wed, 15 Sep 2010 18:35:19 +0000 (18:35 +0000)]
Initialize TypeOrExpr to NULL to silence a false-positive uninitialized warning
from certain GCC's. Patch by Neil Vachharajani!

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

14 years agoTest commit
Marcin Swiderski [Wed, 15 Sep 2010 18:34:15 +0000 (18:34 +0000)]
Test commit

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

14 years agoRevert "Clean up in buildbot directories."
Jakob Stoklund Olesen [Wed, 15 Sep 2010 18:08:14 +0000 (18:08 +0000)]
Revert "Clean up in buildbot directories."

This reverts commit 113814.

This patch was never intended to stay in the repository. If you are reading this
from the future, we apologize for the noise.

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

14 years agoImprove code completion for Objective-C message sends when the opening
Douglas Gregor [Wed, 15 Sep 2010 16:23:04 +0000 (16:23 +0000)]
Improve code completion for Objective-C message sends when the opening
'[' is missing. Prior commits improving recovery also improved code
completion beyond the first selector, e.g., at or after the "to" in

  calculator add:x to:y

but not after "calculator". We now provide the same completions for

  calculator <CC>

that we would for

  [calculator <CC>

if "calculator" is an expression whose type is something that can
receive Objective-C messages.

This code completion works for instance and super message sends, but not
class message sends.

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

14 years agoMake the new -fobjc-nonfragile-abi2 the default
Fariborz Jahanian [Wed, 15 Sep 2010 16:00:51 +0000 (16:00 +0000)]
Make the new -fobjc-nonfragile-abi2 the default
abi for clang's objective-c compilations.
(radar 8353555).

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

14 years agoExtend bracket insertion to message sends to "super", e.g.,
Douglas Gregor [Wed, 15 Sep 2010 15:09:43 +0000 (15:09 +0000)]
Extend bracket insertion to message sends to "super", e.g.,

  super method:arg]

will now recover nicely and insert the '[' before 'super'.

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

14 years agoExtend bracket insertion to handle nullary selectors, e.g.
Douglas Gregor [Wed, 15 Sep 2010 14:54:45 +0000 (14:54 +0000)]
Extend bracket insertion to handle nullary selectors, e.g.

  a getFoo]

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

14 years agoImplement bracket insertion for Objective-C instance message sends as
Douglas Gregor [Wed, 15 Sep 2010 14:51:05 +0000 (14:51 +0000)]
Implement bracket insertion for Objective-C instance message sends as
part of parser recovery. For example, given:

  a method1:arg];

we detect after parsing the expression "a" that we have the start of a
message send expression. We pretend we've seen a '[' prior to the a,
then parse the remainder as a message send. We'll then give a
diagnostic+fix-it such as:

fixit-objc-message.m:17:3: error: missing '[' at start of message
      send expression
  a method1:arg];
  ^
  [

The algorithm here is very simple, and always assumes that the open
bracket goes at the beginning of the message send. It also only works
for non-super instance message sends at this time.

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

14 years agoTweak regex not to accidentally match a trailing \r.
Benjamin Kramer [Wed, 15 Sep 2010 12:31:46 +0000 (12:31 +0000)]
Tweak regex not to accidentally match a trailing \r.

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

14 years agoFix pointer-signext.c test case: it was relying on value names, which don't appear...
Cameron Esfahani [Wed, 15 Sep 2010 10:52:02 +0000 (10:52 +0000)]
Fix pointer-signext.c test case: it was relying on value names, which don't appear in the non-assert build.  Switch to using check-next as well.

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

14 years agoTest hardening.
John McCall [Wed, 15 Sep 2010 10:38:11 +0000 (10:38 +0000)]
Test hardening.

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

14 years agoone piece of code is responsible for the lifetime of every aggregate
John McCall [Wed, 15 Sep 2010 10:14:12 +0000 (10:14 +0000)]
one piece of code is responsible for the lifetime of every aggregate
slot.  The easiest way to do that was to bundle up the information
we care about for aggregate slots into a new structure which demands
that its creators at least consider the question.

I could probably be convinced that the ObjC 'needs GC' bit should
be rolled into this structure.
Implement generalized copy elision.  The main obstacle here is that
IR-generation must be much more careful about making sure that exactly

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

14 years agoRelax assertion in CFG builder when processing ForStmts. This fixes an assertion...
Ted Kremenek [Wed, 15 Sep 2010 07:01:20 +0000 (07:01 +0000)]
Relax assertion in CFG builder when processing ForStmts.  This fixes an assertion failure
on code containing GNU statement expressions reported in PR 8141.

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

14 years agobuild: Start sketching code to allow grafting libc++ build into LLVM/Clang build if
Daniel Dunbar [Wed, 15 Sep 2010 03:53:45 +0000 (03:53 +0000)]
build: Start sketching code to allow grafting libc++ build into LLVM/Clang build if
libc++ is checked out into llvm/projects.
 - WIP, not on by default yet.

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

14 years agoDisallow the use of UnknownVal as the index for ElementRegions. UnknownVals can...
Ted Kremenek [Wed, 15 Sep 2010 03:13:30 +0000 (03:13 +0000)]
Disallow the use of UnknownVal as the index for ElementRegions.  UnknownVals can be used as
the index when the value evaluation isn't powerful enough.  By creating ElementRegions with
UnknownVals as the index, this gives the false impression that they are the same element, when
they really aren't.  This becomes really problematic when deriving symbols from these regions
(e.g., those representing the initial value of the index), since two different indices will
get the same symbol for their binding.

This fixes an issue with the idempotent operations checker that would cause two indices that
are clearly not the same to make it appear as if they always had the same value.

Fixes <rdar://problem/8431728>.

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

14 years agoFix classification of statement expressions.
Douglas Gregor [Wed, 15 Sep 2010 01:37:48 +0000 (01:37 +0000)]
Fix classification of statement expressions.

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

14 years agoFix Windows64 target info so pointer arithmetic is done correctly, and no sign extens...
Cameron Esfahani [Wed, 15 Sep 2010 00:28:12 +0000 (00:28 +0000)]
Fix Windows64 target info so pointer arithmetic is done correctly, and no sign extension code is emitted: PtrDiffType needs to be a signed long long.  Add a corresponding test case.

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

14 years agoMicrosoft's flexible array rules relaxation:
Francois Pichet [Wed, 15 Sep 2010 00:14:08 +0000 (00:14 +0000)]
Microsoft's flexible array rules relaxation:
   - in union
   - as the only element of a struct/class.

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

14 years agoIntroduce a new code-completion context for a parenthesized
Douglas Gregor [Tue, 14 Sep 2010 23:59:36 +0000 (23:59 +0000)]
Introduce a new code-completion context for a parenthesized
expression, e.g., after the '(' that could also be a type cast. Here,
we provide types as code-completion results in C/Objective-C (C++
already had them), although we wouldn't in a normal expression context.

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

14 years agoAdd CFG::BuildOptions class to pass in CFG builder options under on parameter. Patch...
Ted Kremenek [Tue, 14 Sep 2010 23:41:16 +0000 (23:41 +0000)]
Add CFG::BuildOptions class to pass in CFG builder options under on parameter.  Patch by Marcin Ĺšwiderski!

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