Skip to content

Commit da95d92

Browse files
authored
[clang][lex] Always pass suggested module to InclusionDirective() callback (#81061)
This patch provides more information to the `PPCallbacks::InclusionDirective()` hook. We now always pass the suggested module, regardless of whether it was actually imported or not. The extra `bool ModuleImported` parameter then denotes whether the header `#include` will be automatically translated into import the the module. The main change is in `clang/lib/Lex/PPDirectives.cpp`, where we take care to not modify `SuggestedModule` after it's been populated by `LookupHeaderIncludeOrImport()`. We now exclusively use the `SM` (`ModuleToImport`) variable instead, which has been equivalent to `SuggestedModule` until now. This allows us to use the original non-modified `SuggestedModule` for the callback itself. (This patch turns out to be necessary for swiftlang#8011).
1 parent 35fae04 commit da95d92

40 files changed

+168
-129
lines changed

clang-tools-extra/clang-move/Move.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ class FindAllIncludes : public PPCallbacks {
133133
CharSourceRange FilenameRange,
134134
OptionalFileEntryRef /*File*/, StringRef SearchPath,
135135
StringRef /*RelativePath*/,
136-
const Module * /*Imported*/,
136+
const Module * /*SuggestedModule*/,
137+
bool /*ModuleImported*/,
137138
SrcMgr::CharacteristicKind /*FileType*/) override {
138139
if (auto FileEntry = SM.getFileEntryRefForID(SM.getFileID(HashLoc)))
139140
MoveTool->addIncludes(FileName, IsAngled, SearchPath,

clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ void ExpandModularHeadersPPCallbacks::InclusionDirective(
166166
SourceLocation DirectiveLoc, const Token &IncludeToken,
167167
StringRef IncludedFilename, bool IsAngled, CharSourceRange FilenameRange,
168168
OptionalFileEntryRef IncludedFile, StringRef SearchPath,
169-
StringRef RelativePath, const Module *Imported,
169+
StringRef RelativePath, const Module *SuggestedModule, bool ModuleImported,
170170
SrcMgr::CharacteristicKind FileType) {
171-
if (Imported) {
171+
if (ModuleImported) {
172172
serialization::ModuleFile *MF =
173173
Compiler.getASTReader()->getModuleManager().lookup(
174-
*Imported->getASTFile());
174+
*SuggestedModule->getASTFile());
175175
handleModuleFile(MF);
176176
}
177177
parseToLocation(DirectiveLoc);

clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ExpandModularHeadersPPCallbacks : public PPCallbacks {
6969
bool IsAngled, CharSourceRange FilenameRange,
7070
OptionalFileEntryRef IncludedFile,
7171
StringRef SearchPath, StringRef RelativePath,
72-
const Module *Imported,
72+
const Module *SuggestedModule, bool ModuleImported,
7373
SrcMgr::CharacteristicKind FileType) override;
7474

7575
void EndOfMainFile() override;

clang-tools-extra/clang-tidy/altera/KernelNameRestrictionCheck.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class KernelNameRestrictionPPCallbacks : public PPCallbacks {
2929
StringRef FileName, bool IsAngled,
3030
CharSourceRange FileNameRange,
3131
OptionalFileEntryRef File, StringRef SearchPath,
32-
StringRef RelativePath, const Module *Imported,
32+
StringRef RelativePath, const Module *SuggestedModule,
33+
bool ModuleImported,
3334
SrcMgr::CharacteristicKind FileType) override;
3435

3536
void EndOfMainFile() override;
@@ -61,7 +62,7 @@ void KernelNameRestrictionCheck::registerPPCallbacks(const SourceManager &SM,
6162
void KernelNameRestrictionPPCallbacks::InclusionDirective(
6263
SourceLocation HashLoc, const Token &, StringRef FileName, bool,
6364
CharSourceRange, OptionalFileEntryRef, StringRef, StringRef, const Module *,
64-
SrcMgr::CharacteristicKind) {
65+
bool, SrcMgr::CharacteristicKind) {
6566
IncludeDirective ID = {HashLoc, FileName};
6667
IncludeDirectives.push_back(std::move(ID));
6768
}

clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class SuspiciousIncludePPCallbacks : public PPCallbacks {
2626
StringRef FileName, bool IsAngled,
2727
CharSourceRange FilenameRange,
2828
OptionalFileEntryRef File, StringRef SearchPath,
29-
StringRef RelativePath, const Module *Imported,
29+
StringRef RelativePath, const Module *SuggestedModule,
30+
bool ModuleImported,
3031
SrcMgr::CharacteristicKind FileType) override;
3132

3233
private:
@@ -51,8 +52,8 @@ void SuspiciousIncludeCheck::registerPPCallbacks(
5152
void SuspiciousIncludePPCallbacks::InclusionDirective(
5253
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
5354
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
54-
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
55-
SrcMgr::CharacteristicKind FileType) {
55+
StringRef SearchPath, StringRef RelativePath, const Module *SuggestedModule,
56+
bool ModuleImported, SrcMgr::CharacteristicKind FileType) {
5657
if (IncludeTok.getIdentifierInfo()->getPPKeywordID() == tok::pp_import)
5758
return;
5859

clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class IncludeOrderPPCallbacks : public PPCallbacks {
2727
StringRef FileName, bool IsAngled,
2828
CharSourceRange FilenameRange,
2929
OptionalFileEntryRef File, StringRef SearchPath,
30-
StringRef RelativePath, const Module *Imported,
30+
StringRef RelativePath, const Module *SuggestedModule,
31+
bool ModuleImported,
3132
SrcMgr::CharacteristicKind FileType) override;
3233
void EndOfMainFile() override;
3334

@@ -81,8 +82,8 @@ static int getPriority(StringRef Filename, bool IsAngled, bool IsMainModule) {
8182
void IncludeOrderPPCallbacks::InclusionDirective(
8283
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
8384
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
84-
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
85-
SrcMgr::CharacteristicKind FileType) {
85+
StringRef SearchPath, StringRef RelativePath, const Module *SuggestedModule,
86+
bool ModuleImported, SrcMgr::CharacteristicKind FileType) {
8687
// We recognize the first include as a special main module header and want
8788
// to leave it in the top position.
8889
IncludeDirective ID = {HashLoc, FilenameRange, std::string(FileName),

clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class RestrictedIncludesPPCallbacks
3333
StringRef FileName, bool IsAngled,
3434
CharSourceRange FilenameRange,
3535
OptionalFileEntryRef File, StringRef SearchPath,
36-
StringRef RelativePath, const Module *Imported,
36+
StringRef RelativePath, const Module *SuggestedModule,
37+
bool ModuleImported,
3738
SrcMgr::CharacteristicKind FileType) override;
3839

3940
private:
@@ -45,14 +46,14 @@ class RestrictedIncludesPPCallbacks
4546
void RestrictedIncludesPPCallbacks::InclusionDirective(
4647
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
4748
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
48-
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
49-
SrcMgr::CharacteristicKind FileType) {
49+
StringRef SearchPath, StringRef RelativePath, const Module *SuggestedModule,
50+
bool ModuleImported, SrcMgr::CharacteristicKind FileType) {
5051
// Compiler provided headers are allowed (e.g stddef.h).
5152
if (SrcMgr::isSystem(FileType) && SearchPath == CompilerIncudeDir)
5253
return;
5354
portability::RestrictedIncludesPPCallbacks::InclusionDirective(
5455
HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath,
55-
RelativePath, Imported, FileType);
56+
RelativePath, SuggestedModule, ModuleImported, FileType);
5657
}
5758

5859
void RestrictSystemLibcHeadersCheck::registerPPCallbacks(

clang-tools-extra/clang-tidy/misc/HeaderIncludeCycleCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class CyclicDependencyCallbacks : public PPCallbacks {
8383
void InclusionDirective(SourceLocation, const Token &, StringRef FilePath,
8484
bool, CharSourceRange Range,
8585
OptionalFileEntryRef File, StringRef, StringRef,
86-
const Module *,
86+
const Module *, bool,
8787
SrcMgr::CharacteristicKind FileType) override {
8888
if (FileType != clang::SrcMgr::C_User)
8989
return;

clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class IncludeModernizePPCallbacks : public PPCallbacks {
3232
StringRef FileName, bool IsAngled,
3333
CharSourceRange FilenameRange,
3434
OptionalFileEntryRef File, StringRef SearchPath,
35-
StringRef RelativePath, const Module *Imported,
35+
StringRef RelativePath, const Module *SuggestedModule,
36+
bool ModuleImported,
3637
SrcMgr::CharacteristicKind FileType) override;
3738

3839
private:
@@ -178,8 +179,8 @@ IncludeModernizePPCallbacks::IncludeModernizePPCallbacks(
178179
void IncludeModernizePPCallbacks::InclusionDirective(
179180
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
180181
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
181-
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
182-
SrcMgr::CharacteristicKind FileType) {
182+
StringRef SearchPath, StringRef RelativePath, const Module *SuggestedModule,
183+
bool ModuleImported, SrcMgr::CharacteristicKind FileType) {
183184

184185
// If we don't want to warn for non-main file reports and this is one, skip
185186
// it.

clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ class MacroToEnumCallbacks : public PPCallbacks {
117117
StringRef FileName, bool IsAngled,
118118
CharSourceRange FilenameRange,
119119
OptionalFileEntryRef File, StringRef SearchPath,
120-
StringRef RelativePath, const Module *Imported,
120+
StringRef RelativePath, const Module *SuggestedModule,
121+
bool ModuleImported,
121122
SrcMgr::CharacteristicKind FileType) override {
122123
clearCurrentEnum(HashLoc);
123124
}

clang-tools-extra/clang-tidy/portability/RestrictSystemIncludesCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ namespace clang::tidy::portability {
2121
void RestrictedIncludesPPCallbacks::InclusionDirective(
2222
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
2323
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
24-
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
25-
SrcMgr::CharacteristicKind FileType) {
24+
StringRef SearchPath, StringRef RelativePath, const Module *SuggestedModule,
25+
bool ModuleImported, SrcMgr::CharacteristicKind FileType) {
2626
if (!Check.contains(FileName) && SrcMgr::isSystem(FileType)) {
2727
SmallString<256> FullPath;
2828
llvm::sys::path::append(FullPath, SearchPath);

clang-tools-extra/clang-tidy/portability/RestrictSystemIncludesCheck.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class RestrictedIncludesPPCallbacks : public PPCallbacks {
5050
StringRef FileName, bool IsAngled,
5151
CharSourceRange FilenameRange,
5252
OptionalFileEntryRef File, StringRef SearchPath,
53-
StringRef RelativePath, const Module *Imported,
53+
StringRef RelativePath, const Module *SuggestedModule,
54+
bool ModuleImported,
5455
SrcMgr::CharacteristicKind FileType) override;
5556
void EndOfMainFile() override;
5657

clang-tools-extra/clang-tidy/readability/DuplicateIncludeCheck.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ class DuplicateIncludeCallbacks : public PPCallbacks {
4747
StringRef FileName, bool IsAngled,
4848
CharSourceRange FilenameRange,
4949
OptionalFileEntryRef File, StringRef SearchPath,
50-
StringRef RelativePath, const Module *Imported,
50+
StringRef RelativePath, const Module *SuggestedModule,
51+
bool ModuleImported,
5152
SrcMgr::CharacteristicKind FileType) override;
5253

5354
void MacroDefined(const Token &MacroNameTok,
@@ -76,8 +77,8 @@ void DuplicateIncludeCallbacks::FileChanged(SourceLocation Loc,
7677
void DuplicateIncludeCallbacks::InclusionDirective(
7778
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
7879
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
79-
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
80-
SrcMgr::CharacteristicKind FileType) {
80+
StringRef SearchPath, StringRef RelativePath, const Module *SuggestedModule,
81+
bool ModuleImported, SrcMgr::CharacteristicKind FileType) {
8182
if (llvm::is_contained(Files.back(), FileName)) {
8283
// We want to delete the entire line, so make sure that [Start,End] covers
8384
// everything.

clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class IncludeInserterCallback : public PPCallbacks {
2525
bool IsAngled, CharSourceRange FileNameRange,
2626
OptionalFileEntryRef /*IncludedFile*/,
2727
StringRef /*SearchPath*/, StringRef /*RelativePath*/,
28-
const Module * /*ImportedModule*/,
28+
const Module * /*SuggestedModule*/,
29+
bool /*ModuleImported*/,
2930
SrcMgr::CharacteristicKind /*FileType*/) override {
3031
Inserter->addInclude(FileNameRef, IsAngled, HashLocation,
3132
IncludeToken.getEndLoc());

clang-tools-extra/clangd/Headers.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class IncludeStructure::RecordHeaders : public PPCallbacks {
4141
OptionalFileEntryRef File,
4242
llvm::StringRef /*SearchPath*/,
4343
llvm::StringRef /*RelativePath*/,
44-
const clang::Module * /*Imported*/,
44+
const clang::Module * /*SuggestedModule*/,
45+
bool /*ModuleImported*/,
4546
SrcMgr::CharacteristicKind FileKind) override {
4647
auto MainFID = SM.getMainFileID();
4748
// If an include is part of the preamble patch, translate #line directives.

clang-tools-extra/clangd/ParsedAST.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class ReplayPreamble : private PPCallbacks {
244244
SynthesizedFilenameTok.getEndLoc())
245245
.toCharRange(SM),
246246
File, "SearchPath", "RelPath",
247-
/*Imported=*/nullptr, Inc.FileKind);
247+
/*SuggestedModule=*/nullptr, /*ModuleImported=*/false, Inc.FileKind);
248248
if (File)
249249
Delegate->FileSkipped(*File, SynthesizedFilenameTok, Inc.FileKind);
250250
}

clang-tools-extra/clangd/index/IndexAction.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ struct IncludeGraphCollector : public PPCallbacks {
8989
llvm::StringRef FileName, bool IsAngled,
9090
CharSourceRange FilenameRange,
9191
OptionalFileEntryRef File, llvm::StringRef SearchPath,
92-
llvm::StringRef RelativePath, const Module *Imported,
92+
llvm::StringRef RelativePath,
93+
const Module *SuggestedModule, bool ModuleImported,
9394
SrcMgr::CharacteristicKind FileType) override {
9495
auto IncludeURI = toURI(File);
9596
if (!IncludeURI)

clang-tools-extra/clangd/unittests/ReplayPeambleTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct ReplayPreamblePPCallback : public PPCallbacks {
7272
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
7373
StringRef FileName, bool IsAngled,
7474
CharSourceRange FilenameRange, OptionalFileEntryRef,
75-
StringRef, StringRef, const clang::Module *,
75+
StringRef, StringRef, const clang::Module *, bool,
7676
SrcMgr::CharacteristicKind) override {
7777
Includes.emplace_back(SM, HashLoc, IncludeTok, FileName, IsAngled,
7878
FilenameRange);

clang-tools-extra/include-cleaner/lib/Record.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ class PPRecorder : public PPCallbacks {
6565
StringRef SpelledFilename, bool IsAngled,
6666
CharSourceRange FilenameRange,
6767
OptionalFileEntryRef File, StringRef SearchPath,
68-
StringRef RelativePath, const Module *,
68+
StringRef RelativePath, const Module *SuggestedModule,
69+
bool ModuleImported,
6970
SrcMgr::CharacteristicKind) override {
7071
if (!Active)
7172
return;
@@ -214,7 +215,8 @@ class PragmaIncludes::RecordPragma : public PPCallbacks, public CommentHandler {
214215
OptionalFileEntryRef File,
215216
llvm::StringRef /*SearchPath*/,
216217
llvm::StringRef /*RelativePath*/,
217-
const clang::Module * /*Imported*/,
218+
const clang::Module * /*SuggestedModule*/,
219+
bool /*ModuleImported*/,
218220
SrcMgr::CharacteristicKind FileKind) override {
219221
FileID HashFID = SM.getFileID(HashLoc);
220222
int HashLine = SM.getLineNumber(HashFID, SM.getFileOffset(HashLoc));

clang-tools-extra/modularize/CoverageChecker.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ class CoverageCheckerCallbacks : public PPCallbacks {
9090
StringRef FileName, bool IsAngled,
9191
CharSourceRange FilenameRange,
9292
OptionalFileEntryRef File, StringRef SearchPath,
93-
StringRef RelativePath, const Module *Imported,
93+
StringRef RelativePath, const Module *SuggestedModule,
94+
bool ModuleImported,
9495
SrcMgr::CharacteristicKind FileType) override {
9596
Checker.collectUmbrellaHeaderHeader(File->getName());
9697
}

clang-tools-extra/modularize/PreprocessorTracker.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -730,15 +730,14 @@ class PreprocessorCallbacks : public clang::PPCallbacks {
730730
~PreprocessorCallbacks() override {}
731731

732732
// Overridden handlers.
733-
void InclusionDirective(clang::SourceLocation HashLoc,
734-
const clang::Token &IncludeTok,
735-
llvm::StringRef FileName, bool IsAngled,
736-
clang::CharSourceRange FilenameRange,
737-
clang::OptionalFileEntryRef File,
738-
llvm::StringRef SearchPath,
739-
llvm::StringRef RelativePath,
740-
const clang::Module *Imported,
741-
clang::SrcMgr::CharacteristicKind FileType) override;
733+
void
734+
InclusionDirective(clang::SourceLocation HashLoc,
735+
const clang::Token &IncludeTok, llvm::StringRef FileName,
736+
bool IsAngled, clang::CharSourceRange FilenameRange,
737+
clang::OptionalFileEntryRef File,
738+
llvm::StringRef SearchPath, llvm::StringRef RelativePath,
739+
const clang::Module *SuggestedModule, bool ModuleImported,
740+
clang::SrcMgr::CharacteristicKind FileType) override;
742741
void FileChanged(clang::SourceLocation Loc,
743742
clang::PPCallbacks::FileChangeReason Reason,
744743
clang::SrcMgr::CharacteristicKind FileType,
@@ -1275,7 +1274,8 @@ void PreprocessorCallbacks::InclusionDirective(
12751274
llvm::StringRef FileName, bool IsAngled,
12761275
clang::CharSourceRange FilenameRange, clang::OptionalFileEntryRef File,
12771276
llvm::StringRef SearchPath, llvm::StringRef RelativePath,
1278-
const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) {
1277+
const clang::Module *SuggestedModule, bool ModuleImported,
1278+
clang::SrcMgr::CharacteristicKind FileType) {
12791279
int DirectiveLine, DirectiveColumn;
12801280
std::string HeaderPath = getSourceLocationFile(PP, HashLoc);
12811281
getSourceLocationLineAndColumn(PP, HashLoc, DirectiveLine, DirectiveColumn);

clang-tools-extra/pp-trace/PPCallbacksTracker.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ void PPCallbacksTracker::InclusionDirective(
135135
SourceLocation HashLoc, const Token &IncludeTok, llvm::StringRef FileName,
136136
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
137137
llvm::StringRef SearchPath, llvm::StringRef RelativePath,
138-
const Module *Imported, SrcMgr::CharacteristicKind FileType) {
138+
const Module *SuggestedModule, bool ModuleImported,
139+
SrcMgr::CharacteristicKind FileType) {
139140
beginCallback("InclusionDirective");
140141
appendArgument("HashLoc", HashLoc);
141142
appendArgument("IncludeTok", IncludeTok);
@@ -145,7 +146,8 @@ void PPCallbacksTracker::InclusionDirective(
145146
appendArgument("File", File);
146147
appendFilePathArgument("SearchPath", SearchPath);
147148
appendFilePathArgument("RelativePath", RelativePath);
148-
appendArgument("Imported", Imported);
149+
appendArgument("SuggestedModule", SuggestedModule);
150+
appendArgument("ModuleImported", ModuleImported);
149151
}
150152

151153
// Callback invoked whenever there was an explicit module-import

clang-tools-extra/pp-trace/PPCallbacksTracker.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ class PPCallbacksTracker : public PPCallbacks {
9595
llvm::StringRef FileName, bool IsAngled,
9696
CharSourceRange FilenameRange,
9797
OptionalFileEntryRef File, llvm::StringRef SearchPath,
98-
llvm::StringRef RelativePath, const Module *Imported,
98+
llvm::StringRef RelativePath,
99+
const Module *SuggestedModule, bool ModuleImported,
99100
SrcMgr::CharacteristicKind FileType) override;
100101
void moduleImport(SourceLocation ImportLoc, ModuleIdPath Path,
101102
const Module *Imported) override;

0 commit comments

Comments
 (0)