]> granicus.if.org Git - clang/log
clang
15 years agoRemove AstGuard.h from Xcode project.
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

15 years agoMinor build system changes to make ABITest work correctly on Linux.
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

15 years agoSome minor corrections: don't use offsetof on a bitfield, and cast
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

15 years agoExtend getPreferredTypeAlign to handle _Complex double and long long
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

15 years agoPR4122: Tweak the ambiguity handling to handle (S())() correctly. I've
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

15 years agotweak non-null check to put the caret on the function, but underline the
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

15 years agomerge two tests.
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

15 years agoreword a warning for clarity
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

15 years agodefault -Wnonnull to on.
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

15 years agomove some format group options around in the file. Move NonNull group into
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

15 years agoFix a couple of bugs:
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

15 years agoimprove comment, no functionality change.
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

15 years agofix this test to fail when the patch isn't applied.
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

15 years agoMake sure an invalid concatentaion doesn't insert whitespace before
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

15 years agoAnother tweak to the clang Getting Started page.
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

15 years agoMinor updates to the clang Getting Started page.
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

15 years agoPropagate volatile for implicit property refernces.
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

15 years agoPropagate volatile around for property references.
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

15 years agoTrack volatile aggregate copies better. I'm hoping someone else will decide
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

15 years agoFix thinko, and implement aggregate volatile reads.
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

15 years agoMore volatile fixes. Can't testcase these yet as ultimately volatile
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

15 years agoCollapse a few FIXMEs together and refactor to make fixing the code easier.
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

15 years agoAdd support for volatile RValues.
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

15 years agoFix use after free, found by Benjamin Kramer.
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

15 years agoTest for David Chisnall's -fobjc-sender-dependent-dispatch patch.
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

15 years agoOne step to fixing up codegen for a=b, where a is a volatile struct.
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

15 years agoAdd IEEE quad support to DefineFloatMacros.
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

15 years agoInitialize Obj-C GC attributes when emitting BlockDeclRefExprs.
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

15 years agoPR4247: Widen the buffer slightly so it can hold all the definitions for
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

15 years agoFix typo.
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

15 years agoUse 'Exprs.data()' instead of 'Exprs.empty() ? NULL : ...'
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

15 years agoTemplate instantiation for qualified declaration reference
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

15 years agoTemplate instantiation for the GNU address-of-label extension.
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

15 years agoTemplate instantiation for ExtVectorElementExpr.
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

15 years agoAdd a test case to make sure that an ambiguous paren expression is only parsed once.
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

15 years agoFix the parent classes in TypeNodes.def, from Olaf Krzikalla
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

15 years agoFix lots of PCH crashes caused by the new assertions in
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

15 years agoFix PCH crash caused by new assertions in llvm::SmallVector. Use
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

15 years agoModify begin()/end() for AsmStmt iterators to handle the case when Exprs.empty()
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

15 years agoCannot type cast @selector expressions.
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

15 years agoIn assembler-with-cpp mode, don't error on '#' (stringize) operator applied to
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

15 years agoAdd a few tests to ensure that member functions of class templates can
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

15 years agoRepresentation of and template instantiation for member
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

15 years agoAdd -fblocks for the test.
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

15 years agoThe disambiguation process for ambiguous paren expressions is not "side effects free...
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

15 years agoThe TokenLexer may encounter annotations if the parser enters them using Preprocessor...
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

15 years agoThis patch adds support for sender-aware dispatch in Objective-C for the GNU runtime...
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

15 years agoAdded -fblocks to the test's options.
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

15 years agoFixup codegen for __block int i; i += rhs();. Should also slightly
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

15 years agoDon't warn about -funit-at-a-time, and reject -fno-unit-at-a-time.
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

15 years agox86_64 ABI: Account for sret parameters consuming an integer register.
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

15 years ago(Next runtime only) check to see if class implements forwardInvocation method
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

15 years agoSome minor comments modifications.
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

