[llvm] r239736 - De-duplicate common expression, NFC.

Yaron Keren yaron.keren at gmail.com
Mon Jun 15 10:03:35 PDT 2015


Author: yrnkrn
Date: Mon Jun 15 12:03:35 2015
New Revision: 239736

URL: http://llvm.org/viewvc/llvm-project?rev=239736&view=rev
Log:
De-duplicate common expression, NFC.


Modified:
    llvm/trunk/lib/IR/Instruction.cpp

Modified: llvm/trunk/lib/IR/Instruction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Instruction.cpp?rev=239736&r1=239735&r2=239736&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Instruction.cpp (original)
+++ llvm/trunk/lib/IR/Instruction.cpp Mon Jun 15 12:03:35 2015
@@ -26,9 +26,9 @@ Instruction::Instruction(Type *ty, unsig
 
   // 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);
   }
 }
 





More information about the llvm-commits mailing list