summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with ↵Aaron Ballman2014-03-131-23/+17
| | | | | | iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803
* ARM: Correct alignment of structs passed as byval pointerOliver Stannard2014-03-121-1/+1
| | | | | | | | | | When a struct has bitfields overlapping with other members (as required by the AAPCS), clang uses a packed struct to represent this. If such a struct is large enough for clang to pass it as a byval pointer (>64 bytes), we need to set the alignment of the argument to match the original type. llvm-svn: 203660
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-90/+91
| | | | | | class. llvm-svn: 203643
* [C++11] Replacing RecordDecl iterators field_begin() and field_end() with ↵Aaron Ballman2014-03-081-23/+8
| | | | | | iterator_range fields(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203355
* correct consitency of XCore capsRobert Lytton2014-03-031-4/+4
| | | | llvm-svn: 202711
* Add AArch64 big endian Target (aarch64_be)Christian Pirker2014-02-251-0/+1
| | | | llvm-svn: 202151
* MS ABI: Return sret parameters when using inallocaReid Kleckner2014-02-251-0/+2
| | | | | | | | Previously the X86 backend would look for the sret attribute and handle this for us. inalloca takes that all away, so we have to do the return ourselves now. llvm-svn: 202097
* Implement getDwarfEHStackPointer() and initDwarfEHRegSizeTable() for sparcv9.Roman Divacky2014-02-241-0/+41
| | | | llvm-svn: 202059
* AAPCS: Do not split structs after CPRC allocated on stackOliver Stannard2014-02-111-43/+130
| | | | | | | | | | 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. llvm-svn: 201137
* Fix AAPCS compliance for HFAs containing doubles and long doublesOliver Stannard2014-02-071-4/+23
| | | | | | | | | 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). llvm-svn: 200971
* [ms-cxxabi] Use inalloca on win32 when passing non-trivial C++ objectsReid Kleckner2014-02-011-12/+109
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 200597
* [ms-cxxabi] Use x86_cdeclmethodcc for __cdecl methods on win32Reid Kleckner2014-01-311-17/+22
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 200587
* [ARM] Fix AAPCS-VFP non-compliance when returning HFA from variadic functions.Amara Emerson2014-01-281-8/+10
| | | | | | | | | Arguments and return values must always be marshalled as for the base AAPCS when the callee is a variadic function. Patch by Oliver Stannard! llvm-svn: 200307
* Refactor ABI argument lowering a littleReid Kleckner2014-01-181-57/+60
| | | | | | | | | Currently it tracks the number of free registers, but soon it will track stack offsets for inalloca lowering. No functional change. llvm-svn: 199532
* SPARC passes non-trivial C++ objects indirectly like everybody else.Jakob Stoklund Olesen2014-01-121-0/+5
| | | | llvm-svn: 199037
* Hosting a call to getAttr so that we don't call it multiple times for the ↵Aaron Ballman2013-12-191-9/+5
| | | | | | same attribute. Also removes a hasAttr that's not required. No functional changes intended. llvm-svn: 197675
* Replacing calls to getAttr with calls to hasAttr for clarity. No functional ↵Aaron Ballman2013-12-191-1/+1
| | | | | | change intended -- this only replaces Boolean uses of getAttr. llvm-svn: 197648
* Support EABIHF environment on ARM.Joerg Sonnenberger2013-12-161-1/+12
| | | | llvm-svn: 197406
* GNUEABIHF is the same as GNUEABI for anything not float/double related,Joerg Sonnenberger2013-12-161-0/+1
| | | | | | so use the same exception size as GNUEABI does. llvm-svn: 197404
* Replace use of Triple::getEnvironmentName with the simplerJoerg Sonnenberger2013-12-121-4/+9
| | | | | | Triple::getEnvironment. llvm-svn: 197181
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-051-2/+2
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
* [SystemZ] Fix handling of pass-by-pointer argumentsRichard Sandiford2013-12-041-3/+3
| | | | | | | | | | | | | | | | 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. llvm-svn: 196370
* [NVPTX] Update ABI handlingJustin Holewinski2013-11-201-6/+16
| | | | | | For PTX, we want the target to handle struct returns directly. llvm-svn: 195268
* [mips] Partially revert r193640. Stack alignment should not be determined byAkira Hatanaka2013-11-111-8/+8
| | | | | | the floating point register mode. llvm-svn: 194426
* Use StringRef::endswith_lower. No functionality change.Rui Ueyama2013-10-311-3/+1
| | | | llvm-svn: 193788
* Add CodeGenABITypes.h for use in LLDB.Mark Lacey2013-10-301-0/+1
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 193717
* [mips] Align the stack to 16-bytes for -mfp64.Akira Hatanaka2013-10-291-8/+8
| | | | llvm-svn: 193640
* [mips] Use the distance between the current argument's starting address andAkira Hatanaka2013-10-291-11/+10
| | | | | | | | | the previous argument's ending address to compute the type of the padding argument. No intended functionality change. llvm-svn: 193638
* Implement function type checker for the undefined behavior sanitizer.Peter Collingbourne2013-10-201-0/+16
| | | | | | | | | This uses function prefix data to store function type information at the function pointer. Differential Revision: http://llvm-reviews.chandlerc.com/D1338 llvm-svn: 193058
* Fixed "ArgSize may be used uninitialised" error when compiling with gcc.Andy Gibbs2013-10-141-1/+1
| | | | llvm-svn: 192570
* XCore : Fix bug in XCoreABIInfo::EmitVAArg()Robert Lytton2013-10-111-13/+27
| | | | | | Incorrect handling of 'double' and 'long long int' llvm-svn: 192436
* remove a dead assignment. The variables are set just right after. Found by ↵Sylvestre Ledru2013-10-061-1/+1
| | | | | | scan-build http://buildd-clang.debian.net/scan-build/ llvm-svn: 192061
* Pass CGCXXABIs around directly.Mark Lacey2013-10-061-26/+31
| | | | | | | | | | 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. llvm-svn: 192052
* Use the CGCXXABI member on CodeGenTypes.Mark Lacey2013-10-021-2/+2
| | | | | | | | | | 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. llvm-svn: 191854
* Implement ARM GNU-style interrupt attributeTim Northover2013-10-011-1/+40
| | | | | | | | | | 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 llvm-svn: 191769
* Clean up some Triple usage in clang.Cameron Esfahani2013-09-141-2/+2
| | | | llvm-svn: 190737
* Delete CC_Default and use the target default CC everywhereReid Kleckner2013-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 189412
* Fix -Wcovered-switch-default warning from r188664Alexey Samsonov2013-08-191-1/+1
| | | | llvm-svn: 188672
* XCore target: Add target specific EmitVAArgRobert Lytton2013-08-191-1/+41
| | | | | | This is so aggregates can be passed as var args too. llvm-svn: 188664
* Add XCore targetRobert Lytton2013-08-131-0/+19
| | | | llvm-svn: 188258
* [PowerPC] Support powerpc64le as a syntax-checking target.Bill Schmidt2013-07-261-0/+3
| | | | | | | | | | | | | | | | | | | 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. llvm-svn: 187180
* Remove the mblaze backend from clang.Rafael Espindola2013-07-251-113/+0
| | | | | | Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html llvm-svn: 187143
* Partial revert of r185568.Eli Bendersky2013-07-241-4/+0
| | | | | | | | 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). llvm-svn: 187079
* [PowerPC64] Fix passing of single-vector-member structs to match ABI.Bill Schmidt2013-07-231-2/+2
| | | | | | | | | | | | | | | | | 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 llvm-svn: 186993
* Simplify code. No functional change.Craig Topper2013-07-081-3/+1
| | | | llvm-svn: 185792
* Use SmallVectorImpl& for function arguments instead of SmallVector.Craig Topper2013-07-051-2/+2
| | | | llvm-svn: 185715
* Add target hook CodeGen queries when generating builtin pow*.Eli Bendersky2013-07-031-0/+4
| | | | | | | | | | | 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. llvm-svn: 185568
* Teach ARM va_arg to ignore empty structs.Tim Northover2013-06-211-0/+6
| | | | | | | | 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. llvm-svn: 184605
* Check for trivial constructibility before emptiness in ARM ABI.Tim Northover2013-06-211-3/+3
| | | | | | | | | | | | 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. llvm-svn: 184603
* Add support for -fpcc-struct-return. Patch by Arthur O'Dwyer!John McCall2013-06-181-22/+47
| | | | llvm-svn: 184166
OpenPOWER on IntegriCloud