Commit Graph

6248 Commits

Author SHA1 Message Date
Eli Friedman 8593748ed5 Put something sane in the DWARF offset field for bitfield ObjC ivars.
This is useful because unnamed bitfields can have effects on the
offsets which are not otherwise reflected in the DWARF information.

<rdar://problem/12629719>

llvm-svn: 167503
2012-11-06 23:40:48 +00:00
Anton Korobeynikov abed749203 Implement codegen for init_priority attribute properly - make sure it
works between the modules.
No functionality change on Darwin/Windows.
This fixes PR11480.

llvm-svn: 167496
2012-11-06 22:44:45 +00:00
Eli Friedman 8cbca20a59 Back out 167431+167437+167487; I didn't realize how incomplete our test
coverage of this code is.

llvm-svn: 167495
2012-11-06 22:15:52 +00:00
Eli Friedman 1e83d6f612 Fix a silly mistake in r167437.
llvm-svn: 167487
2012-11-06 21:10:22 +00:00
Manman Ren 77b0238596 Cleanup: 80-column violation
llvm-svn: 167476
2012-11-06 19:05:29 +00:00
Manman Ren 8cd99817f9 ARM byval: when type alignment is bigger than ABI alignment, instead of
disabling byval, we set realign to true.

It will perform an aligned alloca, and call memcpy to copy the byval
argument to the local variable.
Change the size threshold back to 64 bytes.

rdar://12596507

llvm-svn: 167440
2012-11-06 04:58:01 +00:00
Eli Friedman 70459fc5b6 Propagate CharUnits through CGObjCMac.cpp.
llvm-svn: 167437
2012-11-06 03:41:04 +00:00
Eli Friedman b201e4d6ab Minor fix to ObjC layout bitmap metadata. Found while I was trying to
refactor the code.

llvm-svn: 167436
2012-11-06 03:38:02 +00:00
Richard Smith c86a114409 Classify the INT_MIN/-1 check as -fsanitize=signed-integer-overflow, not as -fsanitize=divide-by-zero.
llvm-svn: 167433
2012-11-06 02:30:30 +00:00
Eli Friedman 5a56bb83cc Propagate CharUnits into ObjC CodeGen. No intended functional change.
llvm-svn: 167431
2012-11-06 01:51:20 +00:00
Douglas Gregor d612566385 Have the parser initialize Sema before it consumes the first
token. This is important because the first token could actually be
after an #include that triggers a module import, which might use
either Sema or the AST consumer before it would have been initialized.

llvm-svn: 167423
2012-11-05 23:58:27 +00:00
Manman Ren 505d68ffb8 ARM byval: when type alignment is bigger than ABI alignment, we can't guarantee
the type alignment of the byval argument. This patch will disable byval in this case,
it also increases the size threshold for turning on byval.

A backend fix will be attempted.

rdar://12596507

llvm-svn: 167416
2012-11-05 22:42:46 +00:00
Richard Smith b1b0ab41e7 Use the individual -fsanitize=<...> arguments to control which of the UBSan
checks to enable. Remove frontend support for -fcatch-undefined-behavior,
-faddress-sanitizer and -fthread-sanitizer now that they don't do anything.

llvm-svn: 167413
2012-11-05 22:21:05 +00:00
Richard Smith 43f9d9c6d9 Rename LangOptions members for address sanitizer and thread sanitizer from
*Sanitizer to Sanitize* in preparation for later patches.

llvm-svn: 167405
2012-11-05 21:48:12 +00:00
Ulrich Weigand 77ed89dbad On PowerPC64, integer arguments and return values need to be sign- or
zero-extended to 64 bits.  This information is currently provided to
the back end by setting "signext" or "zeroext" attributes.  However,
this is done only for integer types *smaller* than i32, not for i32
itself.  This causes clang to generate code violating the ABI, which
results in a failure of the tramp3d-v4 test case (due to calling a
system library routine without ABI-required extension).

This patch implements custom versions of classifyArgumentType and
classifyReturnType for PPC64_SVR4_ABIInfo, which are the same as the
default versions except that they also classify "int" and "unsigned int"
as types needing extending.  This fixed tramp3d-v4 on PowerPC64.

