[llvm] r226773 - DIBuilder: Stop abusing DIExpressionIterator::operator*(), NFC

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


Author: dexonsmith
Date: Wed Jan 21 21:13:35 2015
New Revision: 226773

URL: http://llvm.org/viewvc/llvm-project?rev=226773&view=rev
Log:
DIBuilder: Stop abusing DIExpressionIterator::operator*(), NFC

This code was confusing, since it created a `DIExpressionIterator` from
an invalid start point (although it wasn't wrong: it never actually
iterated).  Now that the underlying iterator has `getNumber()`, just use
it directly.

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=226773&r1=226772&r2=226773&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfo.h Wed Jan 21 21:13:35 2015
@@ -910,7 +910,7 @@ public:
   uint64_t getArg(unsigned N) const {
     auto In = I;
     std::advance(In, N);
-    return *DIExpressionIterator(In);
+    return In.getNumber<uint64_t>();
   }
 
   const DIHeaderFieldIterator& getBase() const { return I; }





More information about the llvm-commits mailing list