aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-01-31 23:54:05 -0800
committerKazu Hirata <kazu@google.com>2024-01-31 23:54:05 -0800
commite8512786fedbfa6ddba70ceddc29d7122173ba5e (patch)
tree0f9417ca0f81b05e30067f7450fc4ae93147c5b8 /llvm/lib/IR/Function.cpp
parent7ec996d4c5c30083b070be4898140440094e6b97 (diff)
downloadllvm-e8512786fedbfa6ddba70ceddc29d7122173ba5e.zip
llvm-e8512786fedbfa6ddba70ceddc29d7122173ba5e.tar.gz
llvm-e8512786fedbfa6ddba70ceddc29d7122173ba5e.tar.bz2
[IR] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp7
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;
}