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

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 12:39:51 PDT 2022


thegameg accepted this revision.
thegameg added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/unittests/CodeGen/MFCommon.inc:120
+BogusTargetMachine *createTargetMachine() {
+  static BogusTargetMachine BogusTM;
+  return &BogusTM;
----------------
Carrot wrote:
> 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.
I missed that this is included in other files. This is fine then.


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