diff --git a/include/llvm/IR/DebugInfo.h b/include/llvm/IR/DebugInfo.h index 539025f0df2..1aec146c579 100644 --- a/include/llvm/IR/DebugInfo.h +++ b/include/llvm/IR/DebugInfo.h @@ -886,7 +886,7 @@ public: /// \brief Returns underlying DIHeaderFieldIterator. const DIHeaderFieldIterator &getBase() const { return I; } /// \brief Returns the next operand. - const Operand &getNext() const; + Operand getNext() const; }; /// \brief An iterator for DIExpression elements. diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 9b5a9c3da47..88f7e33b7dc 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -170,7 +170,7 @@ DIExpression::iterator DIExpression::end() const { return DIExpression::iterator(); } -const DIExpression::Operand &DIExpression::Operand::getNext() const { +DIExpression::Operand DIExpression::Operand::getNext() const { iterator it(I); return *(++it); }