Skip to content

Commit 6c92ecd

Browse files
committed
Fix formatting and a compile error
1 parent e2dfe9e commit 6c92ecd

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

clang/lib/Frontend/HeaderIncludeGen.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,17 @@ class HeaderIncludesDirectPerFileCallback : public PPCallbacks {
117117
FileEntryRef File;
118118
const Module *ImportedModule;
119119

120-
HeaderIncludeInfo(SourceLocation Location, FileEntryRef File, const Module *ImportedModule)
120+
HeaderIncludeInfo(SourceLocation Location, FileEntryRef File,
121+
const Module *ImportedModule)
121122
: Location(Location), File(File), ImportedModule(ImportedModule) {}
122123
};
123124

124125
SourceManager &SM;
125126
HeaderSearch &HSI;
126127
raw_ostream *OutputFile;
127128
bool OwnsOutputFile;
128-
using DependencyMap = llvm::DenseMap<FileEntryRef, SmallVector<HeaderIncludeInfo>>;
129+
using DependencyMap =
130+
llvm::DenseMap<FileEntryRef, SmallVector<HeaderIncludeInfo>>;
129131
DependencyMap Dependencies;
130132

131133
public:
@@ -304,8 +306,8 @@ void HeaderIncludesCallback::FileChanged(SourceLocation Loc,
304306
}
305307
}
306308

307-
void HeaderIncludesCallback::FileSkipped(const FileEntryRef &SkippedFile, const
308-
Token &FilenameTok,
309+
void HeaderIncludesCallback::FileSkipped(const FileEntryRef &SkippedFile,
310+
const Token &FilenameTok,
309311
SrcMgr::CharacteristicKind FileType) {
310312
if (!DepOpts.ShowSkippedHeaderIncludes)
311313
return;
@@ -421,7 +423,9 @@ void HeaderIncludesDirectPerFileCallback::EndOfMainFile() {
421423
if (Deps[I].ImportedModule) {
422424
JOS.object([&] {
423425
JOS.attribute("location", Deps[I].Location.printToString(SM));
424-
JOS.attribute("module", Deps[I].ImportedModule->getTopLevelModuleName());
426+
JOS.attribute(
427+
"module",
428+
Deps[I].ImportedModule->getTopLevelModuleName());
425429
JOS.attribute("file", Deps[I].File.getName());
426430
});
427431
}
@@ -431,7 +435,7 @@ void HeaderIncludesDirectPerFileCallback::EndOfMainFile() {
431435
}
432436
});
433437
});
434-
438+
435439
OS << "\n";
436440

437441
if (OutputFile->get_kind() == raw_ostream::OStreamKind::OK_FDStream) {
@@ -459,13 +463,15 @@ void HeaderIncludesDirectPerFileCallback::InclusionDirective(
459463

460464
FileEntryRef HeaderOrModuleMapFile = *File;
461465
if (ModuleImported && SuggestedModule) {
462-
OptionalFileEntryRef ModuleMapFile = HSI.getModuleMap().getModuleMapFileForUniquing(SuggestedModule);
466+
OptionalFileEntryRef ModuleMapFile =
467+
HSI.getModuleMap().getModuleMapFileForUniquing(SuggestedModule);
463468
if (ModuleMapFile) {
464-
HeaderOrModule = *ModuleMapFile;
469+
HeaderOrModuleMapFile = *ModuleMapFile;
465470
}
466471
}
467472

468-
HeaderIncludeInfo DependenciesEntry(Loc, HeaderOrModule, (ModuleImported ? SuggestedModule : nullptr));
473+
HeaderIncludeInfo DependenciesEntry(
474+
Loc, HeaderOrModuleMapFile, (ModuleImported ? SuggestedModule : nullptr));
469475
Dependencies[*FromFile].push_back(DependenciesEntry);
470476
}
471477

0 commit comments

Comments
 (0)