llvm-svn: 167393
2012-11-05 19:13:42 +00:00
Fariborz Jahanian 2c96d30dd8 Fixes liftime of captured block variables in mrr mode, per John's feedback, as
well as couple of tests which were not being excercised because of TYPOs.

llvm-svn: 167374
2012-11-04 18:19:40 +00:00
David Blaikie 8ed46b9935 Emit debug info for C++ struct definitions as DW_TAG_structure_type (instead of class_type).
llvm-svn: 167336
2012-11-02 23:40:00 +00:00
Fariborz Jahanian 2dd7819267 objective-C mrr block. Block variable layout metadata in
mrr mode.

llvm-svn: 167331
2012-11-02 22:51:18 +00:00
David Blaikie d37bbc3e00 Fix debug tag type of forward declarations of struct/class in C++.
llvm-svn: 167308
2012-11-02 20:49:01 +00:00
Quentin Colombet 4e172067b2 Update the front end to use minsize attribute
llvm-svn: 167266
2012-11-01 23:55:47 +00:00
Richard Smith 9c6890a792 Simplify: replace getContext().getLangOpts() with just getLangOpts().
llvm-svn: 167261
2012-11-01 22:30:59 +00:00
Richard Smith 3494df490b Clean up misapplication of diff.
llvm-svn: 167260
2012-11-01 22:16:43 +00:00
Richard Smith de67068fc1 Split emission of -ftrapv checks and -fcatch-undefined-behavior checks into
separate functions, since they share essentially no code.

llvm-svn: 167259
2012-11-01 22:15:34 +00:00
Richard Smith e29c441a89 Remove divison-by-zero checks from -ftrapv. These checks were incompatible with
g++'s -ftrapv, failed to call the -ftrapv overflow handler, and are still
available under -fcatch-undefined-behavior.

llvm-svn: 167258
2012-11-01 22:13:39 +00:00
Matt Beaumont-Gay 4a2874ecc6 Silence -Wformat on platforms where uint64_t is unsigned long.
llvm-svn: 167249
2012-11-01 20:26:42 +00:00
Fariborz Jahanian 23290b0570 objective-C block meta-data. This patch completes meta-data
generation for captured block variables in arc mode. This includes
inlined version of the meta-data when it can be done. It also includes
severat tests. This is wip. // rdar://12184410.

llvm-svn: 167241
2012-11-01 18:32:55 +00:00
Richard Smith 2d8b294b3c -fcatch-undefined-behavior: Start checking loads and stores for null pointers.
We want the diagnostic, and if the load is optimized away, we still want to
trap it. Stop checking non-default address spaces; that doesn't work in
general.

llvm-svn: 167219
2012-11-01 07:22:08 +00:00
Manman Ren b505d33a5c ARM AAPCS-VFP: fix tracking of allocated VFP registers.
According to the spec, we can backfill VFP registers that were skipped due
to alignment constraints.

llvm-svn: 167159
2012-10-31 19:02:26 +00:00
Manman Ren 2a523d864d ARM AAPCS-VFP: fix handling of homogeneous aggreate.
If HA can only partially fit into VFP registers, we add padding to make sure
HA will be on stack and later VFP CPRCs will be on stack as well.

llvm-svn: 167058
2012-10-30 23:21:41 +00:00
Fariborz Jahanian 39319c480e objective-C arc/mrr: Another patch for the new captured block variable
layout meta-data.  It is currently off (so no tests). This is wip.

llvm-svn: 167047
2012-10-30 20:05:29 +00:00
Quentin Colombet 7bba3f14bf Change ForceSizeOpt attribute into MinSize attribute
llvm-svn: 167021
2012-10-30 16:33:19 +00:00
Eli Friedman fb9c49e250 Don't crash on bad atomic operations. PR14176.
llvm-svn: 166992
2012-10-30 01:15:28 +00:00
Quentin Colombet ee3e0fb632 Revert commit r166946
llvm-svn: 166957
2012-10-29 18:28:57 +00:00
Quentin Colombet 0d6b5e5fde Make forcesizeopt attribute available to the end user
llvm-svn: 166946
2012-10-29 17:56:23 +00:00
Ulrich Weigand 7bcc7ec745 Handle '*' and '#' asm constraint modifiers.
llvm-svn: 166924
2012-10-29 12:20:54 +00:00
Fariborz Jahanian 0c58ce9346 objective-C arc/mrr: Patch for the new block variable layout meta-data.
It is currently off (so no tests). This is wip.

