mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-26 05:18:46 +00:00
[lld] Add --lto-debug-pass-manager option
Add support for printing the passes run for LTO. Both ELF and COFF have `--lto-debug-pass-manager` (`-ltodebugpassmanager`) to print the compiler passes run during LTO. This is useful to check that a certain compiler pass is run in a test, e.g., https://reviews.llvm.org/D151589 Reviewed By: #lld-macho, MaskRay, int3 Differential Revision: https://reviews.llvm.org/D151746
This commit is contained in:
parent
1cf5188c72
commit
f92410429a
@ -205,6 +205,7 @@ struct Configuration {
|
||||
// so use a vector instead of a map.
|
||||
std::vector<SectionAlign> sectionAlignments;
|
||||
std::vector<SegmentProtection> segmentProtections;
|
||||
bool ltoDebugPassManager = false;
|
||||
|
||||
bool callGraphProfileSort = false;
|
||||
llvm::StringRef printSymbolOrder;
|
||||
|
@ -1636,6 +1636,7 @@ bool macho::link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
|
||||
for (const Arg *arg : args.filtered(OPT_ignore_auto_link_option))
|
||||
config->ignoreAutoLinkOptions.insert(arg->getValue());
|
||||
config->strictAutoLink = args.hasArg(OPT_strict_auto_link);
|
||||
config->ltoDebugPassManager = args.hasArg(OPT_lto_debug_pass_manager);
|
||||
|
||||
for (const Arg *arg : args.filtered(OPT_alias)) {
|
||||
config->aliasedSymbols.push_back(
|
||||
|
@ -68,6 +68,7 @@ static lto::Config createConfig() {
|
||||
|
||||
c.TimeTraceEnabled = config->timeTraceEnabled;
|
||||
c.TimeTraceGranularity = config->timeTraceGranularity;
|
||||
c.DebugPassManager = config->ltoDebugPassManager;
|
||||
c.OptLevel = config->ltoo;
|
||||
c.CGOptLevel = config->ltoCgo;
|
||||
if (config->saveTemps)
|
||||
|
@ -124,6 +124,8 @@ def strict_auto_link : Flag<["--"], "strict-auto-link">,
|
||||
def check_category_conflicts : Flag<["--"], "check-category-conflicts">,
|
||||
HelpText<"Check for conflicts between category & class methods">,
|
||||
Group<grp_lld>;
|
||||
def lto_debug_pass_manager: Flag<["--"], "lto-debug-pass-manager">,
|
||||
HelpText<"Debug new pass manager">, Group<grp_lld>;
|
||||
|
||||
// This is a complete Options.td compiled from Apple's ld(1) manpage
|
||||
// dated 2018-03-07 and cross checked with ld64 source code in repo
|
||||
|
14
lld/test/MachO/new-pass-manager.ll
Normal file
14
lld/test/MachO/new-pass-manager.ll
Normal file
@ -0,0 +1,14 @@
|
||||
; REQUIRES: x86
|
||||
|
||||
; RUN: llvm-as %s -o %t.o
|
||||
; RUN: %lld -dylib --lto-debug-pass-manager -o /dev/null %t.o 2>&1 | FileCheck %s
|
||||
|
||||
; CHECK: Running pass: GlobalOptPass
|
||||
|
||||
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-apple-darwin"
|
||||
|
||||
define void @foo() {
|
||||
entry:
|
||||
ret void
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user