diff options
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r-- | clang/lib/Basic/Module.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index b3daaa3..b25248d 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -173,14 +173,10 @@ bool Module::isAvailable(const LangOptions &LangOpts, const TargetInfo &Target, } bool Module::isSubModuleOf(const Module *Other) const { - const Module *This = this; - do { - if (This == Other) + for (auto *Parent = this; Parent; Parent = Parent->Parent) { + if (Parent == Other) return true; - - This = This->Parent; - } while (This); - + } return false; } |