From 1341a2c19e54cec77ccb35e3b4ee3924870b2e6a Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 12 Oct 2021 09:55:40 +0200 Subject: [PATCH] [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`. --- clang/include/clang/Lex/HeaderSearch.h | 3 ++- clang/lib/Lex/Preprocessor.cpp | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) 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); } //===----------------------------------------------------------------------===// -- 2.7.4