[llvm] r185952 - IRBuilder: add an assertion that checks if we try to get a debug loc from ->end();

Nadav Rotem nrotem at apple.com
Tue Jul 9 10:54:23 PDT 2013


Author: nadav
Date: Tue Jul  9 12:54:22 2013
New Revision: 185952

URL: http://llvm.org/viewvc/llvm-project?rev=185952&view=rev
Log:
IRBuilder: add an assertion that checks if we try to get a debug loc from ->end();

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

Modified: llvm/trunk/include/llvm/IR/IRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/IRBuilder.h?rev=185952&r1=185951&r2=185952&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/IRBuilder.h (original)
+++ llvm/trunk/include/llvm/IR/IRBuilder.h Tue Jul  9 12:54:22 2013
@@ -90,6 +90,7 @@ public:
   void SetInsertPoint(Instruction *I) {
     BB = I->getParent();
     InsertPt = I;
+    assert(I != BB->end() && "Can't read debug loc from end()");
     SetCurrentDebugLocation(I->getDebugLoc());
   }
 





More information about the llvm-commits mailing list