diff options
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r-- | llvm/lib/IR/Function.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index 22e2455..d3e2ae0 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -1976,10 +1976,9 @@ DenseSet<GlobalValue::GUID> Function::getImportGUIDs() const { if (MDNode *MD = getMetadata(LLVMContext::MD_prof)) if (MDString *MDS = dyn_cast<MDString>(MD->getOperand(0))) if (MDS->getString().equals("function_entry_count")) - for (unsigned i = 2; i < MD->getNumOperands(); i++) - R.insert(mdconst::extract<ConstantInt>(MD->getOperand(i)) - ->getValue() - .getZExtValue()); + for (const MDOperand &MDO : llvm::drop_begin(MD->operands(), 2)) + R.insert( + mdconst::extract<ConstantInt>(MDO)->getValue().getZExtValue()); return R; } |