aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCall.cpp
AgeCommit message (Collapse)Author
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
2009-02-14x86_64 ABI: Pass simple types directly when possible. This isDaniel Dunbar
important for both keeping the generated LLVM simple and for ensuring that integer types are passed/promoted correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13x86_64 ABI: Support va_arg passed in mixed registers.Daniel Dunbar
- Now at 1274 passes on gcc compat suite vs 1262. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12x86_64: Initial varargs support.Daniel Dunbar
- Doesn't yet handle case where values are passed in mixed (general purpose & floating point) registers; otherwise largely functional. Code still needs some cleaning. Fixes: MultiSource/Applications/lua/lua MultiSource/Applications/siod/siod MultiSource/Applications/sqlite3/sqlite3 SingleSource/Regression/C/PR640 SingleSource/UnitTests/2003-07-09-SignedArgs SingleSource/UnitTests/2007-03-02-VaCopy gcc compat test suite results (Darwin x86-32 & -64): -- # of expected passes 1262 # of unexpected failures 56 # of unresolved testcases 34 # of unsupported tests 2 Compare to: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090209/012050.html git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10Tweak x86-64 ABI to allow reuse for vararg handling.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10ABI: Correctly handle load/store of values which have a different LLVMDaniel Dunbar
memory representation (e.g., bool). - This upgrades (downgrades) MultiSource/Applications/ClamAV/clamscan to a miscompile and fixes SingleSource/UnitTests/2003-05-31-CastToBool. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10Make sure to initialize local variables, even if they were ignored byDaniel Dunbar
ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07Set load/store alignment when doing ABI coercions.Daniel Dunbar
- Currently, this is producing poor code, but we prefer correctness to performance for now. Eventually we should be able to generally avoid having to set the alignment when we control the alignment of the alloca. - This knocks out 33/1000 failures on my single argument ABI tests, down to 22/1000 and 18 of these appear to be gcc bugs. Woot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Implement Direct ABIInfo semantics.Daniel Dunbar
- No intended functionality change, this is essentially enabling direct passing of complex and aggregate values, which no ABI is using. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63863 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Simplify test for whether we need an alloca to hold an indirect returnDaniel Dunbar
value. - No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Implement ABI Indirect sematics for arguments.Daniel Dunbar
- No intended functionality change, all current ABI implementations were only using indirect for complex/aggregate types, which were being passed indirectly with the Direct ABIInfo kind. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63858 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Merge ABIInfo StructRet/ByVal into Indirect. Daniel Dunbar
- 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
2009-02-05Pull CodeGenFunction::GetUndefRValue() out of EmitUnsupportedRValue.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05x86-32: Use Ignore to avoid passing empty structs (instead of Expand).Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Honor ByVal alignment. Patch by Nate Begeman!Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Unbreak CGFunctionInfo::Profile method and reenable caching of ABIDaniel Dunbar
information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63799 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04Add ABIArgInfo::dump()Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04Temporarily disable caching of ABI results; this is going horriblyDaniel Dunbar
wrong in some cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04Add asserts that the function signature matches the other arguments provideDaniel Dunbar
to CGCall functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04Handle demotion of coerced arguments (as in void a(x) short x; { ... }).Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Use ConvertTypeForMem when creating alloca for scalar argument.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63681 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03x86_64 ABI: Initial implementation of ABI compliant parameter passing.Daniel Dunbar
- Now only 27/500 failures on ABITest single argument tests; from 350/500. :) - As with return types, a large percentage of these are likely to be gcc bugs, not yet reviewed. Also, fix bug in handling of Ignore ABI type in argument lists. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03ABI handling: Implement coercion for argument types (in addition toDaniel Dunbar
return types). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Change ABIInfo to compute information for a full signature at a timeDaniel Dunbar
(the main point of this restructing). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Remove ABIArgInfo::Default kind, ABI is now responsible for specifyingDaniel Dunbar
acceptable kind with more precise semantics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Add ABIArgInfo::Direct kind, which passes arguments using whatever theDaniel Dunbar
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
2009-02-03Add two FIXMEs.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63613 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Always use CGFunctionInfo to access ABI information.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63612 91177308-0d34-0410-b5e6-96231b3b80d8