From: Jan Svoboda Date: Tue, 12 Oct 2021 07:55:40 +0000 (+0200) Subject: [clang][modules] Default `SourceLocation` parameter in `HeaderSearch::lookupModule` X-Git-Tag: upstream/15.0.7~28902 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1341a2c19e54cec77ccb35e3b4ee3924870b2e6a;p=platform%2Fupstream%2Fllvm.git [clang][modules] Default `SourceLocation` parameter in `HeaderSearch::lookupModule` This fixes an LLDB build failure where the `ImportLoc` argument is missing: https://lab.llvm.org/buildbot#builders/68/builds/19975 This change also makes it possible to drop `SourceLocation()` in `Preprocessor::getCurrentModule`. --- diff --git a/clang/include/clang/Lex/HeaderSearch.h b/clang/include/clang/Lex/HeaderSearch.h index 7b19e0d..372589d 100644 --- a/clang/include/clang/Lex/HeaderSearch.h +++ b/clang/include/clang/Lex/HeaderSearch.h @@ -570,7 +570,8 @@ public: /// in subdirectories. /// /// \returns The module with the given name. - Module *lookupModule(StringRef ModuleName, SourceLocation ImportLoc, + Module *lookupModule(StringRef ModuleName, + SourceLocation ImportLoc = SourceLocation(), bool AllowSearch = true, bool AllowExtraModuleMapSearch = false); diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 5aa831a..bf0b85e 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -518,8 +518,7 @@ Module *Preprocessor::getCurrentModule() { if (!getLangOpts().isCompilingModule()) return nullptr; - return getHeaderSearchInfo().lookupModule(getLangOpts().CurrentModule, - SourceLocation()); + return getHeaderSearchInfo().lookupModule(getLangOpts().CurrentModule); } //===----------------------------------------------------------------------===//