Commit Graph

12 Commits

Author SHA1 Message Date
Daniel Dunbar d3674e6f40 Use ABIArgInfo for decisions about function arguments (not just return
value).
 - Added ABIArgInfo::ByVal (mostly supported) and ABIArgInfo::Expand
   (asserted out).

 - Added classifyArgumentType which currently just uses
   ABIArgInfo::Default or ByVal. This nearly matches old behavior, but
   we now set ByVal in a few situations we may have left it off before
   (on complex, for example).

llvm-svn: 56086
2008-09-11 01:48:57 +00:00
Daniel Dunbar 83876b4594 Bug fix, apply default argument promotion in message sends for which
no method declaration was found.
 - This was allowing arrays to pass "by value" among other things.

Add assert in CodeGen that arguments cannot have array type.

llvm-svn: 56080
2008-09-11 00:04:36 +00:00
Daniel Dunbar 573884eaf7 Implement ABIArgType::Coerce support.
- As a test, enable basic usage for some common x86-32 cases. This
    increases our x86-32 compliance (on other targets our compliance
    will just be broken in a different way).

llvm-svn: 56051
2008-09-10 07:04:09 +00:00
Daniel Dunbar b8b4759462 Add CodeGenTypes::GetFunctionType overload for getting the effective
type of a call.

Change NeXT runtime to use this instead of trying to bitcasting
internally (which doesn't respect the ABI).

Fix subtle bug, use of ConvertTypeRecursive instead of ConvertType is
bad inside GetFunctionType.

llvm-svn: 56050
2008-09-10 07:00:50 +00:00
Daniel Dunbar 7a95ca3197 Move FunctionType conversion into CGCall.cpp:
- Added CodeGenTypes::GetFunctionType, taking a CGFunctionInfo.
 - Updated Obj-C runtimes to use this instead of rolling the
   llvm::FunctionType by hand.
 - Killed CodeGenTypes::{ConvertReturnType, DecodeArgumentTypes}.

Add ABIArgInfo class to encapsulate ABI decision of how to lower types
to LLVM.
 - Will move to target sometime soon.

llvm-svn: 56047
2008-09-10 04:01:49 +00:00
Daniel Dunbar a72d4aece6 Add ABIArgInfo class to encapsulate ABI decision of how to lower types
to LLVM.
 - Will move to target sometime soon.

llvm-svn: 56046
2008-09-10 02:41:04 +00:00
Daniel Dunbar c68897d2c3 Tweak CGCall functions again:
- Realized these functions will eventually need access to more data,
   moved to CodeGenModule. Eventually they should probably live
   together in some other helper class.

llvm-svn: 56039
2008-09-10 00:41:16 +00:00
Daniel Dunbar 76c8eb75b1 Tweak CGCall functions:
- Move actual param attr list creation to
   CodeGenFunction::ConstructParamAttrList.
 - Make ReturnTypeUsesSret static.

llvm-svn: 56038
2008-09-10 00:32:18 +00:00
Daniel Dunbar 81cf67fa0b Add CodeGenFunction::ReturnTypeUsesSret
- Hook so NeXT runtime doesn't depend on ABI.

llvm-svn: 56034
2008-09-09 23:48:28 +00:00
Daniel Dunbar 613855c8af Move ABI specific code for functions / calls to CGCall.cpp:
- Factor out EmitFunction{Pro,Epi}log

llvm-svn: 56031
2008-09-09 23:27:19 +00:00
Daniel Dunbar 41cf9dedc6 Change CodeGen to emit calls using (RValue,Type) list:
- Add CodeGenFunction::EmitAnyExprToTemp
   o Like EmitAnyExpr, but emits aggregates to a temporary location if
     none is available. Seems like this should be simpler (even aside
     from using first class aggregates).

 - Killed CodeGenFunction::EmitCallArg (just append the pair)

 - Conversion of RValues to actual call arguments is now isolated in
   CodeGenFunction::EmitCall.

llvm-svn: 55970
2008-09-09 01:06:48 +00:00
Daniel Dunbar 3d7c90b8ec Refactor parameter attribute handling:
- Add CGCall.h for dealing with ABI issues related to calls.
  - Add CGFunctionInfo and CGCallInfo for capturing ABI relevant
    information about functions and calls.
  - Isolate LLVM parameter attribute handling inside CGCall.cpp

llvm-svn: 55963
2008-09-08 21:33:45 +00:00