llvm-svn: 166892
2012-10-27 21:10:38 +00:00
Rafael Espindola 9c006de3d3 Move two helper functions to AST so that sema can use them.
llvm-svn: 166853
2012-10-27 01:03:43 +00:00
Rafael Espindola b9d75ca84b Refactor some code into a new findMaterializedTemporary function.
llvm-svn: 166849
2012-10-27 00:43:14 +00:00
Rafael Espindola b413676cd7 Refactor some code into a new skipRValueSubobjectAdjustments function.
llvm-svn: 166848
2012-10-27 00:40:06 +00:00
Rafael Espindola e7b11f5241 Delay codegen to after collecting all SubobjectAdjustment so that the collection
can be refactored and used in Sema.

llvm-svn: 166847
2012-10-27 00:36:38 +00:00
Eli Friedman fc5b2effcf Add missing safety check to an optimization for do-while loops. PR14191.
llvm-svn: 166832
2012-10-26 23:23:35 +00:00
Eli Friedman 0e84602d5c Don't crash synthesizing an ObjC property with an empty struct type. <rdar://problem/12547611>.
llvm-svn: 166825
2012-10-26 22:38:05 +00:00
Fariborz Jahanian 9dd2e0872e Add comment for my patch in r166809.
llvm-svn: 166823
2012-10-26 22:20:25 +00:00
Fariborz Jahanian 5f8d32425d Remove BLOCK_BYREF_LAYOUT_BYREF flags from list of
flags for __block variable meta-data.

llvm-svn: 166811
2012-10-26 20:33:59 +00:00
Fariborz Jahanian 2d26c29e0c objective-C IRGen: for @implementation nested in
extern "C", its method definitions must be IRGen'ed
before meta-data for class is generated. Otherwise,
IRGen crashes (to say the least).
// rdar://12581683 

llvm-svn: 166809
2012-10-26 20:22:11 +00:00
Bill Schmidt 4a2dcfe5ee This patch addresses a 64-bit PowerPC ELF ABI compatibility issue with
varargs parameter passing.

A strict reading of the ABI indicates that any argument with alignment greater
than 8 may require skipping doublewords in the parameter save area to align
the argument, and hence require skipping GPRs.  In practice, this is not done
by GCC.  The alignment restriction is used for internal alignment of a
structure, but a structure with 16-byte alignment, for example, is not
itself 16-byte aligned in the parameter save area.  Although this is messy,
it has become the de facto standard used in building existing libraries.

My initial varargs support followed the ABI language, but not the de facto
standard.  Running the GCC compatibility test suite exposed this issue, and
indeed showed that LLVM didn't pass parameters self-consistently with my
original logic.  Removing the additional alignment logic allows the affected
tests to now pass.

I modified the ppc64-varargs-struct.c test case to remove the existing test
for generation of alignment code, which is no longer appropriate.

Built and tested on powerpc64-unknown-linux-gnu with no new regressions.

llvm-svn: 166805
2012-10-26 19:59:03 +00:00
Fariborz Jahanian 77599ce809 Declare type of flags to be used in a __block (byref)
variable descriptor captured by a block.

llvm-svn: 166746
2012-10-26 01:13:38 +00:00
Quentin Colombet 5ee5ca1dbc Oz optimization level sets ForceSizeOpt attribute for each function
llvm-svn: 166744
2012-10-26 00:29:48 +00:00
Fariborz Jahanian a3926ec195 Changing name of enum for block literal flags to represent
what it is meant for.

llvm-svn: 166734
2012-10-25 22:55:52 +00:00
Fariborz Jahanian 196f9384c7 Add some new types in preparation of encoding of captured block variable
layout meta-data work. wip.

llvm-svn: 166717
2012-10-25 21:15:04 +00:00