[llvm] r192209 - IRBuilder: Downgrade InsertPointGuard's instruction pointer to a raw pointer.

Benjamin Kramer benny.kra at googlemail.com
Tue Oct 8 10:44:56 PDT 2013


Author: d0k
Date: Tue Oct  8 12:44:56 2013
New Revision: 192209

URL: http://llvm.org/viewvc/llvm-project?rev=192209&view=rev
Log:
IRBuilder: Downgrade InsertPointGuard's instruction pointer to a raw pointer.

Sadly this loses the checking from AssertingVH, but apparently storing the
end() of a BasicBlock into an AssertingVH has bad consequences as it's not
really an instruction.

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=192209&r1=192208&r2=192209&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/IRBuilder.h (original)
+++ llvm/trunk/include/llvm/IR/IRBuilder.h Tue Oct  8 12:44:56 2013
@@ -197,7 +197,7 @@ public:
   class InsertPointGuard {
     IRBuilderBase &Builder;
     AssertingVH<BasicBlock> Block;
-    AssertingVH<Instruction> Point;
+    BasicBlock::iterator Point;
     DebugLoc DbgLoc;
 
     InsertPointGuard(const InsertPointGuard &) LLVM_DELETED_FUNCTION;
@@ -209,7 +209,7 @@ public:
           DbgLoc(B.getCurrentDebugLocation()) {}
 
     ~InsertPointGuard() {
-      Builder.restoreIP(InsertPoint(Block, BasicBlock::iterator(Point)));
+      Builder.restoreIP(InsertPoint(Block, Point));
       Builder.SetCurrentDebugLocation(DbgLoc);
     }
   };





More information about the llvm-commits mailing list