summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* lib/CodeGen/CGCall.cpp: Don't invoke multiple Builder.CreateBitCast() on ↵NAKAMURA Takumi2011-03-101-2/+4
| | | | | | Builder.CreateMemCpy. Or we would see sideeffect incompatibility among gcc and clang. llvm-svn: 127405
* Use the "undergoes default argument promotion" bit on parameters toJohn McCall2011-03-091-17/+38
| | | | | | | | | | simplify the logic of initializing function parameters so that we don't need both a variable declaration and a type in FunctionArgList. This also means that we need to propagate the CGFunctionInfo down in a lot of places rather than recalculating it from the FAL. There's more we can do to eliminate redundancy here, and I've left FIXMEs behind to do it. llvm-svn: 127314
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-031-8/+10
| | | | | | | | in order. This fixes few blocks.exp regressions. llvm-svn: 126960
* Revert "Add CC_Win64ThisCall and set it in the necessary places."Tilmann Scheller2011-03-021-21/+8
| | | | | | This reverts commit 126863. llvm-svn: 126886
* revert r126858.Devang Patel2011-03-021-10/+8
| | | | llvm-svn: 126874
* Add CC_Win64ThisCall and set it in the necessary places.Tilmann Scheller2011-03-021-8/+21
| | | | llvm-svn: 126863
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-021-8/+10
| | | | | | | | | | in order. This fixes few blocks.exp regressions. Reapply r126795 with a fix (one character change) for gdb testsuite regressions. llvm-svn: 126858
* Revert r126794.Devang Patel2011-03-021-10/+8
| | | | llvm-svn: 126848
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-011-8/+10
| | | | | | | | in order. This fixes few blocks.exp regressions. llvm-svn: 126795
* objc IRGen for Next runtime message API.Fariborz Jahanian2011-03-011-1/+2
| | | | | | | | | | The prototype for objc_msgSend() is technically variadic - `id objc_msgSend(id, SEL, ...)`. But all method calls should use a prototype that matches the method, not the prototype for objc_msgSend itself(). // rdar://9048030 llvm-svn: 126754
* Simplify test to check an aggregate argument that has non trivial ↵Devang Patel2011-02-161-1/+1
| | | | | | | | constructor or destructor. This patch rewrites r125142. llvm-svn: 125632
* Fix family-friendly-o, tsk tsk.Daniel Dunbar2011-02-101-1/+1
| | | | llvm-svn: 125293
* Driver/Frontend: Wire up -mregparm=.Daniel Dunbar2011-02-091-3/+3
| | | | llvm-svn: 125201
* If an aggregate argument is passed indirectly because it has non trivialDevang Patel2011-02-091-1/+1
| | | | | | | | destructor or copy constructor than let debug info know about it. Radar 8945514. llvm-svn: 125142
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-1/+1
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* Replace calls to getTypeSize() and getTypeAlign() with their 'InChars' Ken Dyck2011-01-191-4/+5
| | | | | | counterparts where char units are needed. llvm-svn: 123805
* Simplify mem{cpy, move, set} creation with IRBuilder.Benjamin Kramer2010-12-301-8/+6
| | | | llvm-svn: 122634
* Fix Whitespace.Michael J. Spencer2010-10-191-60/+60
| | | | llvm-svn: 116798
* IRgen/ABI: Add support for realigning structures which are passed by indirectDaniel Dunbar2010-09-161-2/+22
| | | | | | reference. llvm-svn: 114114
* Add symantic support for the Pascal calling convention viaDawn Perchik2010-09-031-0/+4
| | | | | | | "__attribute((pascal))" or "__pascal" (and "_pascal" under -fborland-extensions). Support still needs to be added to llvm. llvm-svn: 112939
* Re-commit r112916 with an additional fix for the self-host failures.John McCall2010-09-031-0/+3
| | | | | | I've audited the remaining getFunctionInfo call sites. llvm-svn: 112936
* Revert r112916, it's breaking selfhost pretty badly.John McCall2010-09-031-3/+0
| | | | llvm-svn: 112925
* It's not safe to use the generic CXXMethodDecl overload of CGT::getFunctionInfoJohn McCall2010-09-031-0/+3
| | | | | | | to set up a destructor call, because ABIs can tweak these conventions. Fixes rdar://problem/8386802. llvm-svn: 112916
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-311-18/+28
| | | | | | under the ARM ABI. llvm-svn: 112588
* IRgen: Switch more MakeAddr() users to MakeAddrLValue; this time for calls ↵Daniel Dunbar2010-08-211-2/+1
| | | | | | which were previously not computing the qualifier list. In most cases, I don't think it matters, but I believe this is conservatively more correct / consistent. llvm-svn: 111717
* IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument andDaniel Dunbar2010-08-211-11/+23
| | | | | | | | update callers as best I can. - This is a work in progress, our alignment handling is very horrible / sketchy -- I am just aiming for monotonic improvement. - Serious review appreciated. llvm-svn: 111707
* fix PR5179 and correctly fix PR5831 to not miscompile.Chris Lattner2010-07-301-9/+47
| | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 109848
* fix a builder, why didn't clang++ catch this?Chris Lattner2010-07-291-1/+2
| | | | llvm-svn: 109735
* Kill off the 'coerce' ABI passing form. Now 'direct' and 'extend' alwaysChris Lattner2010-07-291-151/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 109733
* dissolve some more complexity: make the x86-64 abi lowering codeChris Lattner2010-07-291-22/+2
| | | | | | | compute its own preferred types instead of having CGT compute them then pass them (circuituously) down into ABIInfo. llvm-svn: 109726
* now that ABIInfo depends on CGT, it has trivial access to suchChris Lattner2010-07-291-2/+2
| | | | | | | things as TargetData, ASTContext, LLVMContext etc. Stop passing them through so many APIs. llvm-svn: 109723
* tidy upChris Lattner2010-07-281-8/+6
| | | | llvm-svn: 109699
* some cleanups and get alignments correct for various coerce cases.Chris Lattner2010-07-281-9/+16
| | | | llvm-svn: 109607
* Vectors are not integer types, so the type system should not classifyDouglas Gregor2010-07-231-2/+2
| | | | | | | | | | | them as such. Type::is(Signed|Unsigned|)IntegerType() now return false for vector types, and new functions has(Signed|Unsigned|)IntegerRepresentation() cover integer types and vector-of-integer types. This fixes a bunch of latent bugs. Patch from Anton Yartsev! llvm-svn: 109229
* Fix regression caused by r108911.Devang Patel2010-07-211-1/+2
| | | | | | | Do not override known debug loc with unknown debug loc. This is tested by sections.exp in gdb testsuite. llvm-svn: 109022
* Use getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata,Dan Gohman2010-07-201-4/+3
| | | | | | avoiding MDNode overhead. llvm-svn: 108911
* CodeGen/ObjC/NeXT: Fix Obj-C message send to match llvm-gcc when choosingDaniel Dunbar2010-07-141-3/+21
| | | | | | | | whether to use objc_msgSend_fpret; the choice is target dependent, not Obj-C ABI dependent. - <rdar://problem/8139758> arm objc _objc_msgSend_fpret bug llvm-svn: 108379
* Mark calls to 'throw()' functions as nounwind, and mark the functions nounwindJohn McCall2010-07-081-0/+6
| | | | | | as well. llvm-svn: 107858
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | self-host. Hopefully these results hold up on different platforms. I tried to keep the GNU ObjC runtime happy, but it's hard for me to test. Reimplement how clang generates IR for exceptions. Instead of creating new invoke destinations which sequentially chain to the previous destination, push a more semantic representation of *why* we need the cleanup/catch/filter behavior, then collect that information into a single landing pad upon request. Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional control flow) are generated, since it's actually fairly closely tied in with the former. Remove the need to track which cleanup scope a block is associated with. Document a lot of previously poorly-understood (by me, at least) behavior. The new framework implements the Horrible Hack (tm), which requires every landing pad to have a catch-all so that inlining will work. Clang no longer requires the Horrible Hack just to make exceptions flow correctly within a function, however. The HH is an unfortunate requirement of LLVM's EH IR. llvm-svn: 107631
* Generate fewer first class aggregate values for otherChris Lattner2010-07-051-35/+13
| | | | | | | coerce cases (e.g. {double,int}) which avoids fastisel bailing out at -O0. llvm-svn: 107628
* in the "coerce" case, the ABI handling code ends up making theChris Lattner2010-07-051-2/+4
| | | | | | | | | alloca for an argument. Make sure the argument gets the proper decl alignment, which may be different than the type alignment. This fixes PR7567 llvm-svn: 107627
* fix rdar://8147692 - yet another crash due to my abi work.Chris Lattner2010-07-011-7/+16
| | | | llvm-svn: 107387
* IRgen: Fix debug info regression in r106970; when we eliminate the return valueDaniel Dunbar2010-06-301-5/+6
| | | | | | | | | store make sure to move the debug metadata from the store (which is actual 'return' statement location) to the return instruction (which otherwise would have the function end location as its debug info). - Tested by gdb test suite. llvm-svn: 107322
* Reapply:Chris Lattner2010-06-301-21/+36
| | | | | | | | | | r107173, "fix PR7519: after thrashing around and remembering how all this stuff" r107216, "fix PR7523, which was caused by the ABI code calling ConvertType instead" This includes a fix to make ConvertTypeForMem handle the "recursive" case, and call it as such when lowering function types which have an indirect result. llvm-svn: 107310
* Revert r107173, "fix PR7519: after thrashing around and remembering how all ↵Daniel Dunbar2010-06-301-22/+9
| | | | | | this stuff", it broke bootstrap. llvm-svn: 107232
* Revert r107216, "fix PR7523, which was caused by the ABI code calling ↵Daniel Dunbar2010-06-301-13/+11
| | | | | | ConvertType instead", it is part of a boostrap breaking sequence. llvm-svn: 107231
* fix PR7523, which was caused by the ABI code calling ConvertType insteadChris Lattner2010-06-291-11/+13
| | | | | | | of ConvertTypeRecursive when it needed to in a few cases, causing pointer types to get resolved at the wrong time. llvm-svn: 107216
* relax the CGFunctionInfo::CGFunctionInfo ctor to allow any sequence Chris Lattner2010-06-291-7/+7
| | | | | | of CanQualTypes to be passed in. llvm-svn: 107176
* fix PR7519: after thrashing around and remembering how all this stuffChris Lattner2010-06-291-9/+22
| | | | | | | works, the fix is quite simple: just make sure to call ConvertTypeRecursive when the function type being lowered is in the midst of ConvertType. llvm-svn: 107173
* minor cleanups.Chris Lattner2010-06-291-9/+3
| | | | llvm-svn: 107150
OpenPOWER on IntegriCloud