summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/ABIInfo.h
Commit message (Collapse)AuthorAgeFilesLines
* Add field PaddingType to ABIArgInfo which specifies the type of padding thatAkira Hatanaka2012-01-071-6/+15
| | | | | | | | | | is inserted before the real argument. Padding is needed to ensure the backend reads from or writes to the correct argument slots when the original alignment of a byval structure is unavailable due to flattening. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147699 91177308-0d34-0410-b5e6-96231b3b80d8
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134831 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Whitespace.Michael J. Spencer2010-10-191-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116798 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen/ABI: Add support for realigning structures which are passed by indirectDaniel Dunbar2010-09-161-6/+13
| | | | | | reference. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114114 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR5179 and correctly fix PR5831 to not miscompile.Chris Lattner2010-07-301-23/+32
| | | | | | | | | | | | | | | | | | | | | The X86-64 ABI code didn't handle the case when a struct would get classified and turn up as "NoClass INTEGER" for example. This is perfectly possible when the first slot is all padding (e.g. due to empty base classes). In this situation, the first 8-byte doesn't take a register at all, only the second 8-byte does. This fixes this by enhancing the x86-64 abi stuff to allow and handle this case, reverts the broken fix for PR5831, and enhances the target independent stuff to be able to handle an argument value in registers being accessed at an offset from the memory value. This is the last x86-64 calling convention related miscompile that I'm aware of. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109848 91177308-0d34-0410-b5e6-96231b3b80d8
* move the last hunk of getCoerceResult into the placeChris Lattner2010-07-291-2/+2
| | | | | | | that needs it and remove getCoerceResult. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109807 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a builder, why didn't clang++ catch this?Chris Lattner2010-07-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109735 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill off the 'coerce' ABI passing form. Now 'direct' and 'extend' alwaysChris Lattner2010-07-291-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | have a "coerce to" type which often matches the default lowering of Clang type to LLVM IR type, but the coerce case can be handled by making them not be the same. This simplifies things and fixes issues where X86-64 abi lowering would return coerce after making preferred types exactly match up. This caused us to compile: typedef float v4f32 __attribute__((__vector_size__(16))); v4f32 foo(v4f32 X) { return X+X; } into this code at -O0: define <4 x float> @foo(<4 x float> %X.coerce) nounwind { entry: %retval = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2] %coerce = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=2] %X.addr = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3] store <4 x float> %X.coerce, <4 x float>* %coerce %X = load <4 x float>* %coerce ; <<4 x float>> [#uses=1] store <4 x float> %X, <4 x float>* %X.addr %tmp = load <4 x float>* %X.addr ; <<4 x float>> [#uses=1] %tmp1 = load <4 x float>* %X.addr ; <<4 x float>> [#uses=1] %add = fadd <4 x float> %tmp, %tmp1 ; <<4 x float>> [#uses=1] store <4 x float> %add, <4 x float>* %retval %0 = load <4 x float>* %retval ; <<4 x float>> [#uses=1] ret <4 x float> %0 } Now we get: define <4 x float> @foo(<4 x float> %X) nounwind { entry: %X.addr = alloca <4 x float>, align 16 ; <<4 x float>*> [#uses=3] store <4 x float> %X, <4 x float>* %X.addr %tmp = load <4 x float>* %X.addr ; <<4 x float>> [#uses=1] %tmp1 = load <4 x float>* %X.addr ; <<4 x float>> [#uses=1] %add = fadd <4 x float> %tmp, %tmp1 ; <<4 x float>> [#uses=1] ret <4 x float> %add } This implements rdar://8248065 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109733 91177308-0d34-0410-b5e6-96231b3b80d8
* dissolve some more complexity: make the x86-64 abi lowering codeChris Lattner2010-07-291-5/+1
| | | | | | | | compute its own preferred types instead of having CGT compute them then pass them (circuituously) down into ABIInfo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109726 91177308-0d34-0410-b5e6-96231b3b80d8
* now that ABIInfo depends on CGT, it has trivial access to suchChris Lattner2010-07-291-2/+0
| | | | | | | | things as TargetData, ASTContext, LLVMContext etc. Stop passing them through so many APIs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109723 91177308-0d34-0410-b5e6-96231b3b80d8
* cave in to reality and make ABIInfo depend on CodeGenTypes.Chris Lattner2010-07-291-6/+14
| | | | | | | This will simplify a bunch of code, coming up next. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109722 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy upChris Lattner2010-07-281-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109699 91177308-0d34-0410-b5e6-96231b3b80d8
* change ABIArgInfo to hold its llvm type with PATypeHolder so thatChris Lattner2010-06-291-4/+2
| | | | | | | | it doesn't dangle as types get refined. This fixes Shootout-C++/lists1 and probably also PR7522. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107196 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass the LLVM IR version of argument types down into computeInfo.Chris Lattner2010-06-291-1/+5
| | | | | | | | | | This is somewhat annoying to do this at this level, but it avoids having ABIInfo know depend on CodeGenTypes for a hint. Nothing is using this yet, so no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107111 91177308-0d34-0410-b5e6-96231b3b80d8
* x86-64 ABI: If a type is a C++ record with either a non-trivial destructor ↵Anders Carlsson2009-09-161-6/+12
| | | | | | or a non-trivial copy constructor, it should be passed in a pointer. Daniel, plz review. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82050 91177308-0d34-0410-b5e6-96231b3b80d8
* LLVMContext is a class now.Benjamin Kramer2009-08-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78691 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-08-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78259 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change, and contextify a bunch of related stuff.Owen Anderson2009-07-141-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75705 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new ABIArgInfo kind: Extend. This allows target to implement its own ↵Anton Korobeynikov2009-06-061-0/+7
| | | | | | | | | argument zero/sign extension logic (consider, e.g. target has only 64 bit registers and thus i32's should be extended as well). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72998 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out TargetABIInfo stuff into separate file. No functionality change.Anton Korobeynikov2009-06-051-14/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72962 91177308-0d34-0410-b5e6-96231b3b80d8
* Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.Daniel Dunbar2009-02-101-0/+11
| | | | | | | - Missed this file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64238 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge ABIInfo StructRet/ByVal into Indirect. Daniel Dunbar2009-02-051-20/+11
| | | | | | | - No (intended) functionality change, the semantic changes are to come. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63850 91177308-0d34-0410-b5e6-96231b3b80d8
* Initialize alignment field for ByVal ABIInfo correctly.Daniel Dunbar2009-02-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63809 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ABIArgInfo::dump()Daniel Dunbar2009-02-041-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63794 91177308-0d34-0410-b5e6-96231b3b80d8
* Change ABIInfo to compute information for a full signature at a timeDaniel Dunbar2009-02-031-6/+11
| | | | | | | (the main point of this restructing). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63619 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove ABIArgInfo::Default kind, ABI is now responsible for specifyingDaniel Dunbar2009-02-031-8/+2
| | | | | | | acceptable kind with more precise semantics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63617 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ABIArgInfo::Direct kind, which passes arguments using whatever theDaniel Dunbar2009-02-031-0/+8
| | | | | | | | native IRgen type is. This is like Default, but without any extra semantics (like automatic tweaking of structures or void). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63615 91177308-0d34-0410-b5e6-96231b3b80d8
* Move ABIArgInfo into CGFunctionInfo, computed on creation.Daniel Dunbar2009-02-031-0/+6
| | | | | | | - Still have to convert some consumers over. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63610 91177308-0d34-0410-b5e6-96231b3b80d8
* Move ABIInfo/ABIArgInfo classes into ABIInfo.hDaniel Dunbar2009-02-031-0/+116
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63586 91177308-0d34-0410-b5e6-96231b3b80d8