================
@@ -39,32 +39,32 @@ ModuleToObject::ModuleToObject(Operation &module, StringRef
triple,
: module(module), triple(triple), chip(chip), features(features),
optLevel(optLevel) {}
+ModuleToObject::~ModuleToObject() = default;
+
Operation &ModuleToObject::getOperation() { return module; }
-std::unique_ptr<llvm::TargetMachine> ModuleToObject::createTargetMachine() {
+std::optional<llvm::TargetMachine *>
+ModuleToObject::getOrCreateTargetMachine() {
std::string error;
----------------
fabianmcg wrote:
Is there a reason why the cached `targetMachine` is not immediately returned?
```suggestion
if (targetMachine)
return targetMachine.get();
std::string error;
```
https://github.com/llvm/llvm-project/pull/71165
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits