diff options
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/llvm-cgdata/Opts.td | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-cgdata/llvm-cgdata.cpp | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/llvm/tools/llvm-cgdata/Opts.td b/llvm/tools/llvm-cgdata/Opts.td index b2cfc6a..8da933f 100644 --- a/llvm/tools/llvm-cgdata/Opts.td +++ b/llvm/tools/llvm-cgdata/Opts.td @@ -24,6 +24,7 @@ def : F<"m", "Alias for --merge">, Alias<merge>, Group<action_group>; // Additional options def cgdata_version : FF<"cgdata-version", "Display the cgdata version">; +def skip_trim : FF<"skip-trim", "Skip trimming content when merging the cgdata">; def output : Option<["--"], "output", KIND_SEPARATE>, HelpText<"Specify the name for the output file to be created">, MetaVarName<"<file>">; def : JoinedOrSeparate<["-"], "o">, Alias<output>, MetaVarName<"<file>">, HelpText<"Alias for --output">; diff --git a/llvm/tools/llvm-cgdata/llvm-cgdata.cpp b/llvm/tools/llvm-cgdata/llvm-cgdata.cpp index 0931cad..d33459b 100644 --- a/llvm/tools/llvm-cgdata/llvm-cgdata.cpp +++ b/llvm/tools/llvm-cgdata/llvm-cgdata.cpp @@ -76,6 +76,7 @@ static StringRef ToolName; static StringRef OutputFilename = "-"; static StringRef Filename; static bool ShowCGDataVersion; +static bool SkipTrim; static CGDataAction Action; static std::optional<CGDataFormat> OutputFormat; static std::vector<std::string> InputFilenames; @@ -214,7 +215,7 @@ static int merge_main(int argc, const char *argv[]) { if (!Result) exitWithError("failed to merge codegen data files."); - GlobalFunctionMapRecord.finalize(); + GlobalFunctionMapRecord.finalize(SkipTrim); CodeGenDataWriter Writer; if (!GlobalOutlineRecord.empty()) @@ -301,6 +302,7 @@ static void parseArgs(int argc, char **argv) { } ShowCGDataVersion = Args.hasArg(OPT_cgdata_version); + SkipTrim = Args.hasArg(OPT_skip_trim); if (opt::Arg *A = Args.getLastArg(OPT_format)) { StringRef OF = A->getValue(); |