How to set DevirtModule's attribute RemarksEnabled true?

llvm-project/WholeProgramDevirt.cpp at main · llvm/llvm-project · GitHub)%2C

The WPD DevirtModule code is invoked during the LTO link (for either regular or Thin LTO), so you need to enable remarks via the linker (rather than via -Rpass= from clang like you would to enable remarks for non-LTO or pre-LTO link compiles). It will depend on which linker you are using. If lld, then -Wl,-mllvm,-pass-remarks= wholeprogramdevirt

2 Likes