summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 36ba8d0721f..ec094812ceb 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -195,9 +195,9 @@ LLVMContext &Function::getContext() const {
return getType()->getContext();
}
-unsigned Function::getInstructionCount() {
+unsigned Function::getInstructionCount() const {
unsigned NumInstrs = 0;
- for (BasicBlock &BB : BasicBlocks)
+ for (const BasicBlock &BB : BasicBlocks)
NumInstrs += std::distance(BB.instructionsWithoutDebug().begin(),
BB.instructionsWithoutDebug().end());
return NumInstrs;
OpenPOWER on IntegriCloud