From 125ad17fed80330967100b8c8c0e29e6237e2239 Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Thu, 25 Jun 2015 20:51:38 +0000 Subject: Use foreach loop over constant operands. NFC. A number of places had explicit loops over Constant::operands(). Just use foreach loops where possible. llvm-svn: 240694 --- llvm/lib/Target/CppBackend/CPPBackend.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/Target/CppBackend/CPPBackend.cpp') diff --git a/llvm/lib/Target/CppBackend/CPPBackend.cpp b/llvm/lib/Target/CppBackend/CPPBackend.cpp index 9c9c097b4c3..bc5d7f65b2f 100644 --- a/llvm/lib/Target/CppBackend/CPPBackend.cpp +++ b/llvm/lib/Target/CppBackend/CPPBackend.cpp @@ -1678,9 +1678,8 @@ void CppWriter::printFunctionUses(const Function* F) { consts.insert(GVar->getInitializer()); } else if (Constant* C = dyn_cast(operand)) { consts.insert(C); - for (unsigned j = 0; j < C->getNumOperands(); ++j) { + for (Value* operand : C->operands()) { // If the operand references a GVal or Constant, make a note of it - Value* operand = C->getOperand(j); printType(operand->getType()); if (GlobalValue* GV = dyn_cast(operand)) { gvs.insert(GV); -- cgit v1.2.3