[llvm] r226775 - DIBuilder: Make header iterator constructor explicit, NFC

Duncan P. N. Exon Smith dexonsmith at apple.com
Wed Jan 21 19:20:09 PST 2015


Author: dexonsmith
Date: Wed Jan 21 21:20:09 2015
New Revision: 226775

URL: http://llvm.org/viewvc/llvm-project?rev=226775&view=rev
Log:
DIBuilder: Make header iterator constructor explicit, NFC

Modified:
    llvm/trunk/include/llvm/IR/DebugInfo.h

Modified: llvm/trunk/include/llvm/IR/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfo.h?rev=226775&r1=226774&r2=226775&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfo.h Wed Jan 21 21:20:09 2015
@@ -66,7 +66,7 @@ class DIHeaderFieldIterator
 
 public:
   DIHeaderFieldIterator() {}
-  DIHeaderFieldIterator(StringRef Header)
+  explicit DIHeaderFieldIterator(StringRef Header)
       : Header(Header), Current(Header.slice(0, Header.find('\0'))) {}
   StringRef operator*() const { return Current; }
   const StringRef * operator->() const { return &Current; }
@@ -200,8 +200,10 @@ public:
                          DIHeaderFieldIterator());
   }
 
-  DIHeaderFieldIterator header_begin() const { return getHeader(); }
-  DIHeaderFieldIterator header_end() const { return StringRef(); }
+  DIHeaderFieldIterator header_begin() const {
+    return DIHeaderFieldIterator(getHeader());
+  }
+  DIHeaderFieldIterator header_end() const { return DIHeaderFieldIterator(); }
 
   DIHeaderFieldIterator getHeaderIterator(unsigned Index) const {
     // Since callers expect an empty string for out-of-range accesses, we can't





More information about the llvm-commits mailing list