[llvm] r339751 - [NFC] Add sanitizing assertion to ICF tracker

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 14 22:50:38 PDT 2018


Author: mkazantsev
Date: Tue Aug 14 22:50:38 2018
New Revision: 339751

URL: http://llvm.org/viewvc/llvm-project?rev=339751&view=rev
Log:
[NFC] Add sanitizing assertion to ICF tracker

Modified:
    llvm/trunk/lib/Transforms/Utils/ImplicitControlFlowTracking.cpp

Modified: llvm/trunk/lib/Transforms/Utils/ImplicitControlFlowTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ImplicitControlFlowTracking.cpp?rev=339751&r1=339750&r2=339751&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/ImplicitControlFlowTracking.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/ImplicitControlFlowTracking.cpp Tue Aug 14 22:50:38 2018
@@ -24,7 +24,9 @@ const Instruction *
 ImplicitControlFlowTracking::getFirstICFI(const BasicBlock *BB) {
   if (!KnownBlocks.count(BB))
     fill(BB);
-  return FirstImplicitControlFlowInsts.lookup(BB);
+  auto *FirstICF = FirstImplicitControlFlowInsts.lookup(BB);
+  assert((!FirstICF || FirstICF->getParent() == BB) && "Inconsistent cache!");
+  return FirstICF;
 }
 
 bool ImplicitControlFlowTracking::hasICF(const BasicBlock *BB) {




More information about the llvm-commits mailing list