[llvm-branch-commits] [llvm] [clang] [libcxx] [mlir] [lldb] [clang-tools-extra] [flang] [libc] [BOLT] Output YAML profile in BAT mode (PR #76910)

Amir Ayupov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jan 11 14:26:52 PST 2024


https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/76910

>From b9173e3769ce2fefe846b0b65cef61631af94008 Mon Sep 17 00:00:00 2001
From: Amir Ayupov <aaupov at fb.com>
Date: Thu, 4 Jan 2024 09:52:26 -0800
Subject: [PATCH] Fix SaveProfile definition issue

Created using spr 1.3.4
---
 bolt/lib/Rewrite/RewriteInstance.cpp | 4 +---
 bolt/lib/Utils/CommandLineOpts.cpp   | 4 ++++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index c6f38db17f093d..06f28195bb08dd 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -199,9 +199,7 @@ static cl::opt<cl::boolOrDefault> RelocationMode(
     "relocs", cl::desc("use relocations in the binary (default=autodetect)"),
     cl::cat(BoltCategory));
 
-cl::opt<std::string> SaveProfile("w",
-                                 cl::desc("save recorded profile to a file"),
-                                 cl::cat(BoltOutputCategory));
+extern cl::opt<std::string> SaveProfile;
 
 static cl::list<std::string>
 SkipFunctionNames("skip-funcs",
diff --git a/bolt/lib/Utils/CommandLineOpts.cpp b/bolt/lib/Utils/CommandLineOpts.cpp
index a1df5de2623402..4a980a67fca378 100644
--- a/bolt/lib/Utils/CommandLineOpts.cpp
+++ b/bolt/lib/Utils/CommandLineOpts.cpp
@@ -163,6 +163,10 @@ cl::opt<ProfileFormatKind> ProfileFormat(
                clEnumValN(PF_YAML, "yaml", "dense YAML representation")),
     cl::ZeroOrMore, cl::Hidden, cl::cat(BoltCategory));
 
+cl::opt<std::string> SaveProfile("w",
+                                 cl::desc("save recorded profile to a file"),
+                                 cl::cat(BoltOutputCategory));
+
 cl::opt<bool> SplitEH("split-eh", cl::desc("split C++ exception handling code"),
                       cl::Hidden, cl::cat(BoltOptCategory));
 



More information about the llvm-branch-commits mailing list