]> granicus.if.org Git - clang/log
clang
14 years agoAdjust for debug info API change.
Benjamin Kramer [Tue, 21 Sep 2010 15:59:59 +0000 (15:59 +0000)]
Adjust for debug info API change.

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

14 years agoDo not warn with -Wuninitialized when the member is used in a sizeof or address-of...
Argyrios Kyrtzidis [Tue, 21 Sep 2010 10:47:20 +0000 (10:47 +0000)]
Do not warn with -Wuninitialized when the member is used in a sizeof or address-of expression.
Fixes rdar://8331312.

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

14 years agoAdded:
Marcin Swiderski [Tue, 21 Sep 2010 05:58:15 +0000 (05:58 +0000)]
Added:
- definitions of interfaces for CFGInitializer and CFGAutomaticObjDtor,
- support for above classes to print_elem function (renamed print_stmt),
- support for VarDecls in StmtPrinterHelper.

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

14 years agoFix indentation.
Ted Kremenek [Tue, 21 Sep 2010 04:47:01 +0000 (04:47 +0000)]
Fix indentation.

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

14 years agoCheck for null ObjCInterfaceDecls returned from getClassInterface() when generating...
Ted Kremenek [Tue, 21 Sep 2010 04:45:46 +0000 (04:45 +0000)]
Check for null ObjCInterfaceDecls returned from getClassInterface() when generating USRs.  While I have no test case for this (could not create one), this shows up in crash reports.  Tentatively fixes <rdar://problem/8452791>.

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

14 years agoAdd a comment explaining why the MMX builtins are segregated and what we plan on
Bill Wendling [Tue, 21 Sep 2010 01:39:34 +0000 (01:39 +0000)]
Add a comment explaining why the MMX builtins are segregated and what we plan on
doing with them. It's a "FIXME" right now because this change hasn't been
implemented yet.

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

14 years agoWhen providing code completions for an argument in an Objective-C
Douglas Gregor [Tue, 21 Sep 2010 00:03:25 +0000 (00:03 +0000)]
When providing code completions for an argument in an Objective-C
message send, e.g.,

  [[NSString alloc] initWithCString:<CC>

look up all of the possible methods and determine the preferred type
for the argument expression based on the type of the corresponding
parameter.

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

14 years agoImplements in IRgen gnu extensions missing LHS for
Fariborz Jahanian [Mon, 20 Sep 2010 23:50:22 +0000 (23:50 +0000)]
Implements in IRgen gnu extensions missing LHS for
complex conditionals. Radar 8453812.

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

14 years agoRefactor code completion for expressions that occur as arguments in
Douglas Gregor [Mon, 20 Sep 2010 23:34:21 +0000 (23:34 +0000)]
Refactor code completion for expressions that occur as arguments in
Objective-C message sends. There is no functionality change here; this
is prep work for using the parameter types to help guide the
expression results when code-completing the argument.

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

14 years agoCode completion has no reason to prefer values over types, especially
Douglas Gregor [Mon, 20 Sep 2010 23:11:55 +0000 (23:11 +0000)]
Code completion has no reason to prefer values over types, especially
at the statement level or in Objective-C message receivers. Therefore,
just give types and declarations the same basic priority, and adjust
from there.

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

14 years agoCheck in support for OpenCL conditional operator on vector types.
Nate Begeman [Mon, 20 Sep 2010 22:41:17 +0000 (22:41 +0000)]
Check in support for OpenCL conditional operator on vector types.

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

14 years agoSlight refactoring in code-completion results generation, placing the
Douglas Gregor [Mon, 20 Sep 2010 22:39:41 +0000 (22:39 +0000)]
Slight refactoring in code-completion results generation, placing the
various priority adjustments for preferences (based on selectors,
types) in a single function to make extension easier.

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

14 years agoGet rid of the lame attempt to prioritize "void" functions at
Douglas Gregor [Mon, 20 Sep 2010 21:25:19 +0000 (21:25 +0000)]
Get rid of the lame attempt to prioritize "void" functions at
statement context; it really isn't helpful in practice (remember
printf!) and we'll be doing other adjustments for statements very soon.

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

14 years agoTweak priorities for some types and macros:
Douglas Gregor [Mon, 20 Sep 2010 21:11:48 +0000 (21:11 +0000)]
Tweak priorities for some types and macros:
  - In Objective-C, we prefer BOOL to bool for historic reasons;
  slightly penalize "bool".
  - Treat Nil macro as a NULL pointer constant.
  - Treat YES, NO, true, and false macros as constants.
  - Treat the bool macro as a type.

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

14 years agoThe builtins __builtin_ia32_paddq and __builtin_ia32_psubq were missing.
Bill Wendling [Mon, 20 Sep 2010 20:40:00 +0000 (20:40 +0000)]
The builtins __builtin_ia32_paddq and __builtin_ia32_psubq were missing.

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

14 years agoIntroduce a simple, substitution-based compression scheme for USRs, so
Douglas Gregor [Mon, 20 Sep 2010 20:37:39 +0000 (20:37 +0000)]
Introduce a simple, substitution-based compression scheme for USRs, so
that redundant types don't result in super-long USRs. Fixes
<rdar://problem/8447875>.

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

14 years agoFix CMake clangIndex library dependencies, from Logan Chien
Douglas Gregor [Mon, 20 Sep 2010 18:32:29 +0000 (18:32 +0000)]
Fix CMake clangIndex library dependencies, from Logan Chien

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

14 years agoDriver/Objective-C: Retool Objective-C ABI flags to be more usable, and actually
Daniel Dunbar [Mon, 20 Sep 2010 18:19:55 +0000 (18:19 +0000)]
Driver/Objective-C: Retool Objective-C ABI flags to be more usable, and actually
document behavior. Will wonders never cease.

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

14 years agoCheck that an overloaded function name, when used by the ! operator,
Douglas Gregor [Mon, 20 Sep 2010 17:13:33 +0000 (17:13 +0000)]
Check that an overloaded function name, when used by the ! operator,
actually resolves to a particular function. Fixes PR8181, from Faisal
Vali!

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

14 years agoGive implicitly-defined default constructors and destructors empty
Douglas Gregor [Mon, 20 Sep 2010 16:48:21 +0000 (16:48 +0000)]
Give implicitly-defined default constructors and destructors empty
bodies, from Martin Vejnar!

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

14 years agoRevert r114316, -Wunused-value enabled by default was intended.
Argyrios Kyrtzidis [Sun, 19 Sep 2010 23:03:35 +0000 (23:03 +0000)]
Revert r114316, -Wunused-value enabled by default was intended.

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

14 years agoMake -Wunused-value off by default, matching GCC. Fixes rdar://7126194.
Argyrios Kyrtzidis [Sun, 19 Sep 2010 21:21:44 +0000 (21:21 +0000)]
Make -Wunused-value off by default, matching GCC. Fixes rdar://7126194.

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

14 years agoImplement -Wunused-label.
Argyrios Kyrtzidis [Sun, 19 Sep 2010 21:21:25 +0000 (21:21 +0000)]
Implement -Wunused-label.

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

14 years agoWarn when an expression result in a LabelStmt is unused.
Argyrios Kyrtzidis [Sun, 19 Sep 2010 21:21:10 +0000 (21:21 +0000)]
Warn when an expression result in a LabelStmt is unused.

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

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