[PATCH] D45593: [DebugInfo][OPT] Fixing a couple of DI duplication bugs of CloneModule

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 15:52:58 PDT 2018


vsk added inline comments.


================
Comment at: lib/Transforms/Utils/CloneFunction.cpp:52
   // Loop over all instructions, and copy them over.
-  for (BasicBlock::const_iterator II = BB->begin(), IE = BB->end();
-       II != IE; ++II) {
-
-    if (DIFinder && TheModule) {
-      if (auto *DDI = dyn_cast<DbgDeclareInst>(II))
-        DIFinder->processDeclare(*TheModule, DDI);
-      else if (auto *DVI = dyn_cast<DbgValueInst>(II))
-        DIFinder->processValue(*TheModule, DVI);
+  for (BasicBlock::const_iterator II = BB->begin(), IE = BB->end(); II != IE;
+       ++II) {
----------------
Might be nice to rewrite this as 'for (Instruction *I : *BB)' while we're changing things.


Repository:
  rL LLVM

https://reviews.llvm.org/D45593





More information about the llvm-commits mailing list