opt::Function::cbegin and cend are const

This commit is contained in:
David Neto 2017-03-31 10:36:10 -04:00
parent 6cd4517730
commit 4fc930229d

View File

@ -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.