Commit Graph

13349 Commits

Author SHA1 Message Date
Eli Friedman 5cd659fd32 Fix for PR4140: Add the start of a Linux toolchain (basically, just
barely enough to get the given usage of -print-file-name working).

llvm-svn: 72412
2009-05-26 07:52:18 +00:00
Anders Carlsson 00a2759ca9 Add a new CallExpr::getCallReturnType and use it in Expr::isLvalueInternal. No intended functionality change.
llvm-svn: 72410
2009-05-26 04:57:27 +00:00
Anders Carlsson 3b70b300b0 A block that returns a reference is an lvalue.
llvm-svn: 72409
2009-05-26 02:03:20 +00:00
Eli Friedman 895771aa4b 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.

llvm-svn: 72408
2009-05-26 01:22:57 +00:00
Anders Carlsson b7e69b06b5 Remove a bunch of unused constructors
llvm-svn: 72407
2009-05-26 01:04:47 +00:00
Anders Carlsson 3562240952 Remove AstGuard.h from Xcode project.
llvm-svn: 72406
2009-05-26 00:57:47 +00:00
Eli Friedman 1fd785f564 Minor build system changes to make ABITest work correctly on Linux.
llvm-svn: 72405
2009-05-25 22:07:09 +00:00
Eli Friedman 1cae3df3cf Some minor corrections: don't use offsetof on a bitfield, and cast
printf operands to long to suppress warnings.

llvm-svn: 72404
2009-05-25 21:38:01 +00:00
Eli Friedman 7ab09572c6 Extend getPreferredTypeAlign to handle _Complex double and long long
correctly.

llvm-svn: 72401
2009-05-25 21:27:19 +00:00
Eli Friedman cf7530ff43 PR4122: Tweak the ambiguity handling to handle (S())() correctly. I've
left out handling for stuff like (S())++ for the moment.

llvm-svn: 72394
2009-05-25 19:41:42 +00:00
Chris Lattner 23464b8f14 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);
        ^

llvm-svn: 72393
2009-05-25 18:23:36 +00:00
Chris Lattner ae5342094a merge two tests.
llvm-svn: 72392
2009-05-25 18:20:11 +00:00
Chris Lattner c7516835c3 reword a warning for clarity
llvm-svn: 72391
2009-05-25 18:18:56 +00:00
Chris Lattner 31cadd77ef default -Wnonnull to on.
llvm-svn: 72390
2009-05-25 18:13:00 +00:00
Chris Lattner fe5b4250a8 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).

llvm-svn: 72389
2009-05-25 18:10:41 +00:00
Chris Lattner 83bd8281e5 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

llvm-svn: 72388
2009-05-25 17:16:10 +00:00
Chris Lattner 7ce761d204 improve comment, no functionality change.
llvm-svn: 72386
2009-05-25 16:23:08 +00:00
Chris Lattner fc39bccd2b fix this test to fail when the patch isn't applied.
llvm-svn: 72385
2009-05-25 16:14:52 +00:00
Eli Friedman 2d49c4f98d Make sure an invalid concatentaion doesn't insert whitespace before
the RHS.  Fixes assembler-with-cpp issue reported on cfe-dev.

llvm-svn: 72370
2009-05-24 19:25:46 +00:00
Daniel Dunbar 91b418ea3c Another tweak to the clang Getting Started page.
llvm-svn: 72355
2009-05-24 01:40:10 +00:00
Daniel Dunbar b402d5c32d Minor updates to the clang Getting Started page.
llvm-svn: 72354
2009-05-24 01:00:12 +00:00
Mike Stump b9f2518626 Propagate volatile for implicit property refernces.
llvm-svn: 72353
2009-05-23 23:52:31 +00:00
Mike Stump 9afc476d4a Propagate volatile around for property references.
llvm-svn: 72352
2009-05-23 23:48:13 +00:00
Mike Stump 5e9e61b8d2 Track volatile aggregate copies better. I'm hoping someone else will decide
how to get the backend to know that the operation is volatile.

llvm-svn: 72348
2009-05-23 22:29:41 +00:00
Mike Stump 332ec2ce81 Fix thinko, and implement aggregate volatile reads.
llvm-svn: 72347
2009-05-23 22:01:27 +00:00
Mike Stump 23abd46b79 More volatile fixes. Can't testcase these yet as ultimately volatile
is still ignored.

