summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2015-12-07 06:31:41 +0000
committerCraig Topper <craig.topper@gmail.com>2015-12-07 06:31:41 +0000
commit8d2093d1dfe26d8a23d3677a6be23304ccf85477 (patch)
treea89f42b9f9af1c139ae09daac05798c96b42f016
parent1d3b5a3ac2209366fe63c41f7b79ca2ab8b683ee (diff)
downloadbcm5719-llvm-8d2093d1dfe26d8a23d3677a6be23304ccf85477.tar.gz
bcm5719-llvm-8d2093d1dfe26d8a23d3677a6be23304ccf85477.zip
Add uint8_t size to LegalizeTypeAction enum and use the enum type directly to remove some typecasts. NFC
llvm-svn: 254895
-rw-r--r--llvm/include/llvm/Target/TargetLowering.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/include/llvm/Target/TargetLowering.h b/llvm/include/llvm/Target/TargetLowering.h
index 7e981776290..f7152565f91 100644
--- a/llvm/include/llvm/Target/TargetLowering.h
+++ b/llvm/include/llvm/Target/TargetLowering.h
@@ -93,7 +93,7 @@ public:
/// This enum indicates whether a types are legal for a target, and if not,
/// what action should be used to make them valid.
- enum LegalizeTypeAction {
+ enum LegalizeTypeAction : uint8_t {
TypeLegal, // The target natively supports this type.
TypePromoteInteger, // Replace this integer with a larger one.
TypeExpandInteger, // Split this integer into two of half the size.
@@ -413,20 +413,20 @@ public:
class ValueTypeActionImpl {
/// ValueTypeActions - For each value type, keep a LegalizeTypeAction enum
/// that indicates how instruction selection should deal with the type.
- uint8_t ValueTypeActions[MVT::LAST_VALUETYPE];
+ LegalizeTypeAction ValueTypeActions[MVT::LAST_VALUETYPE];
public:
ValueTypeActionImpl() {
- std::fill(std::begin(ValueTypeActions), std::end(ValueTypeActions), 0);
+ std::fill(std::begin(ValueTypeActions), std::end(ValueTypeActions),
+ TypeLegal);
}
LegalizeTypeAction getTypeAction(MVT VT) const {
- return (LegalizeTypeAction)ValueTypeActions[VT.SimpleTy];
+ return ValueTypeActions[VT.SimpleTy];
}
void setTypeAction(MVT VT, LegalizeTypeAction Action) {
- unsigned I = VT.SimpleTy;
- ValueTypeActions[I] = Action;
+ ValueTypeActions[VT.SimpleTy] = Action;
}
};
OpenPOWER on IntegriCloud