15 years agoTargets like PIC16 generate Static decls for automatic variables, emit the appropriat...
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

15 years agoHandle correctly a very ugly part of the C++ syntax. We cannot disambiguate between...
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

15 years agoFactor the compound literal parsing out from ParseParenExpression and into a new...
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

15 years agoModification to ParseParenExpression.
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

15 years agoRemove ParseSimpleParenExpression.
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

15 years agoRefactor the common code of 'ParseTypeofSpecifier' and 'ParseSizeofAlignofExpression...
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

15 years agoParse typeof-specifier the same way as sizeof/alignof are parsed.
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

15 years agoPull EmitRecord() out of loop. It should be called only once.
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

15 years agoSet correct calling convention even if there is a bitcast in the way.
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

15 years ago(llvm up) Use llvm::Triple for storing target triples.
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

15 years agoDon't rely on getArchName() to return a constant string reference.
Daniel Dunbar [Fri, 22 May 2009 02:21:04 +0000 (02:21 +0000)]
Don't rely on getArchName() to return a constant string reference.

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

15 years agoA few more tweaks for Solaris; please correct me if it's wrong somehow.
Eli Friedman [Fri, 22 May 2009 01:12:57 +0000 (01:12 +0000)]
A few more tweaks for Solaris; please correct me if it's wrong somehow.

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

15 years agoAdd --analyzer-no-default-checks and --analyzer-output options.
Daniel Dunbar [Fri, 22 May 2009 00:38:15 +0000 (00:38 +0000)]
Add --analyzer-no-default-checks and --analyzer-output options.

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

15 years agoImprove target support for Solaris.
Douglas Gregor [Thu, 21 May 2009 23:51:30 +0000 (23:51 +0000)]
Improve target support for Solaris.

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

15 years agoTemplate instantiation for C99 compound literals
Douglas Gregor [Thu, 21 May 2009 23:48:18 +0000 (23:48 +0000)]
Template instantiation for C99 compound literals

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

15 years agoTemplate instantiation for GNU array-range designators.
Douglas Gregor [Thu, 21 May 2009 23:30:39 +0000 (23:30 +0000)]
Template instantiation for GNU array-range designators.

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

15 years agoTemplate instantiation for C99 designated initializers, because we
Douglas Gregor [Thu, 21 May 2009 23:17:49 +0000 (23:17 +0000)]
Template instantiation for C99 designated initializers, because we
can. Also, delay semantic analysis of initialization for
value-dependent as well as type-dependent expressions, since we can't
always properly type-check a value-dependent expression.

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

15 years agoTemplate instantiation for initializer lists
Douglas Gregor [Thu, 21 May 2009 21:38:12 +0000 (21:38 +0000)]
Template instantiation for initializer lists

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

15 years agoFix CMake build for AST XML dumper
Douglas Gregor [Thu, 21 May 2009 21:21:53 +0000 (21:21 +0000)]
Fix CMake build for AST XML dumper

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

15 years agoFixup blocks codegen for { __block i; i = rhs(); }, we want the rhs
Mike Stump [Thu, 21 May 2009 21:05:15 +0000 (21:05 +0000)]
Fixup blocks codegen for { __block i; i = rhs(); }, we want the rhs
evaluated first.  This can also improve codegen just a bit as we might
have another register to play with for the evaluation of the rhs.

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

15 years agoFixed a warning bug when receiver is an object via
Fariborz Jahanian [Thu, 21 May 2009 21:04:28 +0000 (21:04 +0000)]
Fixed a warning bug when receiver is an object via
setting of NSObject attribute.

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

15 years agoAST XML dump, from Olaf Krzikalla!
Douglas Gregor [Thu, 21 May 2009 20:55:50 +0000 (20:55 +0000)]
AST XML dump, from Olaf Krzikalla!

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

15 years agoTemplate instantiation for unary type traits, e.g., __is_pod
Douglas Gregor [Thu, 21 May 2009 18:55:48 +0000 (18:55 +0000)]
Template instantiation for unary type traits, e.g., __is_pod

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

