]>
granicus.if.org Git - clang/log
Anders Carlsson [Wed, 27 May 2009 16:45:02 +0000 (16:45 +0000)]
IRgen support for calls to functions that return references to aggregate exressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72479
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 27 May 2009 16:38:58 +0000 (16:38 +0000)]
Fix another test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72478
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 27 May 2009 16:28:34 +0000 (16:28 +0000)]
Relax an assert to an if check.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72477
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 27 May 2009 16:27:50 +0000 (16:27 +0000)]
Initialize ObjCSenderDispatch in LangOptions.
Patch by Benjamin Kramer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72476
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Wed, 27 May 2009 16:21:00 +0000 (16:21 +0000)]
Convert ObjC qualified type clients over to using iterators.
This allows me to remove some API that I don't want to carry over to ObjCObjectPointerType.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72475
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 27 May 2009 16:10:08 +0000 (16:10 +0000)]
Create CXXConstructExprs when constructing via copy initialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72474
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 27 May 2009 06:04:58 +0000 (06:04 +0000)]
Fix up constant expression handling to deal with the address
of a reference correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72463
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 27 May 2009 05:39:06 +0000 (05:39 +0000)]
Add IRGen support for local variables of reference type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72462
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 27 May 2009 05:35:12 +0000 (05:35 +0000)]
Initial stab at a generalized operation for determining the
instantiation of a declaration from the template version (or version
that lives in a template) and a given set of template arguments. This
needs much, much more testing, but it suffices for simple examples
like
typedef T* iterator;
iterator begin();
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72461
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 27 May 2009 05:00:47 +0000 (05:00 +0000)]
Don't drop the computed implicit conversions when building a call to
overloaded operator[] or overloaded postfix unary operator (++,
--). Thanks to Eli for finding this bug!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72460
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 27 May 2009 04:56:12 +0000 (04:56 +0000)]
Add IRGen support for return statements in functions with reference
type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72459
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 27 May 2009 04:18:27 +0000 (04:18 +0000)]
Handle operator call expressions where the callee is a member function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72458
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 27 May 2009 03:37:57 +0000 (03:37 +0000)]
Functions that return references can be rvalues as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72457
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 27 May 2009 01:46:48 +0000 (01:46 +0000)]
Add another test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72450
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 27 May 2009 01:45:47 +0000 (01:45 +0000)]
Add support for emitting calls to functions that return references (as lvalues only for now)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72449
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Wed, 27 May 2009 01:42:21 +0000 (01:42 +0000)]
Fix typo. I also fixed the hard to read case differences, so that no
one else is tempted to copy the style, incorrectly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72448
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 27 May 2009 01:22:39 +0000 (01:22 +0000)]
Rename an EmitCallExpr function to EmitCall to make it clear that it doesn't emit an expr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72446
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Tue, 26 May 2009 23:35:31 +0000 (23:35 +0000)]
Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72444
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Tue, 26 May 2009 23:10:55 +0000 (23:10 +0000)]
And an additional testcase that also works.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72441
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 26 May 2009 22:09:24 +0000 (22:09 +0000)]
Template instantiation for "typeof" for both types and expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72440
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Tue, 26 May 2009 22:03:21 +0000 (22:03 +0000)]
Fixup codegen for volatile structs in the trivial cases (a a=a and a=a=a).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72439
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 26 May 2009 21:27:04 +0000 (21:27 +0000)]
A simple dynamic array class template, to be used as a test-bed for template instantiation
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72437
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 26 May 2009 20:50:29 +0000 (20:50 +0000)]
Make sure that CodeGen sees template instantiations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72433
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 26 May 2009 19:40:20 +0000 (19:40 +0000)]
Use .data() instead of &...[0].
- Just SmallVectors this time.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72432
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Tue, 26 May 2009 18:57:45 +0000 (18:57 +0000)]
Esnure that if we have a volatile structure as the destination, that
we actually have a destination.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72429
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 26 May 2009 18:54:04 +0000 (18:54 +0000)]
When evaluating a VarDecl as a constant or determining whether it is
an integral constant expression, maintain a cache of the value and the
is-an-ICE flag within the VarDecl itself. This eliminates
exponential-time behavior of the Fibonacci template metaprogram.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72428
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 26 May 2009 18:00:25 +0000 (18:00 +0000)]
Revert to using &...[0] for std::vector, apparently .data isn't generally
available (and it isn't necessary in this case).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72425
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 26 May 2009 17:13:50 +0000 (17:13 +0000)]
Use .data() vs &...[0]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72420
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 26 May 2009 16:37:37 +0000 (16:37 +0000)]
When trying to pass an argument on the stack, assume LLVM will do the right
thing for non-aggregate types.
- Otherwise we unnecessarily pin values to the stack and currently end up
triggering a backend bug in one case.
- This loose cooperation with LLVM to implement the ABI is pretty ugly.
- <rdar://problem/
6918722 > [irgen] clang miscompile of many pointer varargs on
x86-64
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72419
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 26 May 2009 16:15:44 +0000 (16:15 +0000)]
The driver/diagnostic client don't need to be on the heap.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72418
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 26 May 2009 15:22:25 +0000 (15:22 +0000)]
An Obj-C message send expression can never have a reference type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72417
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 26 May 2009 14:40:08 +0000 (14:40 +0000)]
Simplify printing of the statistics for types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72415
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Tue, 26 May 2009 07:52:18 +0000 (07:52 +0000)]
Fix for PR4140: Add the start of a Linux toolchain (basically, just
barely enough to get the given usage of -print-file-name working).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72412
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 26 May 2009 04:57:27 +0000 (04:57 +0000)]
Add a new CallExpr::getCallReturnType and use it in Expr::isLvalueInternal. No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72410
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 26 May 2009 02:03:20 +0000 (02:03 +0000)]
A block that returns a reference is an lvalue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72409
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Tue, 26 May 2009 01:22:57 +0000 (01:22 +0000)]
Handle the edge case of a weak function with incomplete type correctly.
Found by code inspection; I haven't seen this in real-world code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72408
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 26 May 2009 01:04:47 +0000 (01:04 +0000)]
Remove a bunch of unused constructors
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72407
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 26 May 2009 00:57:47 +0000 (00:57 +0000)]
Remove AstGuard.h from Xcode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72406
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 25 May 2009 22:07:09 +0000 (22:07 +0000)]
Minor build system changes to make ABITest work correctly on Linux.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72405
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 25 May 2009 21:38:01 +0000 (21:38 +0000)]
Some minor corrections: don't use offsetof on a bitfield, and cast
printf operands to long to suppress warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72404
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 25 May 2009 21:27:19 +0000 (21:27 +0000)]
Extend getPreferredTypeAlign to handle _Complex double and long long
correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72401
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 25 May 2009 19:41:42 +0000 (19:41 +0000)]
PR4122: Tweak the ambiguity handling to handle (S())() correctly. I've
left out handling for stuff like (S())++ for the moment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72394
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 25 May 2009 18:23:36 +0000 (18:23 +0000)]
tweak non-null check to put the caret on the function, but underline the
argument. This avoids the argument from being silenced when the argument is
the NULL macro, which is defined in a system header. This also makes the output
a bit nicer, e.g.:
t.c:8:3: warning: null passed to a callee which requires a non-null argument
func1(NULL, cp2, i1);
^ ~~~~
vs something like:
t.c:8:10: warning: argument is null where non-null is required
func1(NULL, cp2, i1);
^
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72393
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 25 May 2009 18:20:11 +0000 (18:20 +0000)]
merge two tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72392
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 25 May 2009 18:18:56 +0000 (18:18 +0000)]
reword a warning for clarity
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72391
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 25 May 2009 18:13:00 +0000 (18:13 +0000)]
default -Wnonnull to on.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72390
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 25 May 2009 18:10:41 +0000 (18:10 +0000)]
move some format group options around in the file. Move NonNull group into
DiagnosticGroups.td, and add it as part of -Wformat (which gets it into -Wall).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72389
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 25 May 2009 17:16:10 +0000 (17:16 +0000)]
Fix a couple of bugs:
1. When we accept "#garbage" in asm-with-cpp mode, change the token kind
of the # to unknown so that the preprocessor won't try to process it as
a real #. This fixes a crash on the attached example
2. Fix macro definition extents processing to handle #foo at the end of a
macro to say the definition ends with the foo, not the #.
This is a follow-on fix to r72283, and rdar://
6916026
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72388
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 25 May 2009 16:23:08 +0000 (16:23 +0000)]
improve comment, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72386
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 25 May 2009 16:14:52 +0000 (16:14 +0000)]
fix this test to fail when the patch isn't applied.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72385
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sun, 24 May 2009 19:25:46 +0000 (19:25 +0000)]
Make sure an invalid concatentaion doesn't insert whitespace before
the RHS. Fixes assembler-with-cpp issue reported on cfe-dev.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72370
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 24 May 2009 01:40:10 +0000 (01:40 +0000)]
Another tweak to the clang Getting Started page.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72355
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 24 May 2009 01:00:12 +0000 (01:00 +0000)]
Minor updates to the clang Getting Started page.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72354
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sat, 23 May 2009 23:52:31 +0000 (23:52 +0000)]
Propagate volatile for implicit property refernces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72353
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sat, 23 May 2009 23:48:13 +0000 (23:48 +0000)]
Propagate volatile around for property references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72352
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sat, 23 May 2009 22:29:41 +0000 (22:29 +0000)]
Track volatile aggregate copies better. I'm hoping someone else will decide
how to get the backend to know that the operation is volatile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72348
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sat, 23 May 2009 22:01:27 +0000 (22:01 +0000)]
Fix thinko, and implement aggregate volatile reads.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72347
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sat, 23 May 2009 21:40:07 +0000 (21:40 +0000)]
More volatile fixes. Can't testcase these yet as ultimately volatile
is still ignored.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72344
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sat, 23 May 2009 20:28:01 +0000 (20:28 +0000)]
Collapse a few FIXMEs together and refactor to make fixing the code easier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72342
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sat, 23 May 2009 20:21:36 +0000 (20:21 +0000)]
Add support for volatile RValues.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72341
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 23 May 2009 18:55:58 +0000 (18:55 +0000)]
Fix use after free, found by Benjamin Kramer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72333
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Sat, 23 May 2009 17:03:50 +0000 (17:03 +0000)]
Test for David Chisnall's -fobjc-sender-dependent-dispatch patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72330
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sat, 23 May 2009 04:13:59 +0000 (04:13 +0000)]
One step to fixing up codegen for a=b, where a is a volatile struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72315
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sat, 23 May 2009 03:50:01 +0000 (03:50 +0000)]
Add IEEE quad support to DefineFloatMacros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72314
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 23 May 2009 02:49:02 +0000 (02:49 +0000)]
Initialize Obj-C GC attributes when emitting BlockDeclRefExprs.
- Otherwise we may incorrectly miss generation of some write barriers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72313
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sat, 23 May 2009 02:03:39 +0000 (02:03 +0000)]
PR4247: Widen the buffer slightly so it can hold all the definitions for
PPC double double.
(No testcase because no normal target uses the format at the moment.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72310
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Sat, 23 May 2009 02:02:29 +0000 (02:02 +0000)]
Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72308
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sat, 23 May 2009 00:22:11 +0000 (00:22 +0000)]
Use 'Exprs.data()' instead of 'Exprs.empty() ? NULL : ...'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72304
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 22 May 2009 23:47:06 +0000 (23:47 +0000)]
Template instantiation for qualified declaration reference
expressions. We are now missing template instantiation logic for only
three classes of expressions:
- Blocks-related expressions (BlockExpr, BlockDeclRefExpr)
- C++ default argument expressions
- Objective-C expressions
Additionally, our handling of DeclRefExpr is still quite poor, since
it cannot handle references to many kinds of declarations.
As part of this change, converted the TemplateExprInstantiator to use
iteration through all of the expressions via clang/AST/StmtNodes.def,
ensuring that we don't forget to add template instantiation logic for
any new expression node kinds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72303
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 22 May 2009 23:25:52 +0000 (23:25 +0000)]
Template instantiation for the GNU address-of-label extension.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72301
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 22 May 2009 23:07:44 +0000 (23:07 +0000)]
Template instantiation for ExtVectorElementExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72299
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 22 May 2009 23:05:39 +0000 (23:05 +0000)]
Add a test case to make sure that an ambiguous paren expression is only parsed once.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72298
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 22 May 2009 22:48:45 +0000 (22:48 +0000)]
Fix the parent classes in TypeNodes.def, from Olaf Krzikalla
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72293
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 22 May 2009 22:45:36 +0000 (22:45 +0000)]
Fix lots of PCH crashes caused by the new assertions in
llvm::SmallVector, using data() instead of &[0]. The PCH testsuite now
runs cleanly (again).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72292
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 22 May 2009 22:34:23 +0000 (22:34 +0000)]
Fix PCH crash caused by new assertions in llvm::SmallVector. Use
ProtoRefs.data() instead of &ProtoRefs[0] to access the raw buffer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72291
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 22 May 2009 22:03:22 +0000 (22:03 +0000)]
Modify begin()/end() for AsmStmt iterators to handle the case when Exprs.empty()
is true. Because of recent changes to llvm::SmallVector, using these iterators
when Exprs was empty would cause an assertion failure.
This fixes: PR 4245.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72286
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 22 May 2009 21:42:52 +0000 (21:42 +0000)]
Cannot type cast @selector expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72284
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 22 May 2009 21:35:34 +0000 (21:35 +0000)]
In assembler-with-cpp mode, don't error on '#' (stringize) operator applied to
non-argument names, pass the tokens through.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72283
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 22 May 2009 21:26:58 +0000 (21:26 +0000)]
Add a few tests to ensure that member functions of class templates can
call other member functions of class templates, including after
template instantiation. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72282
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 22 May 2009 21:13:27 +0000 (21:13 +0000)]
Representation of and template instantiation for member
expressions. This change introduces another AST node,
CXXUnresolvedMemberExpr, that captures member references (x->m, x.m)
when the base of the expression (the "x") is type-dependent, and we
therefore cannot resolve the member reference yet.
Note that our parsing of member references for C++ is still quite
poor, e.g., we don't handle x->Base::m or x->operator int.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72281
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 22 May 2009 21:10:04 +0000 (21:10 +0000)]
Add -fblocks for the test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72280
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 22 May 2009 21:09:47 +0000 (21:09 +0000)]
The disambiguation process for ambiguous paren expressions is not "side effects free", e.g:
(T(*)(int[x+y]));
is an (invalid) paren expression, but "x+y" will be parsed as part of the (rejected) type-id,
so unnecessary Action calls are made for an unused (and possibly leaked) "x+y".
Use a different scheme, similar to parsing inline methods. The parenthesized tokens are cached,
the context that follows is determined (possibly by parsing a cast-expression),
and then we re-introduce the cached tokens into the token stream and parse them appropriately.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72279
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 22 May 2009 21:09:31 +0000 (21:09 +0000)]
The TokenLexer may encounter annotations if the parser enters them using Preprocessor::EnterTokenStream.
So check for annotation before using the Token's IdentifierInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72278
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 22 May 2009 20:17:16 +0000 (20:17 +0000)]
This patch adds support for sender-aware dispatch in Objective-C for the GNU runtime, when
compiled with -fobjc-sender-dependent-dispatch. This is used in AOP, COP, implementing object
planes, and a few other things.
Patch by David Chisnall.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72275
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 22 May 2009 20:06:10 +0000 (20:06 +0000)]
Added -fblocks to the test's options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72274
91177308 -0d34-0410-b5e6-
96231b3b80d8
Mike Stump [Fri, 22 May 2009 19:07:20 +0000 (19:07 +0000)]
Fixup codegen for __block int i; i += rhs();. Should also slightly
improve codegen in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72273
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 22 May 2009 19:02:20 +0000 (19:02 +0000)]
Don't warn about -funit-at-a-time, and reject -fno-unit-at-a-time.
- We could just warn about -fno-unit-at-a-time, but in practice people using it
probably aren't going to get what they want out of clang.
Also, use "clang" specified error for unsupported things instead of driver
unsupported error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72272
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 22 May 2009 17:33:44 +0000 (17:33 +0000)]
x86_64 ABI: Account for sret parameters consuming an integer register.
- PR4242.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72268
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 22 May 2009 17:12:32 +0000 (17:12 +0000)]
(Next runtime only) check to see if class implements forwardInvocation method
and objects of this class are derived from 'NSProxy'.
Under such conditions, which means that every method possible is
implemented in the class, we should not issue "Method definition not found"
warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72267
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 22 May 2009 15:12:46 +0000 (15:12 +0000)]
Some minor comments modifications.
There are no unnecessary action calls period (courtesy of the annotation scheme) and too many 'this means'..
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72263
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sanjiv Gupta [Fri, 22 May 2009 13:54:25 +0000 (13:54 +0000)]
Targets like PIC16 generate Static decls for automatic variables, emit the appropriate debug descriptor as well in that case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72261
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 22 May 2009 10:24:42 +0000 (10:24 +0000)]
Handle correctly a very ugly part of the C++ syntax. We cannot disambiguate between a parenthesized type-id and
a paren expression without considering the context past the parentheses.
Behold:
(T())x; - type-id
(T())*x; - type-id
(T())/x; - expression
(T()); - expression
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72260
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 22 May 2009 10:24:05 +0000 (10:24 +0000)]
Factor the compound literal parsing out from ParseParenExpression and into a new ParseCompoundLiteralExpression.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72259
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 22 May 2009 10:23:40 +0000 (10:23 +0000)]
Modification to ParseParenExpression.
Now it parses the cast expression unless 'stopIfCastExpr' is true.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72258
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 22 May 2009 10:23:16 +0000 (10:23 +0000)]
Remove ParseSimpleParenExpression.
Embed its functionality into it's only user, ParseCXXCasts.
CXXCasts now get the "actual" expression directly, they no longer always receive a ParenExpr. This is better since the
parentheses are always part of the C++ casts syntax.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72257
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 22 May 2009 10:22:50 +0000 (10:22 +0000)]
Refactor the common code of 'ParseTypeofSpecifier' and 'ParseSizeofAlignofExpression' into a new
'ParseExprAfterTypeofSizeofAlignof' method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72256
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 22 May 2009 10:22:18 +0000 (10:22 +0000)]
Parse typeof-specifier the same way as sizeof/alignof are parsed.
-Makes typeof consistent with sizeof/alignof
-Fixes a bug when '>' is in a typeof expression, inside a template type param:
A<typeof(x>1)> a;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72255
91177308 -0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Fri, 22 May 2009 08:38:27 +0000 (08:38 +0000)]
Pull EmitRecord() out of loop. It should be called only once.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72252
91177308 -0d34-0410-b5e6-
96231b3b80d8
Torok Edwin [Fri, 22 May 2009 07:25:06 +0000 (07:25 +0000)]
Set correct calling convention even if there is a bitcast in the way.
This attempts to fix PR4239.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72251
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 22 May 2009 02:53:45 +0000 (02:53 +0000)]
(llvm up) Use llvm::Triple for storing target triples.
- This commit has some messy stuff in it to extend string lifetimes, but that
will go away once we switch to using the enum'd Triple interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72243
91177308 -0d34-0410-b5e6-
96231b3b80d8