[PATCH] D134668: [LTO][clang] Using Single Dash Consistently when Passing LTO Options

Qiongsi Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 12:44:48 PDT 2022


qiongsiwu1 created this revision.
qiongsiwu1 added reviewers: w2yehia, MaskRay.
qiongsiwu1 added a project: clang.
Herald added subscribers: ormris, StephenFan, inglorion.
Herald added a project: All.
qiongsiwu1 requested review of this revision.
Herald added a subscriber: cfe-commits.

The following three static functions in `clang/lib/Driver/ToolChains/CommonArgs.cpp`

  static void renderRpassOptions(...)
  static void renderRemarksOptions(...)
  static void renderRemarksHotnessOptions(...)

uses `--plugin-opt` for the plugin option prefix, while the function `tools::addLTOOptions`  uses `-plugin-opt`. This patch makes sure that we only use `-plugin-opt` (single dash) everywhere. It is not clear to me that why we decided to use `--plugin-opt` in https://reviews.llvm.org/D85810. If using `--plugin-opt` is intended, I'd love to hear the reason and I will close this patch.

We intend to followup this patch with a few other patches that teaches `clang` to pass plugin options to the AIX linker, which uses a different prefix (`-bplugin_opt:`).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134668

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/test/Driver/opt-record.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134668.462995.patch
Type: text/x-patch
Size: 6219 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220926/599724ca/attachment-0001.bin>


More information about the cfe-commits mailing list