[PATCH] D64176: [Bugpoint redesign] Added Pass to Remove Global Variables

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 13:36:57 PDT 2019


dblaikie added inline comments.


================
Comment at: llvm/tools/llvm-reduce/deltas/RemoveGlobalVars.h:23-24
+/// elsewhere, those uses would be erased and so on recursively.
+static void eraseDerivedUsers(Instruction *Inst,
+                              std::set<Instruction *> &InstToRemove) {
+  if (!Inst->use_empty())
----------------
(non-member) Static functions aren't appropriate in header files (they lead to code size increases and ODR violations).

You could move these into some sort of implementation namespace (llvm::impl or something like that) or I guess they could be stateless lambdas - or moved out-of-line into a .cpp file instead. (moving the removeGlobalsDeltaPass definition out of line so it can refer to the implementation functions in the .cpp file (where those functions can/should be 'static' in that case))


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64176/new/

https://reviews.llvm.org/D64176





More information about the llvm-commits mailing list