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
Mike Stump
c63428b192
Fixup codegen for __block int i; i += rhs();. Should also slightly
...
improve codegen in some cases.
llvm-svn: 72273
2009-05-22 19:07:20 +00:00
Daniel Dunbar
499f3f9c5d
x86_64 ABI: Account for sret parameters consuming an integer register.
...
- PR4242.
llvm-svn: 72268
2009-05-22 17:33:44 +00:00
Torok Edwin
5b34933b90
Set correct calling convention even if there is a bitcast in the way.
...
This attempts to fix PR4239.
llvm-svn: 72251
2009-05-22 07:25:06 +00:00
Mike Stump
aed08f9929
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.
llvm-svn: 72226
2009-05-21 21:05:15 +00:00
Daniel Dunbar
018958d94d
Update test
...
llvm-svn: 72110
2009-05-19 16:09:59 +00:00
Eli Friedman
45966b4671
Remove the -arch option from clang-cc: for all practical purposes, it's
...
redundant with -triple.
llvm-svn: 72108
2009-05-19 11:12:40 +00:00
Anders Carlsson
8dd2947696
Remove an unused builtin.
...
llvm-svn: 72033
2009-05-18 19:25:54 +00:00
Anders Carlsson
2081200b8c
Add 'cmp' SSE builtins and get rid of a bunch of other builtins.
...
llvm-svn: 72032
2009-05-18 19:16:46 +00:00
Daniel Dunbar
2daacd1f08
Avoid generating temp in source directory
...
llvm-svn: 71776
2009-05-14 17:00:11 +00:00
Daniel Dunbar
ffdb8439d7
ABI handling: Fix invalid assertion, it is possible for a valid
...
coercion to be specified which truncates padding bits. It would be
nice to still have the assert, but we don't have any API call for the
unpadding size of a type yet.
llvm-svn: 71695
2009-05-13 18:54:26 +00:00
Chris Lattner
afde259240
implement __sync_synchronize and __sync_lock_release,
...
rdar://6880573
llvm-svn: 71637
2009-05-13 04:46:13 +00:00
Chris Lattner
e541ea3a61
implement l-value codegen of comma expr
...
llvm-svn: 71595
2009-05-12 21:28:12 +00:00
Daniel Dunbar
bbfd054746
Darwin x86-32 ABI: Now that structure passing is farther along, we
...
don't need special treatment for unions.
llvm-svn: 71559
2009-05-12 17:00:20 +00:00
Daniel Dunbar
203e2e8dd8
x86-64 ABI: clang incorrectly passes union { long double, float } in
...
register.
- Merge algorithm was returning MEMORY as it should.
llvm-svn: 71556
2009-05-12 15:22:40 +00:00
Daniel Dunbar
097353cbb5
Darwin x86-32: Multi-dimensional arrays were not handled correctly,
...
spotted by Eli!
llvm-svn: 71490
2009-05-11 23:01:34 +00:00
Daniel Dunbar
e92449e4cc
Make cleanup-stack.c test stronger, and work in release-asserts mode.
...
llvm-svn: 71484
2009-05-11 22:30:29 +00:00
Daniel Dunbar
2ce6b3f91c
Darwin x86_32: Treat records with unnamed bit-fields as "empty".
...
llvm-svn: 71461
2009-05-11 18:58:49 +00:00
Chris Lattner
da38fda583
force a target triple so that the right greppable output happens.
...
llvm-svn: 71361
2009-05-09 17:36:58 +00:00
Daniel Dunbar
b997f3bcc3
x86_64 ABI: Ignore padding bit-fields during classification.
...
- {return-types,single-args}-{32,64} pass the first 1k ABI tests with
bit-fields enabled.
llvm-svn: 71272
2009-05-08 22:26:44 +00:00
Daniel Dunbar
4752783057
Darwin x86_32: When coercing a "single element" structure, make sure
...
to use a wide enough type. This might be wider than the "single
element"'s type in the presence of padding bit-fields.
- Darwin x86_32 now passes the first 1k ABI tests with bit-field
generation enabled.
llvm-svn: 71270
2009-05-08 21:30:11 +00:00
Daniel Dunbar
fdda3501a0
Darwin x86_32: Ignore padding bit-fields when looking for "single
...
element" structures.
llvm-svn: 71266
2009-05-08 21:04:47 +00:00
Daniel Dunbar
4861346c44
Darwin x86_32: Improve bit-field handling for returning records.
...
- This turns out to be a no-op now that most of the handling for
everything else is in place.
llvm-svn: 71261
2009-05-08 20:55:49 +00:00
Daniel Dunbar
85f4028f2e
Darwin x86_32: Ignore arrays of empty structures inside records.
...
- This eliminates 5/1000 failures on return-types-32, on the current
ABITest config.
llvm-svn: 71250
2009-05-08 20:21:04 +00:00
Chris Lattner
5b9241b2a6
Fix the atomics sema code to convert operands to the argument types
...
of the underlying _N builtin, not the the type of the pointee of the
actual type. This ensures that atomics involving pointers end up
using the correct integer type when they are resolved, avoiding
aborts in codegen.
llvm-svn: 71218
2009-05-08 15:36:58 +00:00
Chris Lattner
dc04654697
reimplement __sync_* builtins to be variadic and to follow the same
...
semantic rules that gcc and icc use. This implements the variadic
and concrete versions as builtins and has sema do the
disambiguation. There are probably a bunch of details to finish up
but this seems like a large monotonic step forward :)
llvm-svn: 71212
2009-05-08 06:58:22 +00:00
Eli Friedman
7ce29a18e1
Fix crash with constant initialization of bit-fields in unions.
...
llvm-svn: 71194
2009-05-07 23:42:42 +00:00
Daniel Dunbar
4dbaaa6f43
Improve handling of (X86) target features.
...
- This is a WIP...
- This adds -march= handling to the driver, and fixes the defaulting
of -mcpu on Darwin (which was using the wrong test).
Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as
-target-feature [+-]name
In clang-cc, communicate with the (clang) target to discover the legal
features of a target, and the features which are enabled based on
-mcpu. This is currently hardcoded just enough to not be a feature
regression, we need to get this information from the backend's
TableGen information somehow.
This is used to construct the full list of features which are being
used, which is in turn used to initialize the predefines.
llvm-svn: 71061
2009-05-06 03:16:41 +00:00
Chris Lattner
36797ab251
When defining a function whose type has no prototype, make an effort
...
to go back and clean up existing uses of the bitcasted function. This
is not just an optimization: it is required for correctness to get
always inline functions to work, see testcases in function-attributes.c.
llvm-svn: 70971
2009-05-05 06:16:31 +00:00
Eli Friedman
2ad7e17096
PR4143: don't crash generating debug info for incomplete enum types.
...
llvm-svn: 70825
2009-05-04 04:39:55 +00:00
Eli Friedman
5b73b5e197
PR4134: Implement __builtin_extract_return_addr.
...
llvm-svn: 70794
2009-05-03 19:23:23 +00:00
Eli Friedman
c0042d804c
PR4133: fix always_inline implementation to be consistent with gcc.
...
llvm-svn: 70786
2009-05-03 18:13:43 +00:00
Chris Lattner
61af27860d
look at the right operand when increasing the size of an asm output,
...
this fixes http://llvm.org/bugs/show_bug.cgi?id=3373#c20
llvm-svn: 70685
2009-05-03 09:05:53 +00:00
Chris Lattner
cc1cde9c57
allow references to the larger value in a tied constraint
...
from the asm string, but reject references to the smaller one.
llvm-svn: 70679
2009-05-03 08:32:32 +00:00
Chris Lattner
59c3a9cd54
add support for tying asm operands where the result is smaller than
...
the input. This is part of PR3373.
llvm-svn: 70677
2009-05-03 08:21:20 +00:00
Daniel Dunbar
c7121faa71
Remove typo
...
llvm-svn: 70676
2009-05-03 08:00:14 +00:00
Chris Lattner
10f221f321
implement support for asm outputs targetting non-simple lvalue destinations
...
like bitfields. incidentally llvm-gcc crashes on this sort of thing also. :)
llvm-svn: 70675
2009-05-03 07:53:25 +00:00
Chris Lattner
b65933eaa2
handle codegen of asms where a small input is tied to a large output.
...
llvm-svn: 70672
2009-05-03 07:27:51 +00:00
Douglas Gregor
8d9c509975
Implement bit-field promotion rules for C99. Fixes PR3500.
...
llvm-svn: 70571
2009-05-01 20:41:21 +00:00
Douglas Gregor
72a57b89aa
Add testcase that illustrates the problem from r69699 regarding tentative definitions of statics
...
llvm-svn: 70543
2009-05-01 15:45:53 +00:00
Mike Stump
d898026e8a
Don't assert when we think we need copy/dispose, but don't need them.
...
Radar 6838889
llvm-svn: 70525
2009-05-01 01:31:57 +00:00
Anders Carlsson
b4e463287e
Don't use indirect memory destinations for inline asm. Fixes 6841383.
...
llvm-svn: 70523
2009-05-01 00:16:04 +00:00
Eli Friedman
902fddd1cf
Fix for PR4108: be a bit looser with the casts that we accept in
...
constant initializers.
llvm-svn: 70483
2009-04-30 07:03:22 +00:00
Chris Lattner
7d4f5c47ce
only support int128_t on 64-bit and larger targets. 32-bit targets don't
...
have support for __divti3 and friends.
llvm-svn: 70480
2009-04-30 06:18:40 +00:00