]> granicus.if.org Git - clang/log
clang
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

14 years agoFix destructor and assignment operator lookup in the has_nothrow traits.
Sebastian Redl [Tue, 14 Sep 2010 23:40:14 +0000 (23:40 +0000)]
Fix destructor and assignment operator lookup in the has_nothrow traits.

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

14 years agoAdjust assertion in RegionStoreManager::RetrieveArray() to also take into account...
Ted Kremenek [Tue, 14 Sep 2010 23:29:38 +0000 (23:29 +0000)]
Adjust assertion in RegionStoreManager::RetrieveArray() to also take into account typedefs.

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

14 years agoDriver: Add a -stdlib= argument which can be used to select the C++ standard
Daniel Dunbar [Tue, 14 Sep 2010 23:12:40 +0000 (23:12 +0000)]
Driver: Add a -stdlib= argument which can be used to select the C++ standard
library to use.
 - This is currently useful for testing libc++; you can now use 'clang++
   -stdlib=libc++ t.cpp' to compile using it if installed.

 - In the future could also be used to select other standard library choices if
   alternatives become available (for example, to use an alternate C library).

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

14 years agoDriver: Factor out some code for handling the C++ standard library.
Daniel Dunbar [Tue, 14 Sep 2010 23:12:35 +0000 (23:12 +0000)]
Driver: Factor out some code for handling the C++ standard library.

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

14 years agoSimplify.
Daniel Dunbar [Tue, 14 Sep 2010 23:12:31 +0000 (23:12 +0000)]
Simplify.

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

14 years agoDon't divide-by-zero in RegionStoreManager::getSizeInElements() when getting the...
Ted Kremenek [Tue, 14 Sep 2010 23:08:34 +0000 (23:08 +0000)]
Don't divide-by-zero in RegionStoreManager::getSizeInElements() when getting the size of a VLA.  We don't track VLA extents yet,
but we should at least not crash.  Fixes <rdar://problem/8424269>.

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

14 years agoRHS of property expression assignment requires
Fariborz Jahanian [Tue, 14 Sep 2010 23:02:38 +0000 (23:02 +0000)]
RHS of property expression assignment requires
copy initialization before passing it to
a setter. Fixes radar 8427922.

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

14 years agoWhen marking the declarations in a default argument expression as
Douglas Gregor [Tue, 14 Sep 2010 22:55:20 +0000 (22:55 +0000)]
When marking the declarations in a default argument expression as
"used", at the time that the default argument itself is used, also
mark destructors that will be called by this expression. This fixes a
regression that I introduced in r113700, which broke WebKit, and fixes
<rdar://problem/8427926>.

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

14 years agoEliminate the default case in the expression-classification code, so
Douglas Gregor [Tue, 14 Sep 2010 21:51:42 +0000 (21:51 +0000)]
Eliminate the default case in the expression-classification code, so
that we're sure to keep it updated when new expression kinds
emerge. Also fixes a few little bugs in the classification of
expressions.

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

14 years agoTweak this assert.
John McCall [Tue, 14 Sep 2010 21:45:42 +0000 (21:45 +0000)]
Tweak this assert.

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

14 years agoRename 'MaxLoop' to 'MaxVisit' in AnalysisManager to more correctly reflect that...
Tom Care [Tue, 14 Sep 2010 21:35:27 +0000 (21:35 +0000)]
Rename 'MaxLoop' to 'MaxVisit' in AnalysisManager to more correctly reflect that we aborted analysis may not necessarily be due to a loop.

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

14 years agoThe paired 'operator delete' for a placement 'operator new' is always a
John McCall [Tue, 14 Sep 2010 21:34:24 +0000 (21:34 +0000)]
The paired 'operator delete' for a placement 'operator new' is always a
placement 'operator delete', even if there are no placement args (i.e.
overload resolution selected an operator new with default arguments).

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

14 years agoImplement the EH cleanup to call 'operator delete' if a new-expression throws
John McCall [Tue, 14 Sep 2010 07:57:04 +0000 (07:57 +0000)]
Implement the EH cleanup to call 'operator delete' if a new-expression throws
(but not if destructors associated with the full-expression throw).

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

14 years agoPrintFunctionNames: Fix Windows (MSV{S,C} and mingw) build.
Michael J. Spencer [Tue, 14 Sep 2010 06:39:35 +0000 (06:39 +0000)]
PrintFunctionNames: Fix Windows (MSV{S,C} and mingw) build.

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

14 years agoFix CFGBuilder crash reported in PR 8141.
Ted Kremenek [Tue, 14 Sep 2010 01:13:32 +0000 (01:13 +0000)]
Fix CFGBuilder crash reported in PR 8141.

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

14 years agoFix VLA miscompilation.
Argyrios Kyrtzidis [Tue, 14 Sep 2010 00:42:34 +0000 (00:42 +0000)]
Fix VLA miscompilation.

llvm.stacksave/llvm.stackrestore wasn't emitted for VLAs in inner scopes.
Fixes r8403108.

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

14 years agoI will not mix declaration and statements in C90.
Douglas Gregor [Tue, 14 Sep 2010 00:20:32 +0000 (00:20 +0000)]
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.
I will not mix declaration and statements in C90.

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

14 years agoRevert "CMake: Update to use standard CMake dependency tracking facilities instead"
Michael J. Spencer [Mon, 13 Sep 2010 23:54:41 +0000 (23:54 +0000)]
Revert "CMake: Update to use standard CMake dependency tracking facilities instead"

This reverts commit r113631

Conflicts:

CMakeLists.txt
lib/CodeGen/CMakeLists.txt

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

14 years agoClean up in buildbot directories.
Jakob Stoklund Olesen [Mon, 13 Sep 2010 23:26:28 +0000 (23:26 +0000)]
Clean up in buildbot directories.

This test created a statements.ll file until about a month ago. Some buildbots
still have this file in their source dir. This is the easiest way to remove the
file on all bots. Then I'll revert.

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

14 years agoAdd __char16_t and __char32_t as aliases for the C++0x char16_t and
Douglas Gregor [Mon, 13 Sep 2010 23:21:44 +0000 (23:21 +0000)]
Add __char16_t and __char32_t as aliases for the C++0x char16_t and
char32_t, respectively, but which can also be used in C++98/03
mode. Fixes <rdar://problem/8418510>.

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

14 years agoIntroduce a new kind of cursor into libclang, which covers a reference
Douglas Gregor [Mon, 13 Sep 2010 22:52:57 +0000 (22:52 +0000)]
Introduce a new kind of cursor into libclang, which covers a reference
to an "overloaded" set of declarations. This cursor kind works for
unresolved references to functions/templates (e.g., a call within a
template), using declarations, and Objective-C class and protocol
forward declarations.

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

14 years agoAdd reverse iterator for initializers in constructor. Patch by Marcin Świderski!
Ted Kremenek [Mon, 13 Sep 2010 22:26:02 +0000 (22:26 +0000)]
Add reverse iterator for initializers in constructor.  Patch by Marcin Świderski!

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