[clang] [Flang] responds to Clang Tidy feedback (PR #87847)

Christopher Di Bella via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 5 17:14:45 PDT 2024


https://github.com/cjdb created https://github.com/llvm/llvm-project/pull/87847

Line 267: performance-unnecessary-copy-initialization
Line 592: readability-container-size-empty

>From b8e67dfae63ee64753724dba8735799b39f4fcc0 Mon Sep 17 00:00:00 2001
From: Christopher Di Bella <cjdb at google.com>
Date: Sat, 6 Apr 2024 00:13:29 +0000
Subject: [PATCH] [Flang] responds to Clang Tidy feedback

Line 267: performance-unnecessary-copy-initialization
Line 592: readability-container-size-empty
---
 clang/lib/Driver/ToolChains/Flang.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp
index 2c83f70eb7887e..45d86c2f9b0ad4 100644
--- a/clang/lib/Driver/ToolChains/Flang.cpp
+++ b/clang/lib/Driver/ToolChains/Flang.cpp
@@ -264,7 +264,7 @@ static void addVSDefines(const ToolChain &TC, const ArgList &Args,
   CmdArgs.push_back(Args.MakeArgString("-D_MSC_FULL_VER=" + Twine(ver)));
   CmdArgs.push_back(Args.MakeArgString("-D_WIN32"));
 
-  llvm::Triple triple = TC.getTriple();
+  const llvm::Triple& triple = TC.getTriple();
   if (triple.isAArch64()) {
     CmdArgs.push_back("-D_M_ARM64=1");
   } else if (triple.isX86() && triple.isArch32Bit()) {
@@ -589,7 +589,7 @@ static void addFloatingPointOptions(const Driver &D, const ArgList &Args,
 
   if (!HonorINFs && !HonorNaNs && AssociativeMath && ReciprocalMath &&
       ApproxFunc && !SignedZeros &&
-      (FPContract == "fast" || FPContract == "")) {
+      (FPContract == "fast" || FPContract.empty())) {
     CmdArgs.push_back("-ffast-math");
     return;
   }



More information about the cfe-commits mailing list