Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).
[oota-llvm.git] / lib / Target / R600 / AMDGPUISelLowering.cpp
index 9891ad32fa7c29c38a849d8ec8e12f3e60297db7..3629d74baeb93f8d8573f2534ed5538ea2bdd8e5 100644 (file)
@@ -82,7 +82,7 @@ AMDGPUTargetLowering::AMDGPUTargetLowering(TargetMachine &TM) :
     (int)MVT::v2i32,
     (int)MVT::v4i32
   };
-  size_t NumTypes = sizeof(types) / sizeof(*types);
+  const size_t NumTypes = array_lengthof(types);
 
   for (unsigned int x  = 0; x < NumTypes; ++x) {
     MVT::SimpleValueType VT = (MVT::SimpleValueType)types[x];