[clang] b924c8c - [clang][LTO] Remove the use of `--` for arange option

Qiongsi Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 6 17:28:16 PDT 2022


Author: Qiongsi Wu
Date: 2022-10-06T20:27:55-04:00
New Revision: b924c8c71daaa1bb869c42d9afca2a09a9b94629

URL: https://github.com/llvm/llvm-project/commit/b924c8c71daaa1bb869c42d9afca2a09a9b94629
DIFF: https://github.com/llvm/llvm-project/commit/b924c8c71daaa1bb869c42d9afca2a09a9b94629.diff

LOG: [clang][LTO] Remove the use of `--` for arange option

https://reviews.llvm.org/D134668 removed all `--` (double dashes) when using `plugin-opt` to pass linker options and replaced them with `-`. https://reviews.llvm.org/D133092 was committed later but introduced an instance of `--`. This patch replaces the `--` with `-`.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D135400

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/CommonArgs.cpp
    clang/test/Driver/debug-options-aranges.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 7f20122722365..7d4efaa88405d 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -514,7 +514,7 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
   // the way out.
   if (Args.hasArg(options::OPT_gdwarf_aranges)) {
     CmdArgs.push_back(
-        Args.MakeArgString("--plugin-opt=-generate-arange-section"));
+        Args.MakeArgString("-plugin-opt=-generate-arange-section"));
   }
 
   // Try to pass driver level flags relevant to LTO code generation down to

diff  --git a/clang/test/Driver/debug-options-aranges.c b/clang/test/Driver/debug-options-aranges.c
index 4dc098b7d185c..984f0e2411775 100644
--- a/clang/test/Driver/debug-options-aranges.c
+++ b/clang/test/Driver/debug-options-aranges.c
@@ -3,4 +3,4 @@
 /// Check that the linker plugin will get -generate-arange-section.
 // RUN: %clang -### -g --target=x86_64-linux -flto      -gdwarf-aranges %s 2>&1 | FileCheck %s
 // RUN: %clang -### -g --target=x86_64-linux -flto=thin -gdwarf-aranges %s 2>&1 | FileCheck %s
-// CHECK: --plugin-opt=-generate-arange-section
+// CHECK: "-plugin-opt=-generate-arange-section"


        


More information about the cfe-commits mailing list