summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Coerce byval aggregate arguments to integers whose size matches the integerAkira Hatanaka2012-05-111-35/+44
| | | | | | | register size of the target architecture. llvm-svn: 156650
* Fix handling of vector return types.Akira Hatanaka2012-05-111-1/+1
| | | | | | | A vector should be returned via the hidden pointer argument except if its size is equal to or smaller than 16-bytes and the target ABI is N32 or N64. llvm-svn: 156642
* Implement PPC64TargetCodeGenInfo.Roman Divacky2012-05-091-0/+60
| | | | llvm-svn: 156491
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-301-9/+9
| | | | | | | | | | | | | filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
* Step forward with supporting of ARM homogenous aggregates:Anton Korobeynikov2012-04-131-10/+14
| | | | | | | - Handle unions - Handle C++ classes llvm-svn: 154664
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-4/+4
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* IRgen/ABI/x86_64: Avoid passing small structs using byval sometimes.Daniel Dunbar2012-03-101-9/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - We do this when it is easy to determine that the backend will pass them on the stack properly by itself. Currently LLVM codegen is really bad in some cases with byval, for example, on the test case here (which is derived from Sema code, which likes to pass SourceLocations around):: struct s47 { unsigned a; }; void f47(int,int,int,int,int,int,struct s47); void test47(int a, struct s47 b) { f47(a, a, a, a, a, a, b); } we used to emit code like this:: ... movl %esi, -8(%rbp) movl -8(%rbp), %ecx movl %ecx, (%rsp) ... to handle moving the struct onto the stack, which is just appalling. Now we generate:: movl %esi, (%rsp) which seems better, no? llvm-svn: 152462
* Adding support for Microsoft's thiscall calling convention. Clang side of ↵Aaron Ballman2012-02-221-9/+23
| | | | | | the patch. llvm-svn: 151122
* Whether an argument is required (in contrast with being anJohn McCall2012-02-171-16/+27
| | | | | | | | | | | | | | | | | | | | | optional argument passed through the variadic ellipsis) potentially affects how we need to lower it. Propagate this information down to the various getFunctionInfo(...) overloads on CodeGenTypes. Furthermore, rename those overloads to clarify their distinct purposes, and make sure we're calling the right one in the right place. This has a nice side-effect of making it easier to construct a function type, since the 'variadic' bit is no longer separable. This shouldn't really change anything for our existing platforms, with one minor exception --- we should now call variadic ObjC methods with the ... in the "right place" (see the test case), which I guess matters for anyone running GNUStep on MIPS. Mostly it's just a substantial clean-up. llvm-svn: 150788
OpenPOWER on IntegriCloud