From 4fc930229dff7669aaf315e0563bc586242d8e79 Mon Sep 17 00:00:00 2001 From: David Neto Date: Fri, 31 Mar 2017 10:36:10 -0400 Subject: [PATCH] opt::Function::cbegin and cend are const --- source/opt/function.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/opt/function.h b/source/opt/function.h index 2e0674e0d..1c460d890 100644 --- a/source/opt/function.h +++ b/source/opt/function.h @@ -59,8 +59,12 @@ class Function { iterator begin() { return iterator(&blocks_, blocks_.begin()); } iterator end() { return iterator(&blocks_, blocks_.end()); } - const_iterator cbegin() { return const_iterator(&blocks_, blocks_.cbegin()); } - const_iterator cend() { return const_iterator(&blocks_, blocks_.cend()); } + const_iterator cbegin() const { + return const_iterator(&blocks_, blocks_.cbegin()); + } + const_iterator cend() const { + return const_iterator(&blocks_, blocks_.cend()); + } // Runs the given function |f| on each instruction in this function, and // optionally on debug line instructions that might precede them.