diff options
author | Owen Anderson <resistor@mac.com> | 2007-09-07 04:06:50 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-09-07 04:06:50 +0000 |
commit | 718cb665ca6ce2bc4d8e8479f46a45db91b49f86 (patch) | |
tree | 51ddca6b6eead9bf38aafd5507e6c3c06048f0ad /lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | af992f782fb2cac8d00b352c3dd73f6e782b5758 (diff) |
Add lengthof and endof templates that hide a lot of sizeof computations.
Patch by Sterling Stein!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41758 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 9597696d2d..2dbd4e8c7e 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -18,6 +18,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Support/MathExtras.h" using namespace llvm; @@ -145,8 +146,7 @@ TargetLowering::TargetLowering(TargetMachine &tm) ShiftAmountTy = SetCCResultTy = PointerTy = getValueType(TD->getIntPtrType()); ShiftAmtHandling = Undefined; memset(RegClassForVT, 0,MVT::LAST_VALUETYPE*sizeof(TargetRegisterClass*)); - memset(TargetDAGCombineArray, 0, - sizeof(TargetDAGCombineArray)/sizeof(TargetDAGCombineArray[0])); + memset(TargetDAGCombineArray, 0, array_lengthof(TargetDAGCombineArray)); maxStoresPerMemset = maxStoresPerMemcpy = maxStoresPerMemmove = 8; allowUnalignedMemoryAccesses = false; UseUnderscoreSetJmp = false; |