Граф коммитов

963 Коммитов

Автор SHA1 Сообщение Дата
Anders Carlsson 6e14a8f2ac Fix silly bug in objc_gc attribute parsing and add test case
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55286 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-24 16:33:25 +00:00
Anders Carlsson 4f3cc81896 Add carbon.cpp and cocoa.mm tests
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55262 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 22:21:00 +00:00
Anders Carlsson b88d45ea7e treat bool literals as constatnt expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55255 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 21:12:35 +00:00
Anders Carlsson 413ad8b6b5 Handle Objective-C++ tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55254 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 21:03:10 +00:00
Anders Carlsson ef048ef393 Reserved C++ words are valid selectors in Objective-C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55253 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 21:00:01 +00:00
Argyrios Kyrtzidis 7267f7832e Add CodeGen support for CXXZeroInitValueExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55249 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 19:35:47 +00:00
Argyrios Kyrtzidis 2fba1217dc Add a null pointer test in the type-convert-construct.cpp tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55247 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 19:24:45 +00:00
Chris Lattner e8904e992c Fix a FIXME by not creating an invalid AST on erroneous input. Also
make diagnostic output in some other malformed cases significantly
more useful.  This fixes PR2708


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55215 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 01:48:03 +00:00
Argyrios Kyrtzidis 4bd8217d94 Move the rest of the Sema C++ tests into the SemaCXX test directory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55178 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 15:43:49 +00:00
Argyrios Kyrtzidis 987a14bf58 Add support for C++'s "type-specifier ( expression-list )" expression:
-The Parser calls a new "ActOnCXXTypeConstructExpr" action.
-Sema, depending on the type and expressions number:
   -If the type is a class, it will treat it as a class constructor. [TODO]
   -If there's only one expression (i.e. "int(0.5)" ), creates a new "CXXFunctionalCastExpr" Expr node
   -If there are no expressions (i.e "int()" ), creates a new "CXXZeroInitValueExpr" Expr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55177 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 15:38:55 +00:00
Nico Weber dfb99a968b make test fails if llvm is checked out to llvm-svn of if there is a dash somewhere else in the path. fix that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55175 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 09:33:51 +00:00
Anders Carlsson c5eb731144 Initial sema support for C++ static initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55166 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 05:00:02 +00:00
Chris Lattner 2c15647dce add a simple check to warn people who type "=+" when they probably meant
"+=".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55131 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 18:04:13 +00:00
Daniel Dunbar 5323e23777 Use full path to count script, and don't treat files with missing RUN
lines as errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55109 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 04:43:28 +00:00
Daniel Dunbar 9562726a28 Missed a test case writing a .ll file.
Suppress count output from 'make test' on errors (used to generate
result code).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55107 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 04:30:23 +00:00
Daniel Dunbar 4565938ff6 Reorder the PATH used during testing so $(ToolDir) and the LLVM
scripts dir appear before the user path.
 - This is an attempt to pick up the right executables. We should
   probably be substituting the exact things we want for clang a la
   the LLVM test script.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55105 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 03:03:44 +00:00
Daniel Dunbar 2d6ca8d0f6 Update a number of CodeGen tests to not create .ll files in the test
directory.
 - Removed .ll from the svn:ignore lists to try and prevent this.
 - Added svn:ignore on test/Misc/Output


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55104 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 02:51:29 +00:00
Daniel Dunbar 6bfd6218e8 Update test/Makefile to allow testing when using a separate obj
directory.
 - Also, return proper error code if testing fails.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55103 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 02:48:23 +00:00
Eli Friedman efbe85c8ef Fix a regression from my fix to PR2631. Fixes PR2692.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55083 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 22:17:17 +00:00
Eli Friedman 0976278aff Fix a minor crash-on-invalid.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55082 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 22:07:34 +00:00
Daniel Dunbar 58d5ebbe72 Fix subtle bug introduced in r54852.
- UsualUnaryConversions takes an Expr *& and may modify its argument,
   this broke when it was refactored into Sema::CheckCastTypes. This
   meant that we were missing implicit casts in some places.
 - Seems pretty sad that this got through our tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55039 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 03:55:42 +00:00
Eli Friedman 50ff6f3fb5 Fix test failure on Linux.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55032 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 01:05:41 +00:00
Eli Friedman 9b20376c6c Fix some spam from make I accidentally introduced.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55027 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 00:38:03 +00:00
Eli Friedman 0adb3c9b2c Get rid of the bogus -depth +0 argument; I really have no clue what the
heck it does on Darwin, but it's not part of POSIX, and the GNU version 
of find errors out on it.

On a side note, there are a couple of new failures due to tests 
including OS X specific headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55019 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 00:02:01 +00:00
Steve Naroff c7089f1be9 Fix crasher in RewriteObjC::RewriteObjCSynchronizedStmt(). Can't depend on the source locations of the sync expression (since it may have been rewritten.
Fixes <rdar://problem/6156363> clang ObjC rewriter: rewriting attached file causes assertion failure: invalid FileID


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54986 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 13:04:19 +00:00
Chris Lattner d5bac57047 add testcase we already handle.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 00:58:40 +00:00
Chris Lattner 4f3278fe39 proper grammar n stuph
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54954 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 22:51:28 +00:00
Chris Lattner 43477ca467 warn when someone tries to make an array of ObjC interfaces instead of array
of pointers to them.  rdar://4304469


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54953 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 22:49:54 +00:00
Daniel Dunbar 396f0bfd4b Support initialization of incomplete array with zero size (as
extension).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54946 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 20:28:46 +00:00
Chris Lattner 786e7a1b5c fix bogus run line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54940 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 19:54:48 +00:00
Daniel Dunbar 8b6b0f66a9 Change test/Makefile to automatically test all subdirs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54923 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 18:05:17 +00:00
Daniel Dunbar a9dbb61711 Fix test case RUN: line (thanks Argiris)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54922 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 17:52:17 +00:00
Argyrios Kyrtzidis 2ff9b4c7c8 Type::isIntegerType() returns true for types between Bool and LongLong.
Put WChar between them to make it integer type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54882 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 13:24:01 +00:00
Argyrios Kyrtzidis 5e8840c7a6 Move the C++ Sema tests into a separate SemaCXX directory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54853 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 20:53:59 +00:00
Argyrios Kyrtzidis b348b810e7 C++ casts, (static_cast. dynamic_cast, etc.) can have postfix-expression pieces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54850 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 19:45:32 +00:00
Ted Kremenek dd463b8db0 Enhance null-dereference checker test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 00:45:40 +00:00
Nuno Lopes 3998d3fb8e make sure the size of constant arrays is respected
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54769 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 23:28:57 +00:00
Daniel Dunbar 6143293fa4 Add GetAddrOfConstantCString method
- Returns addr of constant for argument + '\0'.
 - I couldn't think of a better name.
 - Move appropriate users of GetAddrOfConstantString to this.

Rename getStringForStringLiteral to GetStringForStringLiteral.

Add GetAddrOfConstantStringFromLiteral
 - This combines GetAddrOfConstantString and
   GetStringForStringLiteral. This method can be, but is not yet, more
   efficient.

Change GetAddrOfConstantString to not add terminating '\0'
 - <rdar://problem/6140956>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54768 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 23:20:05 +00:00
Ted Kremenek 595c7ab8a4 Added test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54717 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 03:55:18 +00:00
Daniel Dunbar 709c00cf6e Add test case for -fexceptions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54647 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 18:40:47 +00:00
Steve Naroff 613535273b InitListChecker::CheckListElementTypes(): Check for function types and issue an appropriate diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54614 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 16:05:48 +00:00
Steve Naroff f855e6fbeb Sema::CheckForFileScopedRedefinitions(): Make sure tentative decls of incomplete array types are completed (and diagnosed properly).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54612 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 15:20:13 +00:00
Daniel Dunbar 9ca8bb0996 Fix crash during initialization of a bitfield which followed a zero
length element.

Fix some 80-col violations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54610 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 07:00:24 +00:00
Chris Lattner d8803632d2 wrap some long diagnostics, make 'initializer is not a constant' diagnostic
a bit more clear (rdar://5646070)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54606 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 01:58:45 +00:00
Eli Friedman 1bb516c861 Make sure to count the struct elements correctly; here, we want the
member count.  The count returned by numStructUnionElements is the 
number of initializers that will be consumed, not the number of members 
to iterate through.  Fixes PR2534.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54601 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 23:45:45 +00:00
Eli Friedman c34bcde8d2 Fix for PR2631; make va_arg work correctly on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54600 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 23:32:40 +00:00
Chris Lattner 8389eab190 Fix PR2400 by more graceful handling of invalid decls. Don't try to layout
an invalid struct decl.  Thanks to Martin Doucha for the 
isIncompleteArrayType part of this patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54592 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 21:35:13 +00:00
Argyrios Kyrtzidis 64c438a4be Implement support for the 'wchar_t' C++ type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54585 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 16:51:54 +00:00
Steve Naroff 907747b3a6 Fix Sema::MergeVarDecl() to better handle type compatibility. The previous code was trying to handle arrays specially (which didn't work for pointers to array). Removed local helper function areEquivalentArrayTypes(), replacing it's use with the more general ASTContext::typesAreCompatible() predicate.
Even though the test case this fixes is in "tentative-decls.c", this bug didn't have anything to do with our handling of tentative definitions (which is what I first expected). In any event, this is a tricky area of the spec.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54583 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 16:04:40 +00:00
Steve Naroff ff9eb1fe0a Fix issues with C "tentative" definitions.
- Move checking from MergeVarDecl->FinializeDeclaratorGroup. Since MergeVarDecl is called before the initializer is attacted, it can't be done there (this removes a long standing FIXME).
- Add Sema::isTentativeDefinition() and Sema::CheckForFileScopedRedefinitions().
- Remove FIXME's and touch-up test case.

Still some more work to do (forthcoming)...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54533 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 17:50:35 +00:00