[PATCH] D96456: [ThinLTO, NewPM] Add Config::OptPassBuilderHook

Teresa Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 10 16:01:23 PST 2021


tejohnson added inline comments.


================
Comment at: clang/lib/CodeGen/BackendUtil.cpp:1549
+  Conf.OptPassBuilderHook = [&](PassBuilder &PB) {
+    addSanitizers(TargetTriple, CGOpts, LOpts, PB);
+  };
----------------
I can't find where this is defined.


================
Comment at: llvm/include/llvm/LTO/Config.h:54
+  /// For adding passes that run by opt.
+  std::function<void(PassBuilder &)> OptPassBuilderHook;
   Optional<Reloc::Model> RelocModel = Reloc::PIC_;
----------------
Is this essentially the new PM equivalent to PreCodeGenPassesHook above (since this new hook runs at the end of opt)?
Also, might be good to name this like OptimizerLastPassBuilderHook or something like that to indicate its position within the opt pipeline.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96456



More information about the cfe-commits mailing list