]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commitdiff
DIBuilder: Stop abusing DIExpressionIterator::operator*(), NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 22 Jan 2015 03:13:35 +0000 (03:13 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 22 Jan 2015 03:13:35 +0000 (03:13 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226773 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/DebugInfo.h

index fc4d95cfc14712dffa0675c2fed7ee2ff76ba8e4..f42a8ebd8842f5aafc70d1449eb3ce30cd276e10 100644 (file)
@@ -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; }