[flang-commits] [flang] 6d3224d - [flang][nfc] Simplify TargetMachine initialisation
Andrzej Warzynski via flang-commits
flang-commits at lists.llvm.org
Wed Apr 13 03:49:32 PDT 2022
Author: Andrzej Warzynski
Date: 2022-04-13T10:49:24Z
New Revision: 6d3224d93f010fdad74b3244620042629dc7eeec
URL: https://github.com/llvm/llvm-project/commit/6d3224d93f010fdad74b3244620042629dc7eeec
DIFF: https://github.com/llvm/llvm-project/commit/6d3224d93f010fdad74b3244620042629dc7eeec.diff
LOG: [flang][nfc] Simplify TargetMachine initialisation
Added:
Modified:
flang/lib/Frontend/FrontendActions.cpp
Removed:
################################################################################
diff --git a/flang/lib/Frontend/FrontendActions.cpp b/flang/lib/Frontend/FrontendActions.cpp
index e93781e87fe00..a05c2e27a34b4 100644
--- a/flang/lib/Frontend/FrontendActions.cpp
+++ b/flang/lib/Frontend/FrontendActions.cpp
@@ -555,9 +555,9 @@ void BackendAction::ExecuteAction() {
assert(theTarget && "Failed to create Target");
// Create `TargetMachine`
- std::unique_ptr<llvm::TargetMachine> TM;
- TM.reset(theTarget->createTargetMachine(theTriple, /*CPU=*/"",
- /*Features=*/"", llvm::TargetOptions(), llvm::None));
+ std::unique_ptr<llvm::TargetMachine> TM(
+ theTarget->createTargetMachine(theTriple, /*CPU=*/"",
+ /*Features=*/"", llvm::TargetOptions(), llvm::None));
assert(TM && "Failed to create TargetMachine");
llvmModule->setDataLayout(TM->createDataLayout());
More information about the flang-commits
mailing list