John McCall
02dee0a46a
Semantic checking for main().
...
Fix some invalid main() methods in the test suite that were nicely
exposed by the new checks.
llvm-svn: 77047
2009-07-25 04:36:53 +00:00
Mike Stump
8e79f99b16
Implement new warning for functions declared 'noreturn' when they fall off the end.
...
llvm-svn: 76932
2009-07-24 02:49:01 +00:00
Daniel Dunbar
91ade14197
Output UTF-16 string literals independent of host byte order.
...
- Steve, can you take a look at this? It seems like this code should live
elsewhere, and there is a FIXME about having Sema validates the UTF-8 to
UTF-16 conversion.
llvm-svn: 76915
2009-07-23 23:41:22 +00:00
Anders Carlsson
516e5e7835
Correct a thinko in bitfield layout code. Fixes PR4611.
...
llvm-svn: 76898
2009-07-23 21:16:33 +00:00
Anders Carlsson
d78fc89fcb
We don't need to keep track of the packed alignment, just whether the struct is packed or not. Fixes PR4610.
...
llvm-svn: 76884
2009-07-23 17:24:40 +00:00
Anders Carlsson
718a89a501
Use arrays as union padding. Also, since the resulting struct will always contain a single element and either a single i8 element or an array of i8s, there's no reason to use a packed struct.
...
llvm-svn: 76854
2009-07-23 04:50:01 +00:00
Eli Friedman
5ac69057c0
Make vectorized floating-point comparisons work without crashing.
...
llvm-svn: 76726
2009-07-22 06:07:16 +00:00
Mon P Wang
acedf7768f
Preserve address space information through member accesses, e.g.,
...
__attribute__((address_space(1))) struct {int arr[ 3 ]; } *p1;
... = p1->arr[2]; // load from address space 1
llvm-svn: 76717
2009-07-22 03:08:17 +00:00
Mike Stump
5c1acd1f33
Revert this, was a bug in my new warning code, not the test case.
...
llvm-svn: 76690
2009-07-21 23:50:15 +00:00
Mike Stump
5e7869f63e
Prep for new warning.
...
llvm-svn: 76638
2009-07-21 20:52:43 +00:00
Daniel Dunbar
c3ab4c6c98
Detect when the current generation point is unreachable after emitting
...
expressions.
- This generally catches the important case of noreturn functions.
- With the last two changes, we are down to 152 unreachable blocks emitted on
403.gcc, vs the 1805 we started with.
llvm-svn: 76364
2009-07-19 08:23:12 +00:00
Daniel Dunbar
b6adc43f6e
Avoid generation of dead code in a few more situations.
...
- Emit variable declarations as "simple", we want to avoid forcing the creation
of a dummy basic block, but still need to make the variable available for
later use.
- With that, we can now skip IRgen for other unreachable statements (which
don't define a label).
- Anders, I added two fixmes on calls to EmitVLASize, can you check them?
llvm-svn: 76361
2009-07-19 06:58:07 +00:00
Chris Lattner
3afa3e1d91
codegen string literals using private linkage now like llvm-gcc, eliminating
...
some target hooks.
llvm-svn: 75895
2009-07-16 05:03:48 +00:00
Chris Lattner
2a7deb64c0
reimplement vector comparisons as [fi]cmp+sext instead of using v[if]cmp.
...
Also, enable them in sema so that they are tested, and now that the x86 backend
has stablized.
llvm-svn: 74983
2009-07-08 01:08:03 +00:00
Chris Lattner
877a48e67a
make these tests pass with the stack canary stuff even on targets where they default to on.
...
llvm-svn: 74412
2009-06-28 19:49:49 +00:00
Bill Wendling
d63bbadbef
Add stack protector support to clang. This generates the 'ssp' and 'sspreq'
...
function attributes. There are predefined macros that are defined when stack
protectors are used: __SSP__=1 with -fstack-protector and __SSP_ALL__=2 with
-fstack-protector-all.
llvm-svn: 74405
2009-06-28 07:36:13 +00:00
Devang Patel
0d425350b2
Revrt PR4228 fix for now.
...
llvm-svn: 74304
2009-06-26 18:32:22 +00:00
Chris Lattner
4c8da96ea9
fix PR4423.
...
llvm-svn: 73938
2009-06-23 01:38:41 +00:00
Eli Friedman
c619d6fab5
Add a target triple to a couple of tests which depend on it. Reported
...
by Mark Cianciosa on cfe-dev.
llvm-svn: 73672
2009-06-18 02:04:19 +00:00
Devang Patel
9fc4341eec
It is possible that main input file does not have any symbol with debug info. To handle this edge case, always create main compile unit first.
...
This fixes PR 4228.
llvm-svn: 73520
2009-06-16 18:02:02 +00:00
Chris Lattner
943658f00b
testcase for r72869, it turns out that it happens in Ruby.
...
llvm-svn: 73514
2009-06-16 17:39:02 +00:00
Eli Friedman
6282b3cff8
PR4390: Make sure to handle anonymous unions correctly while building
...
static intializers for structs.
llvm-svn: 73349
2009-06-14 21:41:37 +00:00
Eli Friedman
3192cc8526
Fix the calling convention for structs/unions containing SSE vectors on
...
x86-32. This is slightly messy, but I think it's consistent with gcc.
llvm-svn: 73306
2009-06-13 21:37:10 +00:00
Chris Lattner
4ca97c3b9e
Fix PR4372, another case where non-prototyped functions can prevent
...
always_inline from working.
llvm-svn: 73273
2009-06-13 00:26:38 +00:00
Daniel Dunbar
fd262b4a62
Fix test, which could miss failures, and also avoid leaving temporary .i file in
...
source directory.
llvm-svn: 73094
2009-06-08 22:44:26 +00:00
Daniel Dunbar
eed62b7c4b
Add stack alignment to x86_64 target data.
...
- <rdar://problem/6948443> WARNING: Linking two modules of different data
layouts!
llvm-svn: 73093
2009-06-08 22:39:13 +00:00
Eli Friedman
e9ff191459
Remove a few more vector builtins.
...
llvm-svn: 73022
2009-06-07 09:32:56 +00:00
Eli Friedman
5a996fc0fc
Now that LLVM CodeGen can handle the generic variations a bit better,
...
get rid of a few more clang vector builtins.
llvm-svn: 73015
2009-06-07 07:12:56 +00:00
Eli Friedman
07bbeca406
PR4339: make sure to properly extend/trunc the index of a vector element
...
insert/extract; the relevant instructions are defined to take only an
i32.
llvm-svn: 73005
2009-06-06 19:09:26 +00:00
Eli Friedman
5f75ff84b7
Test changes to account for removed builtins.
...
llvm-svn: 73004
2009-06-06 18:15:42 +00:00
Daniel Dunbar
feeeda70e2
weak_import should not make definitions have weak linkage.
...
- <rdar://problem/6948703> clang treats weak_import like weak
llvm-svn: 72967
2009-06-05 22:58:34 +00:00
Daniel Dunbar
4be99ff767
ABI handling: Fix nasty thinko where IRgen could generate an out-of-bounds read
...
when generating a coercion for ABI handling purposes.
- This may only manifest itself when building at -O0, but the practical effect
is that other arguments may get clobbered.
- <rdar://problem/6930451> [irgen] ABI coercion clobbers other arguments
llvm-svn: 72932
2009-06-05 07:58:54 +00:00
Eli Friedman
dd27484888
PR4316: Fix IRGen for cast-to-union extension.
...
llvm-svn: 72803
2009-06-03 20:45:06 +00:00
Daniel Dunbar
877b30f83c
Driver: Support -mllvm; this just forwards options to clang-cc.
...
llvm-svn: 72780
2009-06-03 16:16:27 +00:00
Daniel Dunbar
4b665ebb01
Add clang-cc support for -disable-llvm-optzns.
...
- Avoids running any LLVM optimizations, even at -O2, etc., while still keeping
any language changes these optimizations imply.
llvm-svn: 72742
2009-06-02 22:07:45 +00:00
Eli Friedman
cb9d07caeb
Add support for __builtin_unwind_init.
...
Also, committing an #if 0'ed __builtin_setjmp and __builtin_longjmp
implementation I've had sitting in my tree for a while. I haven't
enabled it because the LLVM backend support isn't complete yet.
llvm-svn: 72727
2009-06-02 09:37:50 +00:00
Eli Friedman
e32c02114f
PR4289: Make sure "&func" has the right LLVM type when "func" is a
...
K&R-style definition.
llvm-svn: 72690
2009-06-01 10:04:20 +00:00
Eli Friedman
202a68a917
Simplify run line.
...
llvm-svn: 72687
2009-06-01 08:55:08 +00:00
Mike Stump
2346cd2a10
Improve __builtin_nanf support; we now can deal with them as constants.
...
llvm-svn: 72607
2009-05-30 03:56:50 +00:00
Eli Friedman
9444638e4e
Re-add a slightly more general version of the check from r72578; it is
...
actually necessary in some obscure cases.
llvm-svn: 72585
2009-05-29 19:23:46 +00:00
Mike Stump
de83126b80
We don't want to validate bad code,
...
llvm-svn: 72574
2009-05-29 16:24:13 +00:00
Mike Stump
f9f89a3fee
Note another case that doesn't work yet.
...
llvm-svn: 72573
2009-05-29 16:12:36 +00:00
Mike Stump
df0fe27b66
Fixup the rest of the trivial cases of the codegen of volatile. If
...
any body can spot codegen bugs with volatile, or knows of any in the
bug database, let me know.
llvm-svn: 72572
2009-05-29 15:46:01 +00:00
Eli Friedman
2a69547f38
PR4281: Fix bogus CodeGen assertion. The issue is that
...
getUnqualifiedType() doesn't strip off all qualifiers for non-canonical
types.
llvm-svn: 72552
2009-05-28 23:04:00 +00:00
Daniel Dunbar
16f422ec86
Fix a use-of-undefined, IRgen expects the RValue for "void" to be a scalar RValue.
...
llvm-svn: 72504
2009-05-27 23:45:33 +00:00
Mike Stump
de79ea2f51
Update comment.
...
llvm-svn: 72444
2009-05-26 23:35:31 +00:00
Mike Stump
6adbd62790
And an additional testcase that also works.
...
llvm-svn: 72441
2009-05-26 23:10:55 +00:00
Mike Stump
ec3cbfe8c6
Fixup codegen for volatile structs in the trivial cases (a a=a and a=a=a).
...
llvm-svn: 72439
2009-05-26 22:03:21 +00:00
Daniel Dunbar
1518b64ddc
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
llvm-svn: 72419
2009-05-26 16:37:37 +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