diff options
author | Adrian Prantl <aprantl@apple.com> | 2020-07-21 16:03:56 -0700 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2020-07-21 16:23:36 -0700 |
commit | b907ad539a900279443dc8ef8816b6b5a76b1ea1 (patch) | |
tree | 462ee5f597a9cf274e2aea73b60c27a093c61e0e /clang/lib/Basic/Module.cpp | |
parent | bf6bc62d1f2d1850b6651fb61b070c30cf422e62 (diff) | |
download | llvm-b907ad539a900279443dc8ef8816b6b5a76b1ea1.zip llvm-b907ad539a900279443dc8ef8816b6b5a76b1ea1.tar.gz llvm-b907ad539a900279443dc8ef8816b6b5a76b1ea1.tar.bz2 |
[NFC] Clean up doc comment and implementation for Module::isSubModuleOf.
Patch by Varun Gandhi!
Differential Revision: https://reviews.llvm.org/D84087
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; } |