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 | e2f23a3abf7518a27a3e4e0342093190496d1b9f (patch) | |
tree | adbc06f83b198727d50363db6a33585a24df2dd5 /llvm/lib/Target/Mips/MipsInstrInfo.cpp | |
parent | 3ce57c6baf0961108f76d3d377ff554b765b848e (diff) | |
download | bcm5719-llvm-e2f23a3abf7518a27a3e4e0342093190496d1b9f.tar.gz bcm5719-llvm-e2f23a3abf7518a27a3e4e0342093190496d1b9f.zip |
Add lengthof and endof templates that hide a lot of sizeof computations.
Patch by Sterling Stein!
llvm-svn: 41758
Diffstat (limited to 'llvm/lib/Target/Mips/MipsInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MipsInstrInfo.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.cpp b/llvm/lib/Target/Mips/MipsInstrInfo.cpp index fb73a79b47c..4551d554f2b 100644 --- a/llvm/lib/Target/Mips/MipsInstrInfo.cpp +++ b/llvm/lib/Target/Mips/MipsInstrInfo.cpp @@ -13,6 +13,7 @@ #include "Mips.h" #include "MipsInstrInfo.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "MipsGenInstrInfo.inc" @@ -20,7 +21,7 @@ using namespace llvm; // TODO: Add the subtarget support on this constructor MipsInstrInfo::MipsInstrInfo(MipsTargetMachine &tm) - : TargetInstrInfo(MipsInsts, sizeof(MipsInsts)/sizeof(MipsInsts[0])), + : TargetInstrInfo(MipsInsts, array_lengthof(MipsInsts)), TM(tm), RI(*this) {} static bool isZeroImm(const MachineOperand &op) { |