aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorTarun Prabhu <tarun@lanl.gov>2024-09-19 18:28:50 -0600
committerGitHub <noreply@github.com>2024-09-19 18:28:50 -0600
commitb3533a156da92262eb19429d8c12f53e87f5ccec (patch)
tree131dc53458260e1bcc5d52b0dfb03ddd0c467483 /flang/lib/Frontend/CompilerInvocation.cpp
parent594efd262519fb7508cfb44c7c65b608af1394cd (diff)
downloadllvm-b3533a156da92262eb19429d8c12f53e87f5ccec.zip
llvm-b3533a156da92262eb19429d8c12f53e87f5ccec.tar.gz
llvm-b3533a156da92262eb19429d8c12f53e87f5ccec.tar.bz2
[clang][flang][mlir] Support -frecord-command-line option (#102975)
Add support for the -frecord-command-line option that will produce the llvm.commandline metadata which will eventually be saved in the object file. This behavior is also supported in clang. Some refactoring of the code in flang to handle these command line options was carried out. The corresponding -grecord-command-line option which saves the command line in the debug information has not yet been enabled for flang.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 90c3275..8441c7d 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -348,6 +348,12 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts,
if (auto *a = args.getLastArg(clang::driver::options::OPT_save_temps_EQ))
opts.SaveTempsDir = a->getValue();
+ // -record-command-line option.
+ if (const llvm::opt::Arg *a =
+ args.getLastArg(clang::driver::options::OPT_record_command_line)) {
+ opts.RecordCommandLine = a->getValue();
+ }
+
// -mlink-builtin-bitcode
for (auto *a :
args.filtered(clang::driver::options::OPT_mlink_builtin_bitcode))