[PATCH] D46815: [DbgInfo] Fix StripDebugInfo

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 14 17:39:48 PDT 2018


vsk requested changes to this revision.
vsk added a comment.
This revision now requires changes to proceed.

Thanks for the patch.



================
Comment at: lib/IR/DebugInfo.cpp:389
+    }
+  }
+
----------------
This takes linear time. There's a cheaper way to do this:

```
StringRef DbgIntrinsics = {"llvm.dbg.value", ...};
for (StringRef Func : DbgIntrinsics) {
  auto *F = M.getFunction(Func);
  if (!F)
    continue;
  assert(F->use_empty());
  F->eraseFromParent();
}
```


================
Comment at: test/DebugInfo/strip-intrinsic-dbg.ll:1
+; RUN: opt -S -strip-debug <%s | FileCheck %s
+
----------------
You could simplify the test with -debugify :).

RUN: opt -S < %s -debugify -strip-debug | ...

This way, there's no need to check in all the extra metadata lines.


Repository:
  rL LLVM

https://reviews.llvm.org/D46815





More information about the llvm-commits mailing list