diff options
author | Dan McGregor <dan.mcgregor@usask.ca> | 2019-11-26 14:23:07 -0800 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-11-26 15:17:49 -0800 |
commit | 6c92cdff72251a7d13ab3958b04fba72dfcaebb1 (patch) | |
tree | 109f389b97c23284a0af76927c7f1650f1fb9787 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | e177c5a00da34ba61b762e2b32bd96e33b0c10b4 (diff) | |
download | bcm5719-llvm-6c92cdff72251a7d13ab3958b04fba72dfcaebb1.tar.gz bcm5719-llvm-6c92cdff72251a7d13ab3958b04fba72dfcaebb1.zip |
Initial implementation of -fmacro-prefix-map and -ffile-prefix-map
GCC 8 implements -fmacro-prefix-map. Like -fdebug-prefix-map, it replaces a string prefix for the __FILE__ macro.
-ffile-prefix-map is the union of -fdebug-prefix-map and -fmacro-prefix-map
Reviewed By: rnk, Lekensteyn, maskray
Differential Revision: https://reviews.llvm.org/D49466
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 080320cf608..56f66537557 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3315,6 +3315,9 @@ static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args, for (const auto *A : Args.filtered(OPT_error_on_deserialized_pch_decl)) Opts.DeserializedPCHDeclsToErrorOn.insert(A->getValue()); + for (const auto &A : Args.getAllArgValues(OPT_fmacro_prefix_map_EQ)) + Opts.MacroPrefixMap.insert(StringRef(A).split('=')); + if (const Arg *A = Args.getLastArg(OPT_preamble_bytes_EQ)) { StringRef Value(A->getValue()); size_t Comma = Value.find(','); |