llvm-svn: 72344
2009-05-23 21:40:07 +00:00
Mike Stump ca9fc09c61 Collapse a few FIXMEs together and refactor to make fixing the code easier.
llvm-svn: 72342
2009-05-23 20:28:01 +00:00
Mike Stump 93700fc988 Add support for volatile RValues.
llvm-svn: 72341
2009-05-23 20:21:36 +00:00
Daniel Dunbar b8fb96905d Fix use after free, found by Benjamin Kramer.
llvm-svn: 72333
2009-05-23 18:55:58 +00:00
Fariborz Jahanian ba74e5daa5 Test for David Chisnall's -fobjc-sender-dependent-dispatch patch.
llvm-svn: 72330
2009-05-23 17:03:50 +00:00
Mike Stump 8673657275 One step to fixing up codegen for a=b, where a is a volatile struct.
llvm-svn: 72315
2009-05-23 04:13:59 +00:00
Eli Friedman 57406b2783 Add IEEE quad support to DefineFloatMacros.
llvm-svn: 72314
2009-05-23 03:50:01 +00:00
Daniel Dunbar 223db1c9e5 Initialize Obj-C GC attributes when emitting BlockDeclRefExprs.
- Otherwise we may incorrectly miss generation of some write barriers.

llvm-svn: 72313
2009-05-23 02:49:02 +00:00
Eli Friedman f98fc352b8 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.)

llvm-svn: 72310
2009-05-23 02:03:39 +00:00
Mike Stump a35af82429 Fix typo.
llvm-svn: 72308
2009-05-23 02:02:29 +00:00
Ted Kremenek 20e2630877 Use 'Exprs.data()' instead of 'Exprs.empty() ? NULL : ...'
llvm-svn: 72304
2009-05-23 00:22:11 +00:00
Douglas Gregor 4a9f481db9 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.

llvm-svn: 72303
2009-05-22 23:47:06 +00:00
Douglas Gregor 93fcf93bc6 Template instantiation for the GNU address-of-label extension.
llvm-svn: 72301
2009-05-22 23:25:52 +00:00
Douglas Gregor 36fe6901d4 Template instantiation for ExtVectorElementExpr.
llvm-svn: 72299
2009-05-22 23:07:44 +00:00
Argyrios Kyrtzidis 4a6dad68a3 Add a test case to make sure that an ambiguous paren expression is only parsed once.
llvm-svn: 72298
2009-05-22 23:05:39 +00:00
Douglas Gregor 5ce0f0eccf Fix the parent classes in TypeNodes.def, from Olaf Krzikalla
llvm-svn: 72293
2009-05-22 22:48:45 +00:00
Douglas Gregor 038c338949 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).

llvm-svn: 72292
2009-05-22 22:45:36 +00:00
Ted Kremenek 92f3d1ff1c Fix PCH crash caused by new assertions in llvm::SmallVector. Use
ProtoRefs.data() instead of &ProtoRefs[0] to access the raw buffer.

llvm-svn: 72291
2009-05-22 22:34:23 +00:00
Ted Kremenek ed28b6d028 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.

llvm-svn: 72286
2009-05-22 22:03:22 +00:00
Fariborz Jahanian 88fead8c48 Cannot type cast @selector expressions.
llvm-svn: 72284
2009-05-22 21:42:52 +00:00
Daniel Dunbar 0721c2c155 In assembler-with-cpp mode, don't error on '#' (stringize) operator applied to
non-argument names, pass the tokens through.

llvm-svn: 72283
2009-05-22 21:35:34 +00:00
Douglas Gregor efe7c393e1 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.

llvm-svn: 72282
2009-05-22 21:26:58 +00:00
Douglas Gregor a8db954f24 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.

llvm-svn: 72281
2009-05-22 21:13:27 +00:00
Argyrios Kyrtzidis c996521508 Add -fblocks for the test.
llvm-svn: 72280
2009-05-22 21:10:04 +00:00
Argyrios Kyrtzidis f73f2d28a2 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.

llvm-svn: 72279
2009-05-22 21:09:47 +00:00