aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCall.cpp
AgeCommit message (Collapse)Author
2009-05-08Darwin x86_32: Improve bit-field handling for returning records.Daniel Dunbar
- This turns out to be a no-op now that most of the handling for everything else is in place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71261 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08Darwin x86_32: Ignore arrays of empty structures inside records.Daniel Dunbar
- This eliminates 5/1000 failures on return-types-32, on the current ABITest config. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30fix i128 to return in 2 64-bit registers (rax/rdx on x86-64)Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70481 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30initial support for __[u]int128_t, which should be basicallyChris Lattner
compatible with VC++ and GCC. The codegen/mangling angle hasn't been fully ironed out yet. Note that we accept int128_t even in 32-bit mode, unlike gcc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27x86-32 ABI: Fix crash on return of structure with flexible arrayDaniel Dunbar
member. Also, spell bitfield more consistently as bit-field. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70220 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21Pass and return aggregate types directly to function calls.Sanjiv Gupta
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69668 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18Make CodeGenFunction::EmitCallArgs a template function that takes a generic ↵Anders Carlsson
"Type Info" parameter. The type info parameter knows how to iterate over its arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13Update to use hasAttr() instead of getAttr().Daniel Dunbar
- No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10Don't set both readnone and readonly.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09Propagate the ASTContext to various AST traversal and lookup functions.Douglas Gregor
No functionality change (really). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08Add code for emitting call arguments (not used yet).Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68639 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08Don't assume that a block always has a FunctionProtoType. Fixes rdar://6768379.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06Add a getFunctionInfo that takes a BlockPointerType.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68452 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-04Basic support for regparm codegenAnton Korobeynikov
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03Add a getFunctionInfo that takes a CXXMethodDecl.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68411 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01x86-32 Darwin ABI: Handle small structures correctly.Daniel Dunbar
- Small structures are returned in a register if: 1. They fit nicely in a register. 2. All fields fit nicely in a register. (more or less) - We now pass the first 5000 ABITests if unions are disabled. - <rdar://problem/6497882> [irgen] x86-32 ABI compatibility with small structs git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01x86-32 Darwin ABI: Single element arrays can be part of "singleDaniel Dunbar
element structures", which have different ABI rules. - Current return-arguments-32 status is: 1 out of 1000 failures (-7) - Also, vectors inside "single element structs" require special handling. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68196 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01x86-32 Darwin ABI: Handle direct return of vectors.Daniel Dunbar
- Current return-arguments-32 status is: 8 out of 1000 failures (-7) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68192 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31x86_32 Darwin ABI: Treat empty unions like empty structures.Daniel Dunbar
- Current return-arguments-32 status: 15/1000 failures git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29Initial implementation of ARM ABI. Mostly untested. Note that I'm not Eli Friedman
really intending to take ownership of this; I wrote this mostly because I was curious about how the ARM ABI works. It should be a decent start, though. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-23Fix the ABI convention for struct returns on x86 outside of Darwin.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-22don't set the name of a call instruction to "call" in release-asserts Chris Lattner
build. This shaves another 3% off. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18PR3835: Interaction with ABI structure passing can inhibitDaniel Dunbar
readnone/readonly attributes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67224 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-11x86_32 ABI: Don't try and expand structures with bitfields.Daniel Dunbar
- This is an ABI incompatiblity, but this is not likely to be a huge deal in practice. For now we at least generate self consistent code instead of crashing. - <rdar://problem/6657601> x86-32 ABI: Bitfields in small structures are not passed correctly git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10Remove some now-unneeded calls to llvm::errs().flush().Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06x86_64 ABI: Handle long double in union when upper eightbyte resultsDaniel Dunbar
in a lone X87 class. - PR3735. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66277 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02Cleanup handling of function attributes in calls.Daniel Dunbar
- No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26Create a new TypeNodes.def file that enumerates all of the types,Douglas Gregor
giving them rough classifications (normal types, never-canonical types, always-dependent types, abstract type representations) and making it far easier to make sure that we've hit all of the cases when decoding types. Switched some switch() statements on the type class over to using this mechanism, and filtering out those things we don't care about. For example, CodeGen should never see always-dependent or non-canonical types, while debug info generation should never see always-dependent types. More switch() statements on the type class need to be moved over to using this approach, so that we'll get warnings when we add a new type then fail to account for it somewhere in the compiler. As part of this, some types have been renamed: TypeOfExpr -> TypeOfExprType FunctionTypeProto -> FunctionProtoType FunctionTypeNoProto -> FunctionNoProtoType There shouldn't be any functionality change... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26Add Type::hasPointerRepresentation predicate.Daniel Dunbar
- For types whose native representation is a pointer. - Use to replace ExprConstant.cpp:HasPointerEvalType, CodeGenFunction::isObjCPointerType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26Drop uses of isPointerLikeType.Daniel Dunbar
- No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65560 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26Classify enum types correctlyAnders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26x86_64 ABI: Qualified id types are passed as pointers.Daniel Dunbar
- <rdar://problem/6622451> Bad x86_64 code gen for message call taking one argument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25Temporarily disable clearing of insert point (to indicate unreachableDaniel Dunbar
code) when calling noreturn functions; general expression emission isn't ready to do the right thing in all cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23Add low level support for generating invoke instead of calls.Daniel Dunbar
- No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65325 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-22x86_64 ABI: Actually, we can always pass things we want to pass inDaniel Dunbar
memory using Indirect; this was a holdover from when CGCall wasn't as robust. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-22x86_64 ABI: Make sure to pass vectors that we want to pass in memoryDaniel Dunbar
as byval. Otherwise LLVM will have its own opinion about where to put things. We now pass all gcc dg.compat tests on x86_64. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-22x86_64 ABI: Pass 32-bit vectors as Integer to match gcc. We don't careDaniel Dunbar
about these much but <2 x i16> shows up in the gcc test suite. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-22x86_64 ABI: Classify <1 x i64> as INTEGER (match gcc not llvm-gcc).Daniel Dunbar
Also, make sure to pass <1 x i64> as i64 (not <1 x i64>, which doesn't quite work yet in the backend). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20Take advantage of noreturn attribute to add unreachable instruction &Daniel Dunbar
clear insertion point. The rest of IRgen should theoretically take advantage of this to avoid emitting dead code. Theory != Practice. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65141 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20Set call attribute for direct calls (i.e. noreturn).Daniel Dunbar
- Remove an unused variant of EmitCallExpr overload. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65130 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20switch ObjCMethodDecl's parameter list from being explicitly managed to an ↵Chris Lattner
ObjCList. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65114 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18i386 ABI: Offset computation in va_arg was incorrect for sizeof(Ty)>4.Daniel Dunbar
We are down to only failing gcc.dg/compat/vector-[12] (8 tests total). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64967 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18x86_64 ABI: Fix thinko in computation of bound for "passed in SSE regs" test.Daniel Dunbar
Two more gcc/x86_64 failures down. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18x86_64 ABI: "is passed in regs" computation for va_arg was broken forDaniel Dunbar
things passed in mixed registers. This knocks out 8 x86_64 failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64958 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18x86_64 ABI: Two bug fixes.Daniel Dunbar
1. Return of _Complex long double used wrong type. 2. va_arg of types passed in two SSE registers didn't account for extra space in register save area. Down to 18 failures on gcc/compat/x86_64. Combined 32/64 results are: -- === gcc Summary === # of expected passes 1292 # of unexpected failures 34 # of unsupported tests 2 -- git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64880 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17x86_64 ABI: Fix assert on return of _Complex long double.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17x86_64 ABI: Implement classification for bit-fields.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16x86_64 ABI: Handle va_arg arguments with alignment > 8.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64701 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14x86_64 ABI: Need to use canonical types when comparing againstDaniel Dunbar
ASTContext types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64533 91177308-0d34-0410-b5e6-96231b3b80d8