15 years agoCheck on null arguments in the presense of nonnull attribute.
Fariborz Jahanian [Thu, 21 May 2009 18:48:51 +0000 (18:48 +0000)]
Check on null arguments in the presense of nonnull attribute.

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

15 years agoTemplate instantiation for C++ "typeid" expressions.
Douglas Gregor [Thu, 21 May 2009 18:34:44 +0000 (18:34 +0000)]
Template instantiation for C++ "typeid" expressions.

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

15 years agoTemplate instantiation for C++ throw expressions
Douglas Gregor [Thu, 21 May 2009 17:37:52 +0000 (17:37 +0000)]
Template instantiation for C++ throw expressions

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

15 years agoTemplate instantiation for C++ delete expression
Douglas Gregor [Thu, 21 May 2009 17:21:12 +0000 (17:21 +0000)]
Template instantiation for C++ delete expression

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

15 years agoMerge the ASTVector and ASTOwningVector templates, since they offered
Douglas Gregor [Thu, 21 May 2009 16:25:11 +0000 (16:25 +0000)]
Merge the ASTVector and ASTOwningVector templates, since they offered
redundant functionality. The result (ASTOwningVector) lives in
clang/Parse/Ownership.h and is used by both the parser and semantic
analysis. No intended functionality change.

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

15 years agoAvoid using the built-in type checker for assignment in C++ when classes are involved...
Sebastian Redl [Thu, 21 May 2009 11:50:50 +0000 (11:50 +0000)]
Avoid using the built-in type checker for assignment in C++ when classes are involved. Patch by Vyacheslav Kononenko.

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

15 years agoUse v.data() instead of &v[0] when SmallVector v might be empty.
Jay Foad [Thu, 21 May 2009 09:52:38 +0000 (09:52 +0000)]
Use v.data() instead of &v[0] when SmallVector v might be empty.

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

15 years agoMinor refactoring. Uses an existing API to lookup a class method.
Fariborz Jahanian [Thu, 21 May 2009 01:03:45 +0000 (01:03 +0000)]
Minor refactoring. Uses an existing API to lookup a class method.

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

15 years agoTemplate instantiation for C++ "new" expressions.
Douglas Gregor [Thu, 21 May 2009 00:00:09 +0000 (00:00 +0000)]
Template instantiation for C++ "new" expressions.

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

15 years agoFix template instantiation for compound statements so that it properly
Douglas Gregor [Wed, 20 May 2009 22:57:03 +0000 (22:57 +0000)]
Fix template instantiation for compound statements so that it properly
passes the "isStmtExpr" flag, to suppress warnings about unused
expressions.

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

15 years agoAdd special cases to retain checker for 'create' methods in QCView, QCRenderer, and...
Ted Kremenek [Wed, 20 May 2009 22:39:57 +0000 (22:39 +0000)]
Add special cases to retain checker for 'create' methods in QCView, QCRenderer, and CIContext (Apple APIs).

This fixes:

<rdar://problem/6902710> clang: false positives w/QC and CoreImage methods.

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

15 years agoIntroduce a new kind of RAII class, ASTOwningVector, which is an
Douglas Gregor [Wed, 20 May 2009 22:33:37 +0000 (22:33 +0000)]
Introduce a new kind of RAII class, ASTOwningVector, which is an
llvm::SmallVector that owns all of the AST nodes inside of it. This
RAII class is used to ensure proper destruction of AST nodes when
template instantiation fails.

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

15 years agoTemplate instantiation for CXXExprWithTemporaries, which occurs when
Douglas Gregor [Wed, 20 May 2009 21:51:01 +0000 (21:51 +0000)]
Template instantiation for CXXExprWithTemporaries, which occurs when
temporaries are generated for some object-constructing expressions in
templates that are not type-dependent.

