Correct CFGBlock's front() and back() to return by const ref rather than value.

This ought to fix PR11926, a crash when when running Clang built with GCC 4.7

llvm-svn: 155805
This commit is contained in:
David Blaikie 2012-04-30 00:42:50 +00:00
parent 6a52771823
commit 13ef0cfd69
1 changed files with 3 additions and 2 deletions

View File

@ -277,6 +277,7 @@ class CFGBlock {
typedef std::reverse_iterator<ImplTy::const_iterator> const_iterator;
typedef ImplTy::iterator reverse_iterator;
typedef ImplTy::const_iterator const_reverse_iterator;
typedef ImplTy::const_reference const_reference;
void push_back(CFGElement e, BumpVectorContext &C) { Impl.push_back(e, C); }
reverse_iterator insert(reverse_iterator I, size_t Cnt, CFGElement E,
@ -284,8 +285,8 @@ class CFGBlock {
return Impl.insert(I, Cnt, E, C);
}
CFGElement front() const { return Impl.back(); }
CFGElement back() const { return Impl.front(); }
const_reference front() const { return Impl.back(); }
const_reference back() const { return Impl.front(); }
iterator begin() { return Impl.rbegin(); }
iterator end() { return Impl.rend(); }