diff options
author | Dale Johannesen <dalej@apple.com> | 2008-03-10 02:17:22 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-03-10 02:17:22 +0000 |
commit | b8cafe3427a168414400e5dfcbea78996792d2c3 (patch) | |
tree | aedcf29317486800a015207db85b4e61a90ca453 /include/llvm/CodeGen | |
parent | 29c8c370457fc6983bec940168c337a85d5a1e07 (diff) | |
download | external_llvm-b8cafe3427a168414400e5dfcbea78996792d2c3.zip external_llvm-b8cafe3427a168414400e5dfcbea78996792d2c3.tar.gz external_llvm-b8cafe3427a168414400e5dfcbea78996792d2c3.tar.bz2 |
Increase ISD::ParamFlags to 64 bits. Increase the ByValSize
field to 32 bits, thus enabling correct handling of ByVal
structs bigger than 0x1ffff. Abstract interface a bit.
Fixes gcc.c-torture/execute/pr23135.c and
gcc.c-torture/execute/pr28982b.c in gcc testsuite (were ICE'ing
on ppc32, quietly producing wrong code on x86-32.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/CallingConvLower.h | 6 | ||||
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 44 |
2 files changed, 27 insertions, 23 deletions
diff --git a/include/llvm/CodeGen/CallingConvLower.h b/include/llvm/CodeGen/CallingConvLower.h index 8fe3b16..34e2090 100644 --- a/include/llvm/CodeGen/CallingConvLower.h +++ b/include/llvm/CodeGen/CallingConvLower.h @@ -17,6 +17,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/ValueTypes.h" +#include "llvm/CodeGen/SelectionDAGNodes.h" namespace llvm { class TargetRegisterInfo; @@ -97,7 +98,7 @@ public: /// reflect the change. typedef bool CCAssignFn(unsigned ValNo, MVT::ValueType ValVT, MVT::ValueType LocVT, CCValAssign::LocInfo LocInfo, - unsigned ArgFlags, CCState &State); + ISD::ParamFlags::ParamFlagsTy ArgFlags, CCState &State); /// CCState - This class holds information needed while lowering arguments and @@ -196,7 +197,8 @@ public: // parameter attribute. void HandleByVal(unsigned ValNo, MVT::ValueType ValVT, MVT::ValueType LocVT, CCValAssign::LocInfo LocInfo, - int MinSize, int MinAlign, unsigned ArgFlags); + int MinSize, int MinAlign, + ISD::ParamFlags::ParamFlagsTy ArgFlags); private: /// MarkAllocated - Mark a register and all of its aliases as allocated. diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 0d0158a..3828134 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -57,27 +57,29 @@ struct SDVTList { /// namespace ISD { namespace ParamFlags { - enum Flags { - NoFlagSet = 0, - ZExt = 1<<0, ///< Parameter should be zero extended - ZExtOffs = 0, - SExt = 1<<1, ///< Parameter should be sign extended - SExtOffs = 1, - InReg = 1<<2, ///< Parameter should be passed in register - InRegOffs = 2, - StructReturn = 1<<3, ///< Hidden struct-return pointer - StructReturnOffs = 3, - ByVal = 1<<4, ///< Struct passed by value - ByValOffs = 4, - Nest = 1<<5, ///< Parameter is nested function static chain - NestOffs = 5, - ByValAlign = 0xF << 6, //< The alignment of the struct - ByValAlignOffs = 6, - ByValSize = 0x1ffff << 10, //< The size of the struct - ByValSizeOffs = 10, - OrigAlignment = 0x1F<<27, - OrigAlignmentOffs = 27 - }; + typedef unsigned long long ParamFlagsTy; + + const ParamFlagsTy NoFlagSet = 0ULL; + const ParamFlagsTy ZExt = 1ULL<<0; ///< Zero extended + const ParamFlagsTy ZExtOffs = 0; + const ParamFlagsTy SExt = 1ULL<<1; ///< Sign extended + const ParamFlagsTy SExtOffs = 1; + const ParamFlagsTy InReg = 1ULL<<2; ///< Passed in register + const ParamFlagsTy InRegOffs = 2; + const ParamFlagsTy StructReturn = 1ULL<<3; ///< Hidden struct-ret ptr + const ParamFlagsTy StructReturnOffs = 3; + const ParamFlagsTy ByVal = 1ULL<<4; ///< Struct passed by value + const ParamFlagsTy ByValOffs = 4; + const ParamFlagsTy Nest = 1ULL<<5; ///< Nested fn static chain + const ParamFlagsTy NestOffs = 5; + const ParamFlagsTy ByValAlign = 0xFULL << 6; //< Struct alignment + const ParamFlagsTy ByValAlignOffs = 6; + const ParamFlagsTy OrigAlignment = 0x1FULL<<27; + const ParamFlagsTy OrigAlignmentOffs = 27; + const ParamFlagsTy ByValSize = 0xffffffffULL << 32; //< Struct size + const ParamFlagsTy ByValSizeOffs = 32; + + const ParamFlagsTy One = 1LL; //< 1 of this type, for shifts } //===--------------------------------------------------------------------===// |