aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Target/TargetLowering.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-04-16 20:08:45 +0000
committerDan Gohman <gohman@apple.com>2010-04-16 20:08:45 +0000
commit1f76cfe7cbc4deb9cf136f2083ffccdc44b245df (patch)
tree3b99b6d9559b283f62492c1acb060a990a09ee12 /include/llvm/Target/TargetLowering.h
parent05af8f4b58d7f69cbbca8334ce41ced530dbe79b (diff)
downloadexternal_llvm-1f76cfe7cbc4deb9cf136f2083ffccdc44b245df.zip
external_llvm-1f76cfe7cbc4deb9cf136f2083ffccdc44b245df.tar.gz
external_llvm-1f76cfe7cbc4deb9cf136f2083ffccdc44b245df.tar.bz2
Fix this code to avoid implicit assumptions about the length of the array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetLowering.h')
-rw-r--r--include/llvm/Target/TargetLowering.h10
1 files changed, 1 insertions, 9 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index fca2453..1272c60 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -180,16 +180,8 @@ public:
uint32_t ValueTypeActions[(MVT::MAX_ALLOWED_VALUETYPE/32)*2];
public:
ValueTypeActionImpl() {
- ValueTypeActions[0] = ValueTypeActions[1] = 0;
- ValueTypeActions[2] = ValueTypeActions[3] = 0;
+ std::fill(ValueTypeActions, array_endof(ValueTypeActions), 0);
}
- ValueTypeActionImpl(const ValueTypeActionImpl &RHS) {
- ValueTypeActions[0] = RHS.ValueTypeActions[0];
- ValueTypeActions[1] = RHS.ValueTypeActions[1];
- ValueTypeActions[2] = RHS.ValueTypeActions[2];
- ValueTypeActions[3] = RHS.ValueTypeActions[3];
- }
-
LegalizeAction getTypeAction(LLVMContext &Context, EVT VT) const {
if (VT.isExtended()) {
if (VT.isVector()) {