Also, be sure to introduce the variable from a CXXConditionDeclExpr
into the set of instantiated local variables.

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

15 years agoTemplate instantiation for the various kinds of AST nodes that occur
Douglas Gregor [Wed, 20 May 2009 21:38:11 +0000 (21:38 +0000)]
Template instantiation for the various kinds of AST nodes that occur
due to C++ type construction of the form T(a1, a2, ..., aN).

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

15 years agoTweak test case so that the expected-error text matches on both i686 and x86-64.
Douglas Gregor [Wed, 20 May 2009 20:30:46 +0000 (20:30 +0000)]
Tweak test case so that the expected-error text matches on both i686 and x86-64.

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

15 years agoAdd a va_list/template instantiation test suggested by Eli
Douglas Gregor [Wed, 20 May 2009 18:50:16 +0000 (18:50 +0000)]
Add a va_list/template instantiation test suggested by Eli

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

15 years agoIntroduce a new expression type, CXXUnresolvedConstructExpr, to
Douglas Gregor [Wed, 20 May 2009 18:46:25 +0000 (18:46 +0000)]
Introduce a new expression type, CXXUnresolvedConstructExpr, to
describe the construction of a value of a given type using function
syntax, e.g.,

  T(a1, a2, ..., aN)

when the type or any of its arguments are type-dependent. In this
case, we don't know what kind of type-construction this will be: it
might construct a temporary of type 'T' (which might be a class or
non-class type) or might perform a conversion to type 'T'. Also,
implement printing of and template instantiation for this new
expression type. Due to the change in Sema::ActOnCXXTypeConstructExpr,
our existing tests cover template instantiation of this new expression
node.

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

15 years agoThis patch provides preliminary support for non-fragile instance variables on the...
Fariborz Jahanian [Wed, 20 May 2009 18:41:51 +0000 (18:41 +0000)]
This patch provides preliminary support for non-fragile instance variables on the GNU runtime.
It currently requires a patches to GNU libobjc (and so is not enabled by default) which are currently
being tested and reviewed by GNUstep before being pushed upstream.
This patch does not allow support for synthesized ivars, but does provide the infrastructure
needed for supporting them.
Patch by David Chisnall

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

15 years agoimplementation of format_arg for ObjC methods/functions.
Fariborz Jahanian [Wed, 20 May 2009 17:41:43 +0000 (17:41 +0000)]
implementation of format_arg for ObjC methods/functions.
Still more to do.

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

15 years agoTreat AllocaRegion as SymbolicRegion in RegionStore::Retrieve().
Zhongxing Xu [Wed, 20 May 2009 09:18:48 +0000 (09:18 +0000)]
Treat AllocaRegion as SymbolicRegion in RegionStore::Retrieve().

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

15 years agoAdd comments to test case.
Zhongxing Xu [Wed, 20 May 2009 09:03:10 +0000 (09:03 +0000)]
Add comments to test case.

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

15 years ago* API change: we need to pass GRState to GRExprEngine::EvalBinOp() because
Zhongxing Xu [Wed, 20 May 2009 09:00:16 +0000 (09:00 +0000)]
* API change: we need to pass GRState to GRExprEngine::EvalBinOp() because
  RegionStore needs to know the type of alloca region.
* RegionStoreManager::EvalBinOp() now converts the alloca region to its first
  element region, as what is done to symbolic region.

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

15 years agoHandle the remaining unhandled cases in EmitReferenceBindingToExpr.
Eli Friedman [Wed, 20 May 2009 02:31:19 +0000 (02:31 +0000)]
Handle the remaining unhandled cases in EmitReferenceBindingToExpr.

It would be nice if someone could write an ObjC++ testcase for the case
of passing a property returning a struct to a function taking a const
reference.

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

15 years agoadd header to be built by gcc 4.3 on Linux.
Zhongxing Xu [Wed, 20 May 2009 01:55:10 +0000 (01:55 +0000)]
add header to be built by gcc 4.3 on Linux.

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