aboutsummaryrefslogtreecommitdiff
path: root/lld/MinGW
diff options
context:
space:
mode:
authorchrulski-intel <christopher.m.chrulski@intel.com>2024-03-21 06:34:01 -0700
committerGitHub <noreply@github.com>2024-03-21 21:34:01 +0800
commit276283d8641f13b6ecde736ab1a8720f742d9d02 (patch)
tree98b57efda78d74de65e30d726e939097da68f9e0 /lld/MinGW
parent0aa6d57e575dd920db81bef7ff509c4d3a9c6891 (diff)
downloadllvm-276283d8641f13b6ecde736ab1a8720f742d9d02.zip
llvm-276283d8641f13b6ecde736ab1a8720f742d9d02.tar.gz
llvm-276283d8641f13b6ecde736ab1a8720f742d9d02.tar.bz2
[LLD] [MinGW] Implement the -lto-sample-profile option (#85841)
This has been a supported option for ELF and is added to the COFF Linker in #85701
Diffstat (limited to 'lld/MinGW')
-rw-r--r--lld/MinGW/Driver.cpp2
-rw-r--r--lld/MinGW/Options.td2
2 files changed, 4 insertions, 0 deletions
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp
index efd643f..bb08c77 100644
--- a/lld/MinGW/Driver.cpp
+++ b/lld/MinGW/Driver.cpp
@@ -455,6 +455,8 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
add("-lldemit:llvm");
if (args.hasArg(OPT_lto_emit_asm))
add("-lldemit:asm");
+ if (auto *arg = args.getLastArg(OPT_lto_sample_profile))
+ add("-lto-sample-profile:" + StringRef(arg->getValue()));
if (auto *a = args.getLastArg(OPT_thinlto_cache_dir))
add("-lldltocache:" + StringRef(a->getValue()));
diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td
index 9a0a96a..56f67e3 100644
--- a/lld/MinGW/Options.td
+++ b/lld/MinGW/Options.td
@@ -160,6 +160,8 @@ def lto_cs_profile_file: JJ<"lto-cs-profile-file=">,
HelpText<"Context sensitive profile file path">;
def lto_emit_asm: FF<"lto-emit-asm">,
HelpText<"Emit assembly code">;
+def lto_sample_profile: JJ<"lto-sample-profile=">,
+ HelpText<"Sample profile file path">;
def thinlto_cache_dir: JJ<"thinlto-cache-dir=">,
HelpText<"Path to ThinLTO cached object file directory">;