diff options
author | Pete Cooper <peter_cooper@apple.com> | 2015-06-25 20:51:38 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2015-06-25 20:51:38 +0000 |
commit | 125ad17fed80330967100b8c8c0e29e6237e2239 (patch) | |
tree | 34a51a81a0d52bfe0422cd0ffc1c0dad1921cab2 /llvm/lib/Target/CppBackend/CPPBackend.cpp | |
parent | 58163dadc5117bc42ef45ca71dd9a9e62c2c8ce2 (diff) | |
download | bcm5719-llvm-125ad17fed80330967100b8c8c0e29e6237e2239.tar.gz bcm5719-llvm-125ad17fed80330967100b8c8c0e29e6237e2239.zip |
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
Diffstat (limited to 'llvm/lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r-- | llvm/lib/Target/CppBackend/CPPBackend.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
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<Constant>(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<GlobalValue>(operand)) { gvs.insert(GV); |