diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2023-10-27 16:32:09 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2023-10-27 16:52:21 +0800 |
commit | e9a7876c2c81423f2289aa85eeac32d7a55cd3c8 (patch) | |
tree | fa5dd840e41610739380d8462b70ec770bbe5068 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 75b0a99668cef7abaf36e09c41bb1eb91234bbf3 (diff) | |
download | llvm-e9a7876c2c81423f2289aa85eeac32d7a55cd3c8.zip llvm-e9a7876c2c81423f2289aa85eeac32d7a55cd3c8.tar.gz llvm-e9a7876c2c81423f2289aa85eeac32d7a55cd3c8.tar.bz2 |
[C++20] [Modules] Chose BMI from for module m with the last
-fmodule-file=<module-name>= option
Currently if we have multiple `-fmodule-file=<module-name>=<BMI-path>`
flags for the same `<module-name>`, we will pick the BMI-path from the
first flag. And this is inconsistent with what users generally expect.
e.g, we might expect the latter flags can override the former ones.
This patch changes the behavior to match user's expectation.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 4e6d7bb..fd6c250 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3163,8 +3163,8 @@ static bool ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args, StringRef Val = A->getValue(); if (Val.contains('=')) { auto Split = Val.split('='); - Opts.PrebuiltModuleFiles.insert( - {std::string(Split.first), std::string(Split.second)}); + Opts.PrebuiltModuleFiles.insert_or_assign( + std::string(Split.first), std::string(Split.second)); } } for (const auto *A : Args.filtered(OPT_fprebuilt_module_path)) |