[TableGen] Use std::fill instead of a manually coded loop. NFC
[oota-llvm.git] / utils / TableGen / CodeGenDAGPatterns.cpp
index e916d87ce45c9d0d1d3ab04696b9205794e2c73d..90a8861bdcdbfd3daa8450104897327f7c584afb 100644 (file)
@@ -1299,8 +1299,8 @@ TreePatternNode *TreePatternNode::clone() const {
 
 /// RemoveAllTypes - Recursively strip all the types of this tree.
 void TreePatternNode::RemoveAllTypes() {
-  for (unsigned i = 0, e = Types.size(); i != e; ++i)
-    Types[i] = EEVT::TypeSet();  // Reset to unknown type.
+  // Reset to unknown type.
+  std::fill(Types.begin(), Types.end(), EEVT::TypeSet());
   if (isLeaf()) return;
   for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
     getChild(i)->RemoveAllTypes();