summaryrefslogtreecommitdiff
path: root/lib/CodeGen/TargetInfo.cpp
Commit message (Collapse)AuthorAge
...
* Implement getDwarfEHStackPointer() and initDwarfEHRegSizeTable() for sparcv9.Roman Divacky2014-02-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202059 91177308-0d34-0410-b5e6-96231b3b80d8
* AAPCS: Do not split structs after CPRC allocated on stackOliver Stannard2014-02-11
| | | | | | | | | | | | According to the AAPCS, we can split structs between GPRs and the stack, except for when an argument has already been allocated on the stack. This can occur when a large number of floating-point arguments fill up the VFP registers, and are alllocated on the stack before the general-purpose argument registers are full. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201137 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix AAPCS compliance for HFAs containing doubles and long doublesOliver Stannard2014-02-07
| | | | | | | | | | | An HFA is defined as a struct containing floating point values of the same machine type. In the 32-bit ABI, double and long double have the same machine type, so a struct with a mixture of these types must be an HFA (assuming it meets the other criteria). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200971 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-cxxabi] Use inalloca on win32 when passing non-trivial C++ objectsReid Kleckner2014-02-01
| | | | | | | | | | | | | | | | | | | When a non-trivial parameter is present, clang now gathers up all the parameters that lack inreg and puts them into a packed struct. MSVC always aligns each parameter to 4 bytes and no more, so this is a pretty simple struct to lay out. On win64, non-trivial records are passed indirectly. Prior to this change, clang was incorrectly using byval on win64. I'm able to self-host a working clang with this change and additional LLVM patches. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2636 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200597 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-cxxabi] Use x86_cdeclmethodcc for __cdecl methods on win32Reid Kleckner2014-01-31
| | | | | | | | | | | | | | | | | | | This fixes PR15768, where the sret parameter and the 'this' parameter are in the wrong order. Instance methods compiled by MSVC never return records in registers, they always return indirectly through an sret pointer. That sret pointer always comes after the 'this' parameter, for both __cdecl and __thiscall methods. Unfortunately, the same is true for other calling conventions, so we'll have to change the overall approach here relatively soon. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2664 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200587 91177308-0d34-0410-b5e6-96231b3b80d8
* [ARM] Fix AAPCS-VFP non-compliance when returning HFA from variadic functions.Amara Emerson2014-01-28
| | | | | | | | | | Arguments and return values must always be marshalled as for the base AAPCS when the callee is a variadic function. Patch by Oliver Stannard! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200307 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor ABI argument lowering a littleReid Kleckner2014-01-18
| | | | | | | | | Currently it tracks the number of free registers, but soon it will track stack offsets for inalloca lowering. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199532 91177308-0d34-0410-b5e6-96231b3b80d8
* SPARC passes non-trivial C++ objects indirectly like everybody else.Jakob Stoklund Olesen2014-01-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199037 91177308-0d34-0410-b5e6-96231b3b80d8
* Hosting a call to getAttr so that we don't call it multiple times for the ↵Aaron Ballman2013-12-19
| | | | | | same attribute. Also removes a hasAttr that's not required. No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197675 91177308-0d34-0410-b5e6-96231b3b80d8
* Replacing calls to getAttr with calls to hasAttr for clarity. No functional ↵Aaron Ballman2013-12-19
| | | | | | change intended -- this only replaces Boolean uses of getAttr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197648 91177308-0d34-0410-b5e6-96231b3b80d8
* Support EABIHF environment on ARM.Joerg Sonnenberger2013-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197406 91177308-0d34-0410-b5e6-96231b3b80d8
* GNUEABIHF is the same as GNUEABI for anything not float/double related,Joerg Sonnenberger2013-12-16
| | | | | | | so use the same exception size as GNUEABI does. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197404 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace use of Triple::getEnvironmentName with the simplerJoerg Sonnenberger2013-12-12
| | | | | | | Triple::getEnvironment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197181 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-05
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196466 91177308-0d34-0410-b5e6-96231b3b80d8
* [SystemZ] Fix handling of pass-by-pointer argumentsRichard Sandiford2013-12-04
| | | | | | | | | | | | | | | | | I'd misunderstood getIndirect() to mean that the argument should be passed as a pointer at the ABI level, with the ByVal argument choosing caller-copy semantics over no-caller-copy (callee-copy-on-write) semantics. But getIndirect(x) actually means that x is passed by pointer at the IR level but (at least on all other targets I looked at) directly at the ABI level. getIndirect(x, false) selects a pointer to a caller-made copy, which is what SystemZ was aiming for. This fixes a miscompilation of c-index-test. Structure arguments were being passed by pointer, but no copy was being made, so a write in the callee stomped over a caller's local variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196370 91177308-0d34-0410-b5e6-96231b3b80d8
* [NVPTX] Update ABI handlingJustin Holewinski2013-11-20
| | | | | | For PTX, we want the target to handle struct returns directly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195268 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Partially revert r193640. Stack alignment should not be determined byAkira Hatanaka2013-11-11
| | | | | | | the floating point register mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194426 91177308-0d34-0410-b5e6-96231b3b80d8
* Use StringRef::endswith_lower. No functionality change.Rui Ueyama2013-10-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193788 91177308-0d34-0410-b5e6-96231b3b80d8
* Add CodeGenABITypes.h for use in LLDB.Mark Lacey2013-10-30
| | | | | | | | | | | | | | | | | | CodeGenABITypes is a wrapper built on top of CodeGenModule that exposes some of the functionality of CodeGenTypes (held by CodeGenModule), specifically methods that determine the LLVM types appropriate for function argument and return values. I addition to CodeGenABITypes.h, CGFunctionInfo.h is introduced, and the definitions of ABIArgInfo, RequiredArgs, and CGFunctionInfo are moved into this new header from the private headers ABIInfo.h and CGCall.h. Exposing this functionality is one part of making it possible for LLDB to determine the actual ABI locations of function arguments and return values, making it possible for it to determine this for any supported target without hard-coding ABI knowledge in the LLDB code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193717 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Align the stack to 16-bytes for -mfp64.Akira Hatanaka2013-10-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193640 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Use the distance between the current argument's starting address andAkira Hatanaka2013-10-29
| | | | | | | | | | the previous argument's ending address to compute the type of the padding argument. No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193638 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement function type checker for the undefined behavior sanitizer.Peter Collingbourne2013-10-20
| | | | | | | | | This uses function prefix data to store function type information at the function pointer. Differential Revision: http://llvm-reviews.chandlerc.com/D1338 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193058 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed "ArgSize may be used uninitialised" error when compiling with gcc.Andy Gibbs2013-10-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192570 91177308-0d34-0410-b5e6-96231b3b80d8
* XCore : Fix bug in XCoreABIInfo::EmitVAArg()Robert Lytton2013-10-11
| | | | | | Incorrect handling of 'double' and 'long long int' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192436 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a dead assignment. The variables are set just right after. Found by ↵Sylvestre Ledru2013-10-06
| | | | | | scan-build http://buildd-clang.debian.net/scan-build/ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192061 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass CGCXXABIs around directly.Mark Lacey2013-10-06
| | | | | | | | | | In functions that only need to use the CGCXXABI member of a CodeGenTypes class, pass that reference around directly rather than a reference to a CodeGenTypes class. This makes the actual dependence on CGCXXABI clear at the call sites. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192052 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the CGCXXABI member on CodeGenTypes.Mark Lacey2013-10-02
| | | | | | | | | | CodeGenTypes already has a reference to a CGCXXABI. Use this directly rather than going through CodeGenModule to get to the same information. This is consistent with other references to CGCXXABI in CodeGenTypes functions defined in CGCall.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191854 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement ARM GNU-style interrupt attributeTim Northover2013-10-01
| | | | | | | | | | This attribute allows users to use a modified C or C++ function as an ARM exception-handling function and, with care, to successfully return control to user-space after the issue has been dealt with. rdar://problem/14207019 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191769 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up some Triple usage in clang.Cameron Esfahani2013-09-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190737 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete CC_Default and use the target default CC everywhereReid Kleckner2013-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Makes functions with implicit calling convention compatible with function types with a matching explicit calling convention. This fixes things like calls to qsort(), which has an explicit __cdecl attribute on the comparator in Windows headers. Clang will now infer the calling convention from the declarator. There are two cases when the CC must be adjusted during redeclaration: 1. When defining a non-inline static method. 2. When redeclaring a function with an implicit or mismatched convention. Fixes PR13457, and allows clang to compile CommandLine.cpp for the Microsoft C++ ABI. Excellent test cases provided by Alexander Zinenko! Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1231 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189412 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix -Wcovered-switch-default warning from r188664Alexey Samsonov2013-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188672 91177308-0d34-0410-b5e6-96231b3b80d8
* XCore target: Add target specific EmitVAArgRobert Lytton2013-08-19
| | | | | | This is so aggregates can be passed as var args too. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188664 91177308-0d34-0410-b5e6-96231b3b80d8
* Add XCore targetRobert Lytton2013-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188258 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Support powerpc64le as a syntax-checking target.Bill Schmidt2013-07-26
| | | | | | | | | | | | | | | | | | | | This patch provides basic support for powerpc64le as an LLVM target. However, use of this target will not actually generate little-endian code. Instead, use of the target will cause the correct little-endian built-in defines to be generated, so that code that tests for __LITTLE_ENDIAN__, for example, will be correctly parsed for syntax-only testing. Code generation will otherwise be the same as powerpc64 (big-endian), for now. The patch leaves open the possibility of creating a little-endian PowerPC64 back end, but there is no immediate intent to create such a thing. The new test case variant ensures that correct built-in defines for little-endian code are generated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187180 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the mblaze backend from clang.Rafael Espindola2013-07-25
| | | | | | Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187143 91177308-0d34-0410-b5e6-96231b3b80d8
* Partial revert of r185568.Eli Bendersky2013-07-24
| | | | | | | | | | r186899 and r187061 added a preferred way for some architectures not to get intrinsic generation for math builtins. So the code changes in r185568 can now be undone (the test remains). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187079 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC64] Fix passing of single-vector-member structs to match ABI.Bill Schmidt2013-07-23
| | | | | | | | | | | | | | | | | | | The 64-bit PowerPC ELF ABI requires a struct that contains a single vector member to be passed in a vector register as though the wrapping struct were not present. Instead we were passing this as a byval struct. The same logic was already present for floating-point arguments, so this patch just extends the logic to handle vector types. The new test case verifies that clang coerces the parameter and annotates it as inreg. Thanks, Bill git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186993 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code. No functional change.Craig Topper2013-07-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185792 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallVectorImpl& for function arguments instead of SmallVector.Craig Topper2013-07-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185715 91177308-0d34-0410-b5e6-96231b3b80d8
* Add target hook CodeGen queries when generating builtin pow*.Eli Bendersky2013-07-03
| | | | | | | | | | | | | | Without fmath-errno, Clang currently generates calls to @llvm.pow.* intrinsics when it sees pow*(). This may not be suitable for all targets (for example le32/PNaCl), so the attached patch adds a target hook that CodeGen queries. The target can state its preference for having or not having the intrinsic generated. Non-PNaCl behavior remains unchanged; PNaCl-specific test added. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185568 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ARM va_arg to ignore empty structs.Tim Northover2013-06-21
| | | | | | | | Empty structs are ignored for parameter passing purposes, but va_arg was incrementing the pointer anyway which could lead to va_list getting out of sync. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184605 91177308-0d34-0410-b5e6-96231b3b80d8
* Check for trivial constructibility before emptiness in ARM ABI.Tim Northover2013-06-21
| | | | | | | | | | | | According to the Itanium ABI (3.1.1), types with non-trivial copy constructors passed by value should be passed indirectly, with the caller creating a temporary. We got this mostly correct, but forgot that empty structs can have non-trivial constructors too and passed them incorrectly. This simply reverses the order of the check. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184603 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for -fpcc-struct-return. Patch by Arthur O'Dwyer!John McCall2013-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184166 91177308-0d34-0410-b5e6-96231b3b80d8
* Silencing a signed vs unsigned comparison mismatch in MSVC.Aaron Ballman2013-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183837 91177308-0d34-0410-b5e6-96231b3b80d8
* Make va_arg and argument passing to varargs functions work correctly withEli Friedman2013-06-12
| | | | | | | | | | AVX vectors when AVX is turned on. Fixes <rdar://problem/10513611>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183813 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a very silly mistake in r183590.Eli Friedman2013-06-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183720 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix va_arg on x86-64 for a struct containing a single int128_t. PR16248Eli Friedman2013-06-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183590 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix line endings.Eli Friedman2013-06-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183583 91177308-0d34-0410-b5e6-96231b3b80d8
* Diagnose malformed x86 inline asm using 'y' constraint.Tim Northover2013-06-07
| | | | | | | | X86's 'y' inline assembly constraint represents an MMX register, this change prevents Clang from hitting an assertion when passed an incompatible type to deal with. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183467 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement SparcV9ABIInfo::EmitVAArg.Jakob Stoklund Olesen2013-06-05
| | | | | | | | | | | | This could actually be implemented with the LLVM IR va_arg instruction, but it doesn't seem to offer any advantages over accessing the va_list pointer directly. Using the va_list pointer directly makes it possible to perform type coercion directly from the argument array, and the va_list updates are exposed to the optimizers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183292 91177308-0d34-0410-b5e6-96231b3b80d8