aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
AgeCommit message (Collapse)Author
2012-11-06Cleanup: 80-column violationManman Ren
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167476 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06ARM byval: when type alignment is bigger than ABI alignment, instead ofManman Ren
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167440 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06Propagate CharUnits through CGObjCMac.cpp.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167437 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06Minor fix to ObjC layout bitmap metadata. Found while I was trying toEli Friedman
refactor the code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167436 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06Classify the INT_MIN/-1 check as -fsanitize=signed-integer-overflow, not as ↵Richard Smith
-fsanitize=divide-by-zero. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167433 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06Propagate CharUnits into ObjC CodeGen. No intended functional change.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167431 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-05Have the parser initialize Sema before it consumes the firstDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167423 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-05ARM byval: when type alignment is bigger than ABI alignment, we can't guaranteeManman Ren
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167416 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-05Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith
checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167413 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-05Rename LangOptions members for address sanitizer and thread sanitizer fromRichard Smith
*Sanitizer to Sanitize* in preparation for later patches. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167405 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-05On PowerPC64, integer arguments and return values need to be sign- orUlrich Weigand
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167393 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-04Fixes liftime of captured block variables in mrr mode, per John's feedback, asFariborz Jahanian
well as couple of tests which were not being excercised because of TYPOs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167374 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-02Emit debug info for C++ struct definitions as DW_TAG_structure_type (instead ↵David Blaikie
of class_type). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167336 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-02objective-C mrr block. Block variable layout metadata inFariborz Jahanian
mrr mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-02Fix debug tag type of forward declarations of struct/class in C++.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167308 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01Update the front end to use minsize attributeQuentin Colombet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167266 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01Simplify: replace getContext().getLangOpts() with just getLangOpts().Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167261 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01Clean up misapplication of diff.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167260 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01Split emission of -ftrapv checks and -fcatch-undefined-behavior checks intoRichard Smith
separate functions, since they share essentially no code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167259 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01Remove divison-by-zero checks from -ftrapv. These checks were incompatible withRichard Smith
g++'s -ftrapv, failed to call the -ftrapv overflow handler, and are still available under -fcatch-undefined-behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167258 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01Silence -Wformat on platforms where uint64_t is unsigned long.Matt Beaumont-Gay
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167249 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01objective-C block meta-data. This patch completes meta-dataFariborz Jahanian
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167241 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01-fcatch-undefined-behavior: Start checking loads and stores for null pointers.Richard Smith
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167219 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31ARM AAPCS-VFP: fix tracking of allocated VFP registers.Manman Ren
According to the spec, we can backfill VFP registers that were skipped due to alignment constraints. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167159 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30ARM AAPCS-VFP: fix handling of homogeneous aggreate.Manman Ren
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30objective-C arc/mrr: Another patch for the new captured block variable Fariborz Jahanian
layout meta-data. It is currently off (so no tests). This is wip. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167047 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30Change ForceSizeOpt attribute into MinSize attributeQuentin Colombet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167021 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30Don't crash on bad atomic operations. PR14176.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166992 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29Revert commit r166946Quentin Colombet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166957 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29Make forcesizeopt attribute available to the end userQuentin Colombet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166946 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29Handle '*' and '#' asm constraint modifiers.Ulrich Weigand
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166924 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-27objective-C arc/mrr: Patch for the new block variable layout meta-data.Fariborz Jahanian
It is currently off (so no tests). This is wip. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166892 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-27Move two helper functions to AST so that sema can use them.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166853 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-27Refactor some code into a new findMaterializedTemporary function.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166849 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-27Refactor some code into a new skipRValueSubobjectAdjustments function.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166848 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-27Delay codegen to after collecting all SubobjectAdjustment so that the collectionRafael Espindola
can be refactored and used in Sema. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166847 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26Add missing safety check to an optimization for do-while loops. PR14191.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166832 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26Don't crash synthesizing an ObjC property with an empty struct type. ↵Eli Friedman
<rdar://problem/12547611>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166825 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26Add comment for my patch in r166809.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166823 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26Remove BLOCK_BYREF_LAYOUT_BYREF flags from list ofFariborz Jahanian
flags for __block variable meta-data. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166811 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26objective-C IRGen: for @implementation nested in Fariborz Jahanian
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166809 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26This patch addresses a 64-bit PowerPC ELF ABI compatibility issue withBill Schmidt
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166805 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26Declare type of flags to be used in a __block (byref)Fariborz Jahanian
variable descriptor captured by a block. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166746 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26Oz optimization level sets ForceSizeOpt attribute for each functionQuentin Colombet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166744 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25Changing name of enum for block literal flags to representFariborz Jahanian
what it is meant for. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166734 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25Add some new types in preparation of encoding of captured block variableFariborz Jahanian
layout meta-data work. wip. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166717 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25Provide comment describing what buildBlockDescriptor does.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166703 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25Cleanup some clang code to use new type functions instead of using cast<>.Micah Villmow
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166684 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25Modify the targets to set appropriate calling convention defaults and C ↵David Tweed
variables when using a gnueabihf or aapcs-vfp target. Tested by me and Wei-Ren Chen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166679 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25Initialize debug info for special cases of functions that lack declarations ↵Alexey Samsonov
and are generated by Clang (global initializers/destructors, thunks) . Fixes PR13942. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166676 91177308-0d34-0410-b5e6-96231b3b80d8