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

Roman Tereshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 17:43:20 PDT 2018


rtereshin marked 2 inline comments as done.
rtereshin added inline comments.


================
Comment at: include/llvm/IR/DebugInfo.h:69
   void processModule(const Module &M);
+  /// \brief Process a single instruction and collect debug info anchors.
+  void processInstruction(const Module &M, const Instruction &I);
----------------
aprantl wrote:
> The \brief is unnecessary, we have autobrief enabled in our Doxyfile.
I'm removing `\brief`s from the entire header in the second NFC-commit you asked for then, thanks!


================
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) {
----------------
vsk wrote:
> Might be nice to rewrite this as 'for (Instruction *I : *BB)' while we're changing things.
Sure, doing that in the follow-up NFC-commit @aprantl asked me for, thanks!


Repository:
  rL LLVM

https://reviews.llvm.org/D45593





More information about the llvm-commits mailing list