summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Silencing a signed vs unsigned comparison mismatch in MSVC.Aaron Ballman2013-06-121-1/+2
| | | | llvm-svn: 183837
* Make va_arg and argument passing to varargs functions work correctly withEli Friedman2013-06-121-14/+35
| | | | | | | | AVX vectors when AVX is turned on. Fixes <rdar://problem/10513611>. llvm-svn: 183813
* Fix a very silly mistake in r183590.Eli Friedman2013-06-111-1/+0
| | | | llvm-svn: 183720
* Fix va_arg on x86-64 for a struct containing a single int128_t. PR16248Eli Friedman2013-06-071-4/+17
| | | | llvm-svn: 183590
* Fix line endings.Eli Friedman2013-06-071-2/+2
| | | | llvm-svn: 183583
* Diagnose malformed x86 inline asm using 'y' constraint.Tim Northover2013-06-071-1/+9
| | | | | | | | 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. llvm-svn: 183467
* Implement SparcV9ABIInfo::EmitVAArg.Jakob Stoklund Olesen2013-06-051-2/+46
| | | | | | | | | | | | 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. llvm-svn: 183292
* Adding support for MSVC #pragma detect_mismatch functionality by emitting a ↵Aaron Ballman2013-06-041-0/+12
| | | | | | FAILIFMISMATCH linker command into the object file. llvm-svn: 183178
* Build correct coercion types in SparcV9ABIInfo.Jakob Stoklund Olesen2013-05-281-3/+127
| | | | | | | | | | | | | | | | The coercion type serves two purposes: 1. Pad structs to a multiple of 64 bits, so they are passed 'left-aligned' in registers. 2. Expose aligned floating point elements as first-level elements, so the code generator knows to pass them in floating point registers. We also compute the InReg flag which indicates that the struct contains aligned 32-bit floats. This flag is used by the code generator to pick the right registers. llvm-svn: 182753
* Add a SparcV9ABIInfo class for handling the standard SPARC v9 ABI.Jakob Stoklund Olesen2013-05-271-0/+93
| | | | | | | | | | | | | | | | - All integer arguments smaller than 64 bits are extended. - Large structs are passed indirectly, not using 'byval'. - Structs up to 32 bytes in size are returned in registers. Some things are not implemented yet: - EmitVAArg can be implemented in terms of the va_arg instruction. - When structs are passed in registers, float members require special handling because they are passed in the floating point registers. - Structs are left-aligned when passed in registers. This may require padding. llvm-svn: 182745
* Suffixing #pragma comment(lib) library names with .lib if necessary. This ↵Aaron Ballman2013-05-241-2/+13
| | | | | | matches MSVC behavior, as well as allows us to properly link libraries such as the ones provided by the MSDN examples. llvm-svn: 182647
* Forward #pragma comment(lib/linker) through as flags metadataReid Kleckner2013-05-081-2/+30
| | | | | | | | | | | | | | | | | | | | | | Summary: Most of this change is wiring the pragma all the way through from the lexer, parser, and sema to codegen. I considered adding a Decl AST node for this, but it seemed too heavyweight. Mach-O already uses a metadata flag called "Linker Options" to do this kind of auto-linking. This change follows that pattern. LLVM knows how to forward the "Linker Options" metadata into the COFF .drectve section where these flags belong. ELF support is not implemented, but possible. This is related to auto-linking, which is http://llvm.org/PR13016. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D723 llvm-svn: 181426
* Add SystemZ supportUlrich Weigand2013-05-061-0/+290
| | | | | | | | | | | | | | This patch then adds all the usual platform-specific pieces for SystemZ: driver support, basic target info, register names and constraints, ABI info and vararg support. It also adds new tests to verify pre-defined macros and inline asm, and updates a test for the minimum alignment change. This version of the patch incorporates feedback from reviews by Eric Christopher and John McCall. Thanks to all reviewers! Patch by Richard Sandiford. llvm-svn: 181211
* Set SRet flags properly in '-cxx-abi microsoft'.Timur Iskhodzhanov2013-04-171-72/+79
| | | | | | | | | Also, - abstract out the indirect/in memory/in registers decisions into the CGCXXABI - fix handling of empty struct arguments for '-cxx-abi microsoft' - add/fix tests llvm-svn: 179681
* Standardize accesses to the TargetInfo in IR-gen.John McCall2013-04-161-20/+19
| | | | | | Patch by Stephen Lin! llvm-svn: 179638
* The PNaCl target no longer permits __attribute__((regparm)).Eli Bendersky2013-04-081-32/+14
| | | | | | | Remove the custom lowering code dealing with it, disallow it in PNaclTargetInfo and adjust tests accordingly. llvm-svn: 179059
* Proper prefix for doxygen commentsEli Bendersky2013-04-051-3/+3
| | | | llvm-svn: 178878
* Add some documentation for PNaClABIInfo.Eli Bendersky2013-04-041-8/+17
| | | | llvm-svn: 178802
* Use kernel metadata to differentiate between kernel and deviceJustin Holewinski2013-03-301-27/+25
| | | | | | functions for the NVPTX target. llvm-svn: 178418
* IR-gen should not generate an MMX types unless the code is explicitly using MMXChad Rosier2013-03-251-28/+13
| | | | | | | intrinsics. rdar://13213542 llvm-svn: 177911
OpenPOWER on IntegriCloud