aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>2020-06-18 08:57:50 -0400
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>2020-06-18 09:17:14 -0400
commit89ea0b05207d45c145fb525df554b3b986ae379b (patch)
treeb7eb532a2dfdfb9453963471f595e34a02f9e74d /clang/lib/Frontend/CompilerInvocation.cpp
parent24eff42ba4b85eaa5429e8efe9bd2070d34ba1f7 (diff)
downloadllvm-89ea0b05207d45c145fb525df554b3b986ae379b.zip
llvm-89ea0b05207d45c145fb525df554b3b986ae379b.tar.gz
llvm-89ea0b05207d45c145fb525df554b3b986ae379b.tar.bz2
[MC] Pass down argv0 & cc1 cmd-line to the back-end and store in MCTargetOptions
When targetting CodeView, the goal is to store argv0 & cc1 cmd-line in the emitted .OBJ, in order to allow a reproducer from the .OBJ alone. This patch is to simplify https://reviews.llvm.org/D80833
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 4c05717..1af4153 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3627,7 +3627,8 @@ static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args,
bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
ArrayRef<const char *> CommandLineArgs,
- DiagnosticsEngine &Diags) {
+ DiagnosticsEngine &Diags,
+ const char *Argv0) {
bool Success = true;
// Parse the arguments.
@@ -3747,6 +3748,11 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
Res.getCodeGenOpts().FineGrainedBitfieldAccesses = false;
Diags.Report(diag::warn_drv_fine_grained_bitfield_accesses_ignored);
}
+
+ // Store the command-line for using in the CodeView backend.
+ Res.getCodeGenOpts().Argv0 = Argv0;
+ Res.getCodeGenOpts().CommandLineArgs = CommandLineArgs;
+
return Success;
}