aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-02-07 01:18:48 +0000
committerDouglas Gregor <dgregor@apple.com>2013-02-07 01:18:48 +0000
commit005d51bc4f16a7b330e13082d186b72953bde581 (patch)
treea3839d8720640f53afebe03e9308c2992d0eb732 /lib/Frontend/CompilerInstance.cpp
parentd46b7ec911ce1cb837397d5e12fe9928f63de6ab (diff)
Be a little more permissive with -fmodules-ignore-macro= by removing everything after the second '=' if it is there.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r--lib/Frontend/CompilerInstance.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 356bf3171c..0c5a1fa70a 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -754,13 +754,8 @@ namespace {
: HSOpts(HSOpts) { }
bool operator()(const std::pair<std::string, bool> &def) const {
- // Dig out the macro name.
- StringRef MacroName = def.first;
- StringRef::size_type EqPos = MacroName.find('=');
- if (EqPos != StringRef::npos)
- MacroName = MacroName.substr(0, EqPos);
-
- return HSOpts.ModulesIgnoreMacros.count(MacroName) > 0;
+ StringRef MacroDef = def.first;
+ return HSOpts.ModulesIgnoreMacros.count(MacroDef.split('=').first) > 0;
}
};
}