TargetLowering.h #includes SelectionDAGNodes.h, so it doesn't need its

own OpActionsCapacity magic number; it can just use ISD::BUILTIN_OP_END,
as long as it takes care to round up when needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61733 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2009-01-05 19:40:39 +00:00
parent 1eb49a0a5e
commit 11df7e5157
3 changed files with 2 additions and 9 deletions

View File

@ -56,8 +56,6 @@ struct SDVTList {
/// ISD namespace - This namespace contains an enum which represents all of the /// ISD namespace - This namespace contains an enum which represents all of the
/// SelectionDAG node types and value types. /// SelectionDAG node types and value types.
/// ///
/// If you add new elements here you should increase OpActionsCapacity in
/// TargetLowering.h by the number of new elements.
namespace ISD { namespace ISD {
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//

View File

@ -1489,15 +1489,12 @@ private:
/// by the system, this holds the same type (e.g. i32 -> i32). /// by the system, this holds the same type (e.g. i32 -> i32).
MVT TransformToType[MVT::LAST_VALUETYPE]; MVT TransformToType[MVT::LAST_VALUETYPE];
// Defines the capacity of the TargetLowering::OpActions table
static const int OpActionsCapacity = 184;
/// OpActions - For each operation and each value type, keep a LegalizeAction /// OpActions - For each operation and each value type, keep a LegalizeAction
/// that indicates how instruction selection should deal with the operation. /// that indicates how instruction selection should deal with the operation.
/// Most operations are Legal (aka, supported natively by the target), but /// Most operations are Legal (aka, supported natively by the target), but
/// operations that are not should be described. Note that operations on /// operations that are not should be described. Note that operations on
/// non-legal value types are not described here. /// non-legal value types are not described here.
uint64_t OpActions[OpActionsCapacity]; uint64_t OpActions[ISD::BUILTIN_OP_END];
/// LoadExtActions - For each load of load extension type and each value type, /// LoadExtActions - For each load of load extension type and each value type,
/// keep a LegalizeAction that indicates how instruction selection should deal /// keep a LegalizeAction that indicates how instruction selection should deal
@ -1535,7 +1532,7 @@ private:
/// like PerformDAGCombine callbacks for by calling setTargetDAGCombine(), /// like PerformDAGCombine callbacks for by calling setTargetDAGCombine(),
/// which sets a bit in this array. /// which sets a bit in this array.
unsigned char unsigned char
TargetDAGCombineArray[OpActionsCapacity/(sizeof(unsigned char)*8)]; TargetDAGCombineArray[(ISD::BUILTIN_OP_END+CHAR_BIT-1)/CHAR_BIT];
/// PromoteToType - For operations that must be promoted to a specific type, /// PromoteToType - For operations that must be promoted to a specific type,
/// this holds the destination type. This map should be sparse, so don't hold /// this holds the destination type. This map should be sparse, so don't hold

View File

@ -398,8 +398,6 @@ static void InitCmpLibcallCCs(ISD::CondCode *CCs) {
TargetLowering::TargetLowering(TargetMachine &tm) TargetLowering::TargetLowering(TargetMachine &tm)
: TM(tm), TD(TM.getTargetData()) { : TM(tm), TD(TM.getTargetData()) {
assert(ISD::BUILTIN_OP_END <= OpActionsCapacity &&
"Fixed size array in TargetLowering is not large enough!");
// All operations default to being supported. // All operations default to being supported.
memset(OpActions, 0, sizeof(OpActions)); memset(OpActions, 0, sizeof(OpActions));
memset(LoadExtActions, 0, sizeof(LoadExtActions)); memset(LoadExtActions, 0, sizeof(LoadExtActions));