[PATCH] D131790: [unittests/CodeGen] Remove unique_ptr from the result of createTargetMachine

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 12:16:17 PDT 2022


Carrot added inline comments.


================
Comment at: llvm/unittests/CodeGen/MFCommon.inc:120
+BogusTargetMachine *createTargetMachine() {
+  static BogusTargetMachine BogusTM;
+  return &BogusTM;
----------------
thegameg wrote:
> If it's only used in one test maybe we can create a local TM instead of a static one and pass it to `createMachineFunction`?
grep shows there are 13 uses of createMachineFunction.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131790



More information about the llvm-commits mailing list