Fariborz Jahanian
5ef404f08b
Patch to prevent crash on use of objc2 syntax.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44617 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 18:16:33 +00:00
Fariborz Jahanian
7127431a1d
Changed type-cast of "struct objc_super"'s 2nd initializer to match definition of
...
"struct objc_super".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44616 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 17:29:46 +00:00
Steve Naroff
e638639467
Recognize CompoundLiteralExpr's as valid lvalue's.
...
Also updated a FIXME in Sema::CheckInitializer()...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44602 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 04:00:10 +00:00
Fariborz Jahanian
e2c4cd8998
Test case for my last patch.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44581 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-04 21:48:54 +00:00
Fariborz Jahanian
87ce5d1cb9
Fixed a bug exposed by referencing an ivar field using component reference syntax.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44553 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03 22:25:42 +00:00
Ted Kremenek
ae3607684c
Implemented initial support for "-triple" option to the clang driver. This
...
replaces the functionality previously provided by just "-arch" (which is still
supported but has different semantics).
The new behavior is as follows:
(1) If the user does not specify -triple:
(a) If no -arch options are specified, the target triple used is the host
triple (in llvm/Config/config.h).
(b) If one or more -arch's are specified (and no -triple), then there is
one triple for each -arch, where the specified arch is substituted
for the arch in the host triple. Example:
host triple = i686-apple-darwin9
command: clang -arch ppc -arch ppc64 ...
triples used: ppc-apple-darwin9 ppc64-apple-darwin9
(2) The user does specify a -triple (only one allowed):
(a) If no -arch options are specified, the triple specified by -triple
is used. E.g clang -triple i686-apple-darwin9
(b) If one or more -arch options are specified, then the triple specified
by -triple is used as the primary target, and the arch's specified
by -arch are used to create secondary targets. For example:
clang -triple i686-apple-darwin9 -arch ppc -arch ppc64
has the following targets:
i686-apple-darwin9 (primary target)
ppc-apple-darwin9
ppc64-apple-darwin9
Other changes related to the changes to the driver:
- TargetInfoImpl now includes the triple string.
- TargetInfo::getTargetTriple returns the triple for its primary target.
- test case test/Parser/portability.c has been updated because "-arch linux" is
no longer valid ("linux" is an OS, not an arch); instead we use a bogus
architecture "bogusW16W16" where WCharWidth=16 and WCharAlign=16.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44551 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03 22:06:55 +00:00
Chris Lattner
0d6ca11db0
Fix an ast-print/ast-dump bug.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44550 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03 21:43:25 +00:00
Bill Wendling
43d69750e7
Fix for testcase that assigns a dereferenced reference to a pointer. The
...
standard says that we should adjust the "reference to T" type to "T"
before analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44530 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03 07:33:35 +00:00
Seo Sanghyeon
ec86b97c34
Ignore typedefs in pointer arithmetic codegen.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44529 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03 06:23:43 +00:00
Seo Sanghyeon
2de3b3a4ac
Fix isStructureType and isUnionType to ignore typedefs, as stated
...
in the header. Patch by Cédric Venet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44519 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02 16:57:27 +00:00
Christopher Lamb
ce39faa836
Treat discarding array initializer elements as an extwarn (so -pedantic-errors flags it). Allow CodeGen to truncate the initializer if needed.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44518 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02 08:49:54 +00:00
Chris Lattner
d411e04db1
all filevar's have static storage. Previously a global with
...
extern storage class was returning false from hasStaticStorage.
Ted, please review this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44515 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02 07:47:49 +00:00
Christopher Lamb
e86e9ce200
Commit test for CL 44440.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44514 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02 07:47:19 +00:00
Chris Lattner
e6e25a5458
Fix buggy test
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44513 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02 07:46:00 +00:00
Chris Lattner
9615bf855a
add codegen support for global inits that require array decay.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44511 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02 07:30:13 +00:00
Chris Lattner
9cd4fe4af6
Handle global variable definitions which change the type of a definition, such as:
...
extern int x[];
void foo() { x[0] = 1; }
int x[10];
void bar() { x[0] = 1; }
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44509 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02 07:09:19 +00:00
Chris Lattner
58c3f9ec11
implement codegen for functions whose function body type don't match
...
their prototype.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44506 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02 06:27:33 +00:00
Oliver Hunt
2824723d6d
Support initalisers for more than just int-typed static variables.
...
We now use the CodeGenModule logic for generating the constant
initialiser expression, so happily further initialiser fixes should
automatically work for statics as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44495 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02 00:11:25 +00:00
Chris Lattner
1438b4918a
fix a couple switch codegen problems Oliver reported.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44484 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-01 05:27:33 +00:00
Anders Carlsson
3907323dd6
GCC has an extension where the left hand side of the ? : operator can be omitted. Handle this in a few more places.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44462 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 19:04:31 +00:00
Chris Lattner
3e47be5c90
fix a bug handling typedefs in member expr codegen. Patch
...
by Seo Sanghyeon
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44455 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 18:02:19 +00:00
Chris Lattner
2202bce80f
Fix a codegen crash on void ?: reported by Oliver
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44454 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 17:56:23 +00:00
Chris Lattner
c69a5810f4
Support fully general case expressions, patch by Sanghyeon Seo!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44453 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 17:44:57 +00:00
Christopher Lamb
fbd91735c8
Doh! Check in this long overdue test fix.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44450 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 06:35:48 +00:00
Anders Carlsson
695dbb697d
Support lax vector conversions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44449 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 04:21:22 +00:00
Ted Kremenek
502654085f
Added "complex.c" (a copy of test/Codegen/complex.) to the serialization
...
test suite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44439 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 19:05:51 +00:00
Christopher Lamb
016765e345
Support floating point literals of the form "1e-16f" which specify an exponent but no decimal point.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44431 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 06:06:27 +00:00
Ted Kremenek
b594a40589
Fixed test case to not expect a warning when one should not be emitted.
...
Removed redundant test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44426 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 01:03:21 +00:00
Ted Kremenek
9e7f0ecab9
Added test cases for -Wfloat-equal to test comparisons against literals that can be
...
represented exactly and inexactly by APFloats. For the former, we do not emit a
warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44425 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 01:00:11 +00:00
Ted Kremenek
251f7325b3
Inlined test case to make it independent of the stmt_exprs test case in test/Sema.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44416 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 21:29:54 +00:00
Ted Kremenek
efb71539a7
Added the "Serialization" test directory to the set of tests executed.
...
Introduced a few line breaks to make the Makefile easier to read.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44413 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 19:24:15 +00:00
Ted Kremenek
f387aeb136
Added initial test case for testing serialization of ASTs. This test
...
case simply performs --test-pickling on the code found in Sema/stmt_exprs.c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44412 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 19:23:15 +00:00
Ted Kremenek
6a18c7689b
Changed TestRunner.sh to dump the output and generated script files in
...
subdirectories mirroring where the test case file is located
For example, for the test case "Sema/stmt_exprs.c", instead of the files
"Output/stmt_exprs.c.out" and "Output/stmt_exprs.c.out.script" being created, the
files "Output/Sema/stmt_exprs.c.out" and "Output/Sema/stmt_exprs.c.out.script" are
created. This prevents any collisions from different test directories that have the
same file name for a test case, and also makes it clear where the test case was
drawn from.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 19:16:54 +00:00
Ted Kremenek
83c903f1ab
Added missing "RUN:" to comment for test case file. This fixed a bug where the test
...
case testing the frontend's support of statement expressions was not being
executed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44409 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 19:05:11 +00:00
Chris Lattner
b751c28a1a
Fix a bug checking for 'int foo(void)' that didn't look through typedefs of void.
...
Bug pointed out by Michael Zolda, thanks!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44408 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 18:51:29 +00:00
Oliver Hunt
0d3b50ec86
Fix typo in writable string test
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44398 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 06:52:03 +00:00
Oliver Hunt
01acb91aff
Adding code gen tests for writable and shared string literals.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44397 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 06:27:12 +00:00
Anders Carlsson
dd1b516f2f
Add more intrinsics. We can now correctly parse both Carbon.h and Cocoa.h without having to do -arch ppc.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44392 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 05:19:59 +00:00
Chris Lattner
4cc6271114
add several cases that Expr::hasStaticStorage missed, pointed out by Oliver Hunt
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44376 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 21:35:27 +00:00
Steve Naroff
529a4ad63b
Move the null pointer constant check from Sema::CheckSingleInitializer/ActOnCallExpr/CheckMessageArgumentTypes/ActOnReturnStmt to Sema::CheckSingleAssignmentConstraints. This makes sure all null pointer assignments are considered compatible.
...
Thanks to Seo Sanghyeon for the bug, follow-through, and patch!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44366 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 17:58:44 +00:00
Anders Carlsson
a64db8fa2a
Report errors for invalid casts from/to vectors.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44350 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 05:51:55 +00:00
Ted Kremenek
3f35148aa8
Fixed #include of objc/objc.h so that it works on case-sensitive filesystems.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44337 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26 22:49:09 +00:00
Fariborz Jahanian
2c7038b298
Patch to fix a regression caused by recent rewrite changes.
...
A potential API bug in ReplaceText pending (A FIXME is added).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44333 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26 19:52:57 +00:00
Bill Wendling
f5f20bdf91
The checking for the delimiters of expected error/warning messages was
...
looking only for { and } instead of {{ and }}. Changed it to check for
this explicitly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44326 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26 08:26:20 +00:00
Chris Lattner
a21ddb30e5
Fix sema support for the gnu ?: expression with a
...
missing middle expression, and fix a codegen bug where
we didn't correctly promote the condition to the right
result type. This fixes PR1824.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44322 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26 01:40:58 +00:00
Chris Lattner
09376fd7f7
this works.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44321 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26 01:39:17 +00:00
Anders Carlsson
6fa9086043
Check that the clobber registers are valid.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44311 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 00:25:21 +00:00
Ted Kremenek
ca7aa1f9ca
Added more test cases for uninitialized values checker.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44307 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-24 23:06:58 +00:00
Ted Kremenek
ff7c538f7c
Fixed bogus culling of uninitialized-values "taint" propagation during assignments.
...
We accidentally were throttling the propagation of uninitialized state across
assignments (e.g. x = y). Thanks to Anders Carlsson for spotting this problem.
Added test cases to test suite to provide regression testing for the
uninitialized values analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44306 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-24 20:07:36 +00:00
Ted Kremenek
bfc5e500bf
Moved dead-stores test cast to a new test suite subdirectory: Analysis.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44305 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-24 19:49:35 +00:00