@@ -3526,6 +3526,9 @@ void CompilerInvocation::GenerateLangArgs(const LangOptions &Opts,
3526
3526
GenerateArg (Args, OPT_fexperimental_relative_cxx_abi_vtables, SA);
3527
3527
else
3528
3528
GenerateArg (Args, OPT_fno_experimental_relative_cxx_abi_vtables, SA);
3529
+
3530
+ for (const auto &MP : Opts.MacroPrefixMap )
3531
+ GenerateArg (Args, OPT_fmacro_prefix_map_EQ, MP.first + " =" + MP.second , SA);
3529
3532
}
3530
3533
3531
3534
bool CompilerInvocation::ParseLangArgs (LangOptions &Opts, ArgList &Args,
@@ -4036,6 +4039,12 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
4036
4039
options::OPT_fno_experimental_relative_cxx_abi_vtables,
4037
4040
TargetCXXABI::usesRelativeVTables (T));
4038
4041
4042
+ for (const auto &A : Args.getAllArgValues (OPT_fmacro_prefix_map_EQ)) {
4043
+ auto Split = StringRef (A).split (' =' );
4044
+ Opts.MacroPrefixMap .insert (
4045
+ {std::string (Split.first ), std::string (Split.second )});
4046
+ }
4047
+
4039
4048
return Diags.getNumErrors () == NumErrorsBefore;
4040
4049
}
4041
4050
@@ -4108,9 +4117,6 @@ static void GeneratePreprocessorArgs(PreprocessorOptions &Opts,
4108
4117
for (const auto &D : Opts.DeserializedPCHDeclsToErrorOn )
4109
4118
GenerateArg (Args, OPT_error_on_deserialized_pch_decl, D, SA);
4110
4119
4111
- for (const auto &MP : Opts.MacroPrefixMap )
4112
- GenerateArg (Args, OPT_fmacro_prefix_map_EQ, MP.first + " =" + MP.second , SA);
4113
-
4114
4120
if (Opts.PrecompiledPreambleBytes != std::make_pair (0u , false ))
4115
4121
GenerateArg (Args, OPT_preamble_bytes_EQ,
4116
4122
Twine (Opts.PrecompiledPreambleBytes .first ) + " ," +
@@ -4179,12 +4185,6 @@ static bool ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args,
4179
4185
for (const auto *A : Args.filtered (OPT_error_on_deserialized_pch_decl))
4180
4186
Opts.DeserializedPCHDeclsToErrorOn .insert (A->getValue ());
4181
4187
4182
- for (const auto &A : Args.getAllArgValues (OPT_fmacro_prefix_map_EQ)) {
4183
- auto Split = StringRef (A).split (' =' );
4184
- Opts.MacroPrefixMap .insert (
4185
- {std::string (Split.first ), std::string (Split.second )});
4186
- }
4187
-
4188
4188
if (const Arg *A = Args.getLastArg (OPT_preamble_bytes_EQ)) {
4189
4189
StringRef Value (A->getValue ());
4190
4190
size_t Comma = Value.find (' ,' );
0 commit comments