summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* A step towards sorting out handling of triviality of special members in C++11.Richard Smith2012-11-161-1/+1
| | | | | | | | | | | | | | Separate out the notions of 'has a trivial special member' and 'has a non-trivial special member', and use them appropriately. These are not opposites of one another (there might be no special member, or in C++11 there might be a trivial one and a non-trivial one). The CXXRecordDecl predicates continue to produce incorrect results, but do so in fewer cases now, and they document the cases where they might be wrong. No functionality changes are intended here (they will come when the predicates start producing the right answers...). llvm-svn: 168119
* Cleanup: 80-column violationManman Ren2012-11-061-4/+6
| | | | llvm-svn: 167476
* ARM byval: when type alignment is bigger than ABI alignment, instead ofManman Ren2012-11-061-5/+4
| | | | | | | | | | | | 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
* ARM byval: when type alignment is bigger than ABI alignment, we can't guaranteeManman Ren2012-11-051-2/+10
| | | | | | | | | | | 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
* On PowerPC64, integer arguments and return values need to be sign- orUlrich Weigand2012-11-051-0/+58
| | | | | | | | | | | | | | | | 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
* ARM AAPCS-VFP: fix tracking of allocated VFP registers.Manman Ren2012-10-311-24/+50
| | | | | | | According to the spec, we can backfill VFP registers that were skipped due to alignment constraints. llvm-svn: 167159
* ARM AAPCS-VFP: fix handling of homogeneous aggreate.Manman Ren2012-10-301-6/+80
| | | | | | | 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
* This patch addresses a 64-bit PowerPC ELF ABI compatibility issue withBill Schmidt2012-10-261-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Modify the targets to set appropriate calling convention defaults and C ↵David Tweed2012-10-251-3/+5
| | | | | | | | variables when using a gnueabihf or aapcs-vfp target. Tested by me and Wei-Ren Chen. llvm-svn: 166679
* Add padding inreg registers to cause llvm to skip ecx when needed withRafael Espindola2012-10-241-7/+14
| | | | | | the x86_fastcallcc calling convention. llvm-svn: 166538
* Add inreg markers with the x86_fastcallcc calling convention.Rafael Espindola2012-10-241-10/+39
| | | | llvm-svn: 166537
* Don't try to use inreg with 0 sized structs. Thanks to Eli for reporting theRafael Espindola2012-10-231-0/+4
| | | | | | regression. llvm-svn: 166461
* Move private classes into anonymous namespaces.Benjamin Kramer2012-10-201-0/+8
| | | | llvm-svn: 166377
* Fix handling of the regparm attribute in the presence of classes with copyRafael Espindola2012-10-191-41/+44
| | | | | | | | | | | | | constructors. When I first moved regparm support to TargetInfo.cpp I tried to isolate it in classifyArgumentTypeWithReg, but it is actually a lot easier to flip the code around and check for regparm at the end of the decision tree. Without this refactoring classifyArgumentTypeWithReg would have to duplicate the logic about when to use non-byval indirect arguments. llvm-svn: 166266
* Add pnaclcall convention to Native Client targets.Derek Schuff2012-10-161-1/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | Because PNaCl bitcode must be target-independent, it uses some different bitcode representations from other targets (e.g. byval and sret for structures). This means that without additional type information, it cannot meet some native ABI requirements for some targets (e.g. passing structures containing unions by value on x86-64). To allow generation of code which uses the correct native ABIs, we also support triples such as x86_64-nacl, which uses target-dependent IR (as opposed to le32-nacl, which uses byval and sret). To allow interoperation between the two types of code, this patch adds a calling convention attribute to be used in code compiled with the target-dependent triple, which will generate code using the le32-style bitcode. This calling convention does not need to be explicitly supported in the backend because it determines bitcode representation rather than native conventions (the backend just needs to undersand how to handle byval and sret for the Native Client OS). This patch implements __attribute__((pnaclcall)) to generate calls in bitcode according to the le32 bitcode conventions, an attribute which is accepted by any Native Client target, but issues a warning otherwise. llvm-svn: 166065
* ARM ABI: fix ABI alignment issues in varargs.Manman Ren2012-10-161-9/+6
| | | | | | | | We generalize r166040 to handle ABI alignment issues for all types. rdar://12439123 llvm-svn: 166052
* ARM ABI: passing illegal vector types as varargs.Manman Ren2012-10-161-2/+48
| | | | | | | | | | | | | | We expand varargs in clang and the call site is handled in the back end, it is hard to match exactly how illegal vectors are handled in the backend. Therefore, we legalize the illegal vector types in clang: if (Size <= 32), legalize to i32. if (Size == 64), legalize to v2i32. if (Size == 128), legalize to v4i32. if (Size > 128), use indirect. rdar://12439123 llvm-svn: 166043
* ARM ABI: fix ABI alignment issues when passing legal vector types as varargs.Manman Ren2012-10-161-6/+38
| | | | | | | | | | We create an aligned temporary space and copy the content over from ap.cur to the temporary space. This is necessary if the natural alignment of the type is greater than the ABI alignment. rdar://12439123 llvm-svn: 166040
* Move the Attributes::Builder outside of the Attributes class and into its ↵Bill Wendling2012-10-151-1/+1
| | | | | | own class named AttrBuilder. No functionality change. llvm-svn: 165961
* Use enum values instead of magic numbers for indexing into the attribute list.Bill Wendling2012-10-151-1/+2
| | | | llvm-svn: 165925
* Attributes RewriteBill Wendling2012-10-151-1/+1
| | | | | | | | Convert the uses of the Attributes class over to the new format. The Attributes::get method call now takes an LLVM context so that the attributes object can be uniquified and stored. llvm-svn: 165918
* Use the Builder to create the stack alignment attribute.Bill Wendling2012-10-141-2/+3
| | | | llvm-svn: 165888
* This patch addresses PR13948.Bill Schmidt2012-10-121-7/+25
| | | | | | | | | | | | For 64-bit PowerPC SVR4, an aggregate containing only one floating-point field (float, double, or long double) must be passed in a register as though just that field were present. This patch addresses the issue during Clang code generation by specifying in the ABIArgInfo for the argument that the underlying type is passed directly in a register. The included test case verifies flat and nested structs for the three data types. llvm-svn: 165816
* Fix build failure from r165722Derek Schuff2012-10-111-1/+1
| | | | llvm-svn: 165731
* Properly factor Native Client defines to support NaCl as an OSDerek Schuff2012-10-111-2/+8
| | | | | | with x86/ARM architecture llvm-svn: 165722
* Make X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32Derek Schuff2012-10-111-6/+14
| | | | | | and Native Client llvm-svn: 165715
* Have 'addFnAttr' take the attribute enum value. Then have it build the ↵Bill Wendling2012-10-101-5/+6
| | | | | | attribute object and add it appropriately. No functionality change. llvm-svn: 165596
* Move TargetData to DataLayout.Micah Villmow2012-10-081-12/+12
| | | | llvm-svn: 165395
* This patch enables general varargs support for the 64-bit PPC SVR4 ABI.Bill Schmidt2012-10-031-4/+102
| | | | | | | | | | | | | | Most of the pieces for this were already in place, but a proper EmitVAArg is needed for aggregates and complex numbers to be handled. Although the va_list for 64-bit PowerPC SVR4 consists of GPRs 3 through 10 together with the overflow portion of the parameter save area, we can treat va_list as pointing to contiguous memory for all parameters, since the back end forces the parameter GPRs to memory for varargs functions. There is no need at this time to model parameters and return values beyond what the DefaultABIInfo provides. llvm-svn: 165143
* Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. ↵Sylvestre Ledru2012-09-271-3/+3
| | | | | | See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164766 llvm-svn: 164769
* Fix a typo 'iff' => 'if'Sylvestre Ledru2012-09-271-3/+3
| | | | llvm-svn: 164766
* Update for encapsulating the "construct*AlignmentFromInt" methods.Bill Wendling2012-09-211-1/+1
| | | | llvm-svn: 164374
* Use custom ABIInfo for le32/PNaCl argument codegenDerek Schuff2012-09-061-0/+86
| | | | | | | | | This patch uses a new ABIInfo implementation specific to the le32 target, rather than falling back to DefaultABIInfo. Its behavior is basically the same, but it also allows the regparm argument attribute. It also includes basic tests for argument codegen and attributes. llvm-svn: 163333
* Rename ANDROIDEABI to Android.Logan Chien2012-09-021-1/+2
| | | | | | | | | | | | | Most of the code guarded with ANDROIDEABI are not ARM-specific, and having no relation with arm-eabi. Thus, it will be more natural to call this environment "Android" instead of "ANDROIDEABI". Note: We are not using ANDROID because several projects are using "-DANDROID" as the conditional compilation flag. llvm-svn: 163088
* ARM: enable struct byval for AAPCS-VFP.Manman Ren2012-08-131-7/+4
| | | | | | rdar://9877866 llvm-svn: 161790
* Add comments for turning on byvalManman Ren2012-08-101-0/+2
| | | | llvm-svn: 161702
* ARM: enable struct byval for AAPCS.Manman Ren2012-08-101-3/+1
| | | | | | | rdar://9877866 PR://13350 llvm-svn: 161694
* Fix AAPCS ABI. I can't actually test this, but it restores the behavior ↵Eli Friedman2012-08-091-9/+12
| | | | | | from before r159168. PR13562. llvm-svn: 161554
* clang support for Bitrig (an OpenBSD fork); patch by David Hill.Eli Friedman2012-08-081-0/+1
| | | | llvm-svn: 161546
* Handle functions with struct arguments or return types and the regparmRafael Espindola2012-07-311-13/+91
| | | | | | | | | | | | | | attribute. It is a variation of the x86_64 ABI: * A struct returned indirectly uses the first register argument to pass the pointer. * Floats, Doubles and structs containing only one of them are not passed in registers. * Other structs are split into registers if they fit on the remaining ones. Otherwise they are passed in memory. * When a struct doesn't fit it still consumes the registers. llvm-svn: 161022
* move X86_32ABIInfo::computeInfo out of line.Rafael Espindola2012-07-241-8/+9
| | | | llvm-svn: 160652
* Make classifyReturnType and classifyArgumentType private.Rafael Espindola2012-07-231-3/+3
| | | | llvm-svn: 160648
* Add "long double" to permitted list of ARM complex homogeneous aggregates.Tim Northover2012-07-201-1/+2
| | | | | | | Under AAPCS, long double is the same as double, which means it should be allowed as part of a homogeneous aggregate. llvm-svn: 160586
* Remove get(V)BaseClassOffsetInBits, the CharUnit functions should be used ↵Benjamin Kramer2012-07-041-2/+3
| | | | | | | | instead. No functionality change. llvm-svn: 159719
* Make the following changes in the way Mips handles vector arguments and returnAkira Hatanaka2012-07-031-32/+31
| | | | | | | | | | | values: - Return integer vectors in integer registers. - Pass vector arguments in integer registers. - Set an upper bound for argument alignment. The largest alignment is 8-byte for O32 and 16-byte for N32/64. llvm-svn: 159676
* ARM: enable struct byval for APCS.Manman Ren2012-06-251-6/+10
| | | | | | Revert r136662 which disables ARM byval. llvm-svn: 159168
* Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie2012-06-061-6/+6
| | | | | | | | | | | | | | value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
* Fix a bug with va_arg and vectors on Darwin x86-32. <rdar://problem/11592208>.Eli Friedman2012-06-051-2/+7
| | | | llvm-svn: 158017
* Replace PTX back-end with NVPTX back-end in all places where Clang caresJustin Holewinski2012-05-241-18/+18
| | | | | | NV_CONTRIB llvm-svn: 157403
* Teach Clang about the NVPTX backend.Peter Collingbourne2012-05-201-0/+2
| | | | llvm-svn: 157173
OpenPOWER on IntegriCloud