diff options
author | Douglas Gregor <dgregor@apple.com> | 2013-02-07 01:18:48 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2013-02-07 01:18:48 +0000 |
commit | 2236c20f5a5a5ae4dda7cf6bcf51f3644a221915 (patch) | |
tree | 5724368f3b3cda7c6d77e65358b114fb86cc5c18 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 1ef75e55b9402e1ac5e105fc0299a01eba09304b (diff) | |
download | llvm-2236c20f5a5a5ae4dda7cf6bcf51f3644a221915.zip llvm-2236c20f5a5a5ae4dda7cf6bcf51f3644a221915.tar.gz llvm-2236c20f5a5a5ae4dda7cf6bcf51f3644a221915.tar.bz2 |
Be a little more permissive with -fmodules-ignore-macro= by removing everything after the second '=' if it is there.
llvm-svn: 174567
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 34496ed..0e313a9 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -816,8 +816,8 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) { for (arg_iterator it = Args.filtered_begin(OPT_fmodules_ignore_macro), ie = Args.filtered_end(); it != ie; ++it) { - const Arg *A = *it; - Opts.ModulesIgnoreMacros.insert(A->getValue()); + StringRef MacroDef = (*it)->getValue(); + Opts.ModulesIgnoreMacros.insert(MacroDef.split('=').first); } // Add -I..., -F..., and -index-header-map options in order. @@ -1617,14 +1617,9 @@ std::string CompilerInvocation::getModuleHash() const { // If we're supposed to ignore this macro for the purposes of modules, // don't put it into the hash. if (!hsOpts.ModulesIgnoreMacros.empty()) { - // Dig out the macro name. - StringRef MacroName = I->first; - StringRef::size_type EqPos = MacroName.find('='); - if (EqPos != StringRef::npos) - MacroName = MacroName.substr(0, EqPos); - // Check whether we're ignoring this macro. - if (hsOpts.ModulesIgnoreMacros.count(MacroName)) + StringRef MacroDef = I->first; + if (hsOpts.ModulesIgnoreMacros.count(MacroDef.split('=').first)) continue; } |