[PATCH] D121969: Pass split-machine-functions to code generator when flto is used

Hongtao Yu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 21 21:01:02 PDT 2022


hoy added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:577
 
+  if (Args.hasArg(options::OPT_fsplit_machine_functions)) {
+    CmdArgs.push_back("-plugin-opt=-split-machine-functions");
----------------
Should also check `OPT_fno_split_machine_functions`, i.e, 

    if (Args.getLastArg(options::OPT_fsplit_machine_functions,
                               options::OPT_fno_split_machine_functions))


================
Comment at: clang/test/Driver/fsplit-machine-functions2.c:5
+// Test no pass-through to ld without lto
+// RUN: %clang -### -target x86_64-unknown-linux -fsplit-machine-functions %s 2>&1 | FileCheck %s -check-prefix=CHECK-NOPASS
+
----------------
Please add a test case for mixed `-fsplit-machine-functions` and `-fno-split-machine-functions`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121969/new/

https://reviews.llvm.org/D121969



More information about the cfe-commits mailing list