[llvm] r300877 - VarStreamArrayIterator needed non-const operator* overload.

Adrian McCarthy via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 12:34:06 PDT 2017


Author: amccarth
Date: Thu Apr 20 14:34:06 2017
New Revision: 300877

URL: http://llvm.org/viewvc/llvm-project?rev=300877&view=rev
Log:
VarStreamArrayIterator needed non-const operator* overload.

Without this change, the operator-> provided by iterator_facade lost type
qualifiers.

Differential Revision: https://reviews.llvm.org/D32235

Modified:
    llvm/trunk/include/llvm/Support/BinaryStreamArray.h

Modified: llvm/trunk/include/llvm/Support/BinaryStreamArray.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/BinaryStreamArray.h?rev=300877&r1=300876&r2=300877&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/BinaryStreamArray.h (original)
+++ llvm/trunk/include/llvm/Support/BinaryStreamArray.h Thu Apr 20 14:34:06 2017
@@ -162,6 +162,11 @@ public:
     return ThisValue;
   }
 
+  ValueType &operator*() {
+    assert(Array && !HasError);
+    return ThisValue;
+  }
+
   IterType &operator+=(unsigned N) {
     for (unsigned I = 0; I < N; ++I) {
       // We are done with the current record, discard it so that we are




More information about the llvm-commits mailing list