From 34667519dc199d58b4556cfdc4e3ecb04365e53e Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Mon, 17 Jun 2019 16:06:00 +0000 Subject: [Remarks] Extend -fsave-optimization-record to specify the format Use -fsave-optimization-record= to specify a different format than the default, which is YAML. For now, only YAML is supported. llvm-svn: 363573 --- llvm/tools/opt/opt.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'llvm/tools/opt/opt.cpp') diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index dde1d776fef..ccf8b073b82 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -273,6 +273,11 @@ static cl::opt "names match the given regular expression"), cl::value_desc("regex")); +static cl::opt RemarksFormat( + "pass-remarks-format", + cl::desc("The format used for serializing remarks (default: YAML)"), + cl::value_desc("format"), cl::init("yaml")); + cl::opt PGOKindFlag("pgo-kind", cl::init(NoPGO), cl::Hidden, cl::desc("The kind of profile guided optimization"), @@ -552,7 +557,8 @@ int main(int argc, char **argv) { Expected> RemarksFileOrErr = setupOptimizationRemarks(Context, RemarksFilename, RemarksPasses, - RemarksWithHotness, RemarksHotnessThreshold); + RemarksFormat, RemarksWithHotness, + RemarksHotnessThreshold); if (Error E = RemarksFileOrErr.takeError()) { errs() << toString(std::move(E)) << '\n'; return 1; -- cgit v1.2.3