[PATCH] D140349: [llvm][PassSupport] don't require passes to be default constructible

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 14:36:48 PST 2022


efriedma added inline comments.


================
Comment at: llvm/include/llvm/PassSupport.h:91
+Pass *callDefaultCtor() {
+  return nullptr;
+}
----------------
nickdesaulniers wrote:
> arsenm wrote:
> > Should just be llvm_unreachable? Is this checked anywhere?
> Looks like that would be called if you run the pass with opt and LPM: `opt -<passname>`.
Please use report_fatal_error for codepaths that might actually be reachable.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.h:96
 
-  explicit AMDGPUDAGToDAGISel(TargetMachine *TM = nullptr,
-                              CodeGenOpt::Level OptLevel = CodeGenOpt::Default);
+  AMDGPUDAGToDAGISel() = delete;
+
----------------
I don't think there's any point to explicitly deleting the default constructor (here and elsewhere); there's no implicitly-declared default constructor if there's an explicit constructor.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140349



More information about the llvm-commits mailing list