Skip to content

Commit 8e4f405

Browse files
committed
[lld][MachO] Add --disable_verify flag
1 parent b326cb6 commit 8e4f405

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

lld/MachO/Config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ struct Configuration {
219219
llvm::StringRef csProfilePath;
220220
bool pgoWarnMismatch;
221221
bool warnThinArchiveMissingMembers;
222+
bool disableVerify;
222223

223224
bool callGraphProfileSort = false;
224225
llvm::StringRef printSymbolOrder;

lld/MachO/Driver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,7 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
18321832
args.hasFlag(OPT_warn_thin_archive_missing_members,
18331833
OPT_no_warn_thin_archive_missing_members, true);
18341834
config->generateUuid = !args.hasArg(OPT_no_uuid);
1835+
config->disableVerify = args.hasArg(OPT_disable_verify);
18351836

18361837
auto IncompatWithCGSort = [&](StringRef firstArgStr) {
18371838
// Throw an error only if --call-graph-profile-sort is explicitly specified

lld/MachO/LTO.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ static lto::Config createConfig() {
6060
c.CSIRProfile = std::string(config->csProfilePath);
6161
c.RunCSIRInstr = config->csProfileGenerate;
6262
c.PGOWarnMismatch = config->pgoWarnMismatch;
63+
c.DisableVerify = config->disableVerify;
6364
c.OptLevel = config->ltoo;
6465
c.CGOptLevel = config->ltoCgo;
6566
if (config->saveTemps)

lld/MachO/Options.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ def cs_profile_generate: Flag<["--"], "cs-profile-generate">,
197197
HelpText<"Perform context sensitive PGO instrumentation">, Group<grp_lld>;
198198
def cs_profile_path: Joined<["--"], "cs-profile-path=">,
199199
HelpText<"Context sensitive profile file path">, Group<grp_lld>;
200+
def disable_verify : Flag<["--"], "disable_verify">,
201+
HelpText<"Do not verify LLVM modules">,
202+
Group<grp_lld>;
200203
defm pgo_warn_mismatch: BB<"pgo-warn-mismatch",
201204
"turn on warnings about profile cfg mismatch (default)",
202205
"turn off warnings about profile cfg mismatch">, Group<grp_lld>;

lld/test/MachO/verify.ll

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; REQUIRES: x86
2+
3+
; RUN: llvm-as %s -o %t.o
4+
; RUN: %lld -dylib %t.o -o %t2 --lto-debug-pass-manager 2>&1 | FileCheck %s --check-prefix=VERIFY
5+
; RUN: %lld -dylib %t.o -o %t2 --lto-debug-pass-manager --disable_verify 2>&1 | FileCheck %s --implicit-check-not=VerifierPass
6+
7+
target triple = "x86_64-apple-darwin"
8+
target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
9+
10+
define void @_start() {
11+
entry:
12+
ret void
13+
}
14+
15+
; VERIFY: Running pass: VerifierPass
16+
; VERIFY: Running pass: VerifierPass

0 commit comments

Comments
 (0)