aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-06-25 20:51:38 +0000
committerPete Cooper <peter_cooper@apple.com>2015-06-25 20:51:38 +0000
commit125ad17fed80330967100b8c8c0e29e6237e2239 (patch)
tree34a51a81a0d52bfe0422cd0ffc1c0dad1921cab2 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent58163dadc5117bc42ef45ca71dd9a9e62c2c8ce2 (diff)
downloadllvm-125ad17fed80330967100b8c8c0e29e6237e2239.zip
llvm-125ad17fed80330967100b8c8c0e29e6237e2239.tar.gz
llvm-125ad17fed80330967100b8c8c0e29e6237e2239.tar.bz2
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/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index e79eeb07..673d6f1 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1519,8 +1519,8 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
} else if (isa<ConstantArray>(C) || isa<ConstantStruct>(C) ||
isa<ConstantVector>(C)) {
Code = bitc::CST_CODE_AGGREGATE;
- for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i)
- Record.push_back(VE.getValueID(C->getOperand(i)));
+ for (const Value *Op : C->operands())
+ Record.push_back(VE.getValueID(Op));
AbbrevToUse = AggregateAbbrev;
} else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
switch (CE->getOpcode()) {