De-duplicate common expression, NFC.
authorYaron Keren <yaron.keren@gmail.com>
Mon, 15 Jun 2015 17:03:35 +0000 (17:03 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Mon, 15 Jun 2015 17:03:35 +0000 (17:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239736 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/Instruction.cpp

index 45bb296602cab7ed9b1004cbafdd9deb04556edc..af426387be799326f72e68162d421177289e7cab 100644 (file)
@@ -26,9 +26,9 @@ Instruction::Instruction(Type *ty, unsigned it, Use *Ops, unsigned NumOps,
 
   // If requested, insert this instruction into a basic block...
   if (InsertBefore) {
-    assert(InsertBefore->getParent() &&
-           "Instruction to insert before is not in a basic block!");
-    InsertBefore->getParent()->getInstList().insert(InsertBefore, this);
+    BasicBlock *BB = InsertBefore->getParent();
+    assert(BB && "Instruction to insert before is not in a basic block!");
+    BB->getInstList().insert(InsertBefore, this);
   }
 }