diff options
author | peter klausler <pklausler@nvidia.com> | 2020-08-12 16:20:20 -0700 |
---|---|---|
committer | peter klausler <pklausler@nvidia.com> | 2020-08-13 09:00:48 -0700 |
commit | 51cfad3a1af6fcfba0b2fa2ef73c6860b4034e89 (patch) | |
tree | fd3aaab0960090923a81740129cd2aa57320ef7b /flang/lib/Parser/preprocessor.cpp | |
parent | f09a2244ba660c105331836a3ae8a1e229b34177 (diff) | |
download | llvm-51cfad3a1af6fcfba0b2fa2ef73c6860b4034e89.zip llvm-51cfad3a1af6fcfba0b2fa2ef73c6860b4034e89.tar.gz llvm-51cfad3a1af6fcfba0b2fa2ef73c6860b4034e89.tar.bz2 |
[flang] Ensure Preprocessor::Define saves macro names correctly
This fixes problems with macros defined with -D on the command line
and predefined macros defined in the throwaway driver program.
Diffstat (limited to 'flang/lib/Parser/preprocessor.cpp')
-rw-r--r-- | flang/lib/Parser/preprocessor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/flang/lib/Parser/preprocessor.cpp b/flang/lib/Parser/preprocessor.cpp index 9c10ced..a1f0796 100644 --- a/flang/lib/Parser/preprocessor.cpp +++ b/flang/lib/Parser/preprocessor.cpp @@ -212,7 +212,7 @@ Preprocessor::Preprocessor(AllSources &allSources) : allSources_{allSources} { } void Preprocessor::Define(std::string macro, std::string value) { - definitions_.emplace(macro, Definition{value, allSources_}); + definitions_.emplace(SaveTokenAsName(macro), Definition{value, allSources_}); } void Preprocessor::Undefine(std::string macro) { definitions_.erase(macro); } |