Skip to content

Commit 854c10f

Browse files
committed
[Clang] Prepare for llvm::Optional becoming std::optional.
The needed tweaks are mostly trivial, the one nasty bit is Clang's usage of OptionalStorage. To keep this working old Optional stays around as clang::CustomizableOptional, with the default Storage removed. Optional<File/DirectoryEntryRef> is replaced with a typedef. I tested this with GCC 7.5, the oldest supported GCC I had around. Differential Revision: https://reviews.llvm.org/D140332
1 parent eddb728 commit 854c10f

File tree

80 files changed

+541
-306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+541
-306
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class FindAllIncludes : public PPCallbacks {
131131
void InclusionDirective(SourceLocation HashLoc, const Token & /*IncludeTok*/,
132132
StringRef FileName, bool IsAngled,
133133
CharSourceRange FilenameRange,
134-
Optional<FileEntryRef> /*File*/, StringRef SearchPath,
134+
OptionalFileEntryRef /*File*/, StringRef SearchPath,
135135
StringRef /*RelativePath*/,
136136
const Module * /*Imported*/,
137137
SrcMgr::CharacteristicKind /*FileType*/) override {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void ExpandModularHeadersPPCallbacks::FileChanged(
162162
void ExpandModularHeadersPPCallbacks::InclusionDirective(
163163
SourceLocation DirectiveLoc, const Token &IncludeToken,
164164
StringRef IncludedFilename, bool IsAngled, CharSourceRange FilenameRange,
165-
Optional<FileEntryRef> IncludedFile, StringRef SearchPath,
165+
OptionalFileEntryRef IncludedFile, StringRef SearchPath,
166166
StringRef RelativePath, const Module *Imported,
167167
SrcMgr::CharacteristicKind FileType) {
168168
if (Imported) {
@@ -224,7 +224,7 @@ void ExpandModularHeadersPPCallbacks::PragmaDiagnostic(SourceLocation Loc,
224224
parseToLocation(Loc);
225225
}
226226
void ExpandModularHeadersPPCallbacks::HasInclude(SourceLocation Loc, StringRef,
227-
bool, Optional<FileEntryRef>,
227+
bool, OptionalFileEntryRef,
228228
SrcMgr::CharacteristicKind) {
229229
parseToLocation(Loc);
230230
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ExpandModularHeadersPPCallbacks : public PPCallbacks {
6969
void InclusionDirective(SourceLocation DirectiveLoc,
7070
const Token &IncludeToken, StringRef IncludedFilename,
7171
bool IsAngled, CharSourceRange FilenameRange,
72-
Optional<FileEntryRef> IncludedFile,
72+
OptionalFileEntryRef IncludedFile,
7373
StringRef SearchPath, StringRef RelativePath,
7474
const Module *Imported,
7575
SrcMgr::CharacteristicKind FileType) override;
@@ -91,7 +91,7 @@ class ExpandModularHeadersPPCallbacks : public PPCallbacks {
9191
void PragmaDiagnosticPop(SourceLocation Loc, StringRef) override;
9292
void PragmaDiagnostic(SourceLocation Loc, StringRef, diag::Severity,
9393
StringRef) override;
94-
void HasInclude(SourceLocation Loc, StringRef, bool, Optional<FileEntryRef> ,
94+
void HasInclude(SourceLocation Loc, StringRef, bool, OptionalFileEntryRef,
9595
SrcMgr::CharacteristicKind) override;
9696
void PragmaOpenCLExtension(SourceLocation NameLoc, const IdentifierInfo *,
9797
SourceLocation StateLoc, unsigned) override;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class KernelNameRestrictionPPCallbacks : public PPCallbacks {
3030
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
3131
StringRef FileName, bool IsAngled,
3232
CharSourceRange FileNameRange,
33-
Optional<FileEntryRef> File, StringRef SearchPath,
33+
OptionalFileEntryRef File, StringRef SearchPath,
3434
StringRef RelativePath, const Module *Imported,
3535
SrcMgr::CharacteristicKind FileType) override;
3636

@@ -62,8 +62,8 @@ void KernelNameRestrictionCheck::registerPPCallbacks(const SourceManager &SM,
6262

6363
void KernelNameRestrictionPPCallbacks::InclusionDirective(
6464
SourceLocation HashLoc, const Token &, StringRef FileName, bool,
65-
CharSourceRange, Optional<FileEntryRef>, StringRef, StringRef,
66-
const Module *, SrcMgr::CharacteristicKind) {
65+
CharSourceRange, OptionalFileEntryRef, StringRef, StringRef, const Module *,
66+
SrcMgr::CharacteristicKind) {
6767
IncludeDirective ID = {HashLoc, FileName};
6868
IncludeDirectives.push_back(std::move(ID));
6969
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class SuspiciousIncludePPCallbacks : public PPCallbacks {
2525
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
2626
StringRef FileName, bool IsAngled,
2727
CharSourceRange FilenameRange,
28-
Optional<FileEntryRef> File, StringRef SearchPath,
28+
OptionalFileEntryRef File, StringRef SearchPath,
2929
StringRef RelativePath, const Module *Imported,
3030
SrcMgr::CharacteristicKind FileType) override;
3131

@@ -72,7 +72,7 @@ void SuspiciousIncludeCheck::registerPPCallbacks(
7272

7373
void SuspiciousIncludePPCallbacks::InclusionDirective(
7474
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
75-
bool IsAngled, CharSourceRange FilenameRange, Optional<FileEntryRef> File,
75+
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
7676
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
7777
SrcMgr::CharacteristicKind FileType) {
7878
if (IncludeTok.getIdentifierInfo()->getPPKeywordID() == tok::pp_import)
@@ -93,7 +93,7 @@ void SuspiciousIncludePPCallbacks::InclusionDirective(
9393
llvm::sys::path::replace_extension(GuessedFileName,
9494
(HFE.size() ? "." : "") + HFE);
9595

96-
Optional<FileEntryRef> File =
96+
OptionalFileEntryRef File =
9797
PP->LookupFile(DiagLoc, GuessedFileName, IsAngled, nullptr, nullptr,
9898
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
9999
if (File) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class IncludeOrderPPCallbacks : public PPCallbacks {
2828
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
2929
StringRef FileName, bool IsAngled,
3030
CharSourceRange FilenameRange,
31-
Optional<FileEntryRef> File, StringRef SearchPath,
31+
OptionalFileEntryRef File, StringRef SearchPath,
3232
StringRef RelativePath, const Module *Imported,
3333
SrcMgr::CharacteristicKind FileType) override;
3434
void EndOfMainFile() override;
@@ -82,7 +82,7 @@ static int getPriority(StringRef Filename, bool IsAngled, bool IsMainModule) {
8282

8383
void IncludeOrderPPCallbacks::InclusionDirective(
8484
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
85-
bool IsAngled, CharSourceRange FilenameRange, Optional<FileEntryRef> File,
85+
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
8686
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
8787
SrcMgr::CharacteristicKind FileType) {
8888
// We recognize the first include as a special main module header and want

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class RestrictedIncludesPPCallbacks
3434
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
3535
StringRef FileName, bool IsAngled,
3636
CharSourceRange FilenameRange,
37-
Optional<FileEntryRef> File, StringRef SearchPath,
37+
OptionalFileEntryRef File, StringRef SearchPath,
3838
StringRef RelativePath, const Module *Imported,
3939
SrcMgr::CharacteristicKind FileType) override;
4040

@@ -46,7 +46,7 @@ class RestrictedIncludesPPCallbacks
4646

4747
void RestrictedIncludesPPCallbacks::InclusionDirective(
4848
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
49-
bool IsAngled, CharSourceRange FilenameRange, Optional<FileEntryRef> File,
49+
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
5050
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
5151
SrcMgr::CharacteristicKind FileType) {
5252
// Compiler provided headers are allowed (e.g stddef.h).

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class IncludeModernizePPCallbacks : public PPCallbacks {
3333
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
3434
StringRef FileName, bool IsAngled,
3535
CharSourceRange FilenameRange,
36-
Optional<FileEntryRef> File, StringRef SearchPath,
36+
OptionalFileEntryRef File, StringRef SearchPath,
3737
StringRef RelativePath, const Module *Imported,
3838
SrcMgr::CharacteristicKind FileType) override;
3939

@@ -179,7 +179,7 @@ IncludeModernizePPCallbacks::IncludeModernizePPCallbacks(
179179

180180
void IncludeModernizePPCallbacks::InclusionDirective(
181181
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
182-
bool IsAngled, CharSourceRange FilenameRange, Optional<FileEntryRef> File,
182+
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
183183
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
184184
SrcMgr::CharacteristicKind FileType) {
185185

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class MacroToEnumCallbacks : public PPCallbacks {
119119
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
120120
StringRef FileName, bool IsAngled,
121121
CharSourceRange FilenameRange,
122-
Optional<FileEntryRef> File, StringRef SearchPath,
122+
OptionalFileEntryRef File, StringRef SearchPath,
123123
StringRef RelativePath, const Module *Imported,
124124
SrcMgr::CharacteristicKind FileType) override {
125125
clearCurrentEnum(HashLoc);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace portability {
2222

2323
void RestrictedIncludesPPCallbacks::InclusionDirective(
2424
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
25-
bool IsAngled, CharSourceRange FilenameRange, Optional<FileEntryRef> File,
25+
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
2626
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
2727
SrcMgr::CharacteristicKind FileType) {
2828
if (!Check.contains(FileName) && SrcMgr::isSystem(FileType)) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class RestrictedIncludesPPCallbacks : public PPCallbacks {
5151
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
5252
StringRef FileName, bool IsAngled,
5353
CharSourceRange FilenameRange,
54-
Optional<FileEntryRef> File, StringRef SearchPath,
54+
OptionalFileEntryRef File, StringRef SearchPath,
5555
StringRef RelativePath, const Module *Imported,
5656
SrcMgr::CharacteristicKind FileType) override;
5757
void EndOfMainFile() override;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DuplicateIncludeCallbacks : public PPCallbacks {
4848
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
4949
StringRef FileName, bool IsAngled,
5050
CharSourceRange FilenameRange,
51-
Optional<FileEntryRef> File, StringRef SearchPath,
51+
OptionalFileEntryRef File, StringRef SearchPath,
5252
StringRef RelativePath, const Module *Imported,
5353
SrcMgr::CharacteristicKind FileType) override;
5454

@@ -77,7 +77,7 @@ void DuplicateIncludeCallbacks::FileChanged(SourceLocation Loc,
7777

7878
void DuplicateIncludeCallbacks::InclusionDirective(
7979
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
80-
bool IsAngled, CharSourceRange FilenameRange, Optional<FileEntryRef> File,
80+
bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File,
8181
StringRef SearchPath, StringRef RelativePath, const Module *Imported,
8282
SrcMgr::CharacteristicKind FileType) {
8383
if (llvm::is_contained(Files.back(), FileName)) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class IncludeInserterCallback : public PPCallbacks {
2424
void InclusionDirective(SourceLocation HashLocation,
2525
const Token &IncludeToken, StringRef FileNameRef,
2626
bool IsAngled, CharSourceRange FileNameRange,
27-
Optional<FileEntryRef> /*IncludedFile*/,
27+
OptionalFileEntryRef /*IncludedFile*/,
2828
StringRef /*SearchPath*/, StringRef /*RelativePath*/,
2929
const Module * /*ImportedModule*/,
3030
SrcMgr::CharacteristicKind /*FileType*/) override {

clang-tools-extra/clangd/ConfigCompile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct FragmentCompiler {
112112
diag(Error, "Invalid regex " + Anchored + ": " + RegexError, Text.Range);
113113
return std::nullopt;
114114
}
115-
return Result;
115+
return std::move(Result);
116116
}
117117

118118
std::optional<std::string> makeAbsolute(Located<std::string> Path,

clang-tools-extra/clangd/Headers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class IncludeStructure::RecordHeaders : public PPCallbacks,
3535
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
3636
llvm::StringRef FileName, bool IsAngled,
3737
CharSourceRange /*FilenameRange*/,
38-
Optional<FileEntryRef> File,
38+
OptionalFileEntryRef File,
3939
llvm::StringRef /*SearchPath*/,
4040
llvm::StringRef /*RelativePath*/,
4141
const clang::Module * /*Imported*/,

clang-tools-extra/clangd/ParsedAST.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class ReplayPreamble : private PPCallbacks {
171171

172172
void replay() {
173173
for (const auto &Inc : Includes) {
174-
llvm::Optional<FileEntryRef> File;
174+
OptionalFileEntryRef File;
175175
if (Inc.Resolved != "")
176176
File = expectedToOptional(SM.getFileManager().getFileRef(Inc.Resolved));
177177

@@ -679,7 +679,7 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
679679
make_move_iterator(UnusedHeadersDiags.begin()),
680680
make_move_iterator(UnusedHeadersDiags.end()));
681681
}
682-
return Result;
682+
return std::move(Result);
683683
}
684684

685685
ParsedAST::ParsedAST(ParsedAST &&Other) = default;

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace clang {
2828
namespace clangd {
2929
namespace {
3030

31-
llvm::Optional<std::string> toURI(Optional<FileEntryRef> File) {
31+
llvm::Optional<std::string> toURI(OptionalFileEntryRef File) {
3232
if (!File)
3333
return std::nullopt;
3434
auto AbsolutePath = File->getFileEntry().tryGetRealPathName();
@@ -85,8 +85,7 @@ struct IncludeGraphCollector : public PPCallbacks {
8585
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
8686
llvm::StringRef FileName, bool IsAngled,
8787
CharSourceRange FilenameRange,
88-
Optional<FileEntryRef> File,
89-
llvm::StringRef SearchPath,
88+
OptionalFileEntryRef File, llvm::StringRef SearchPath,
9089
llvm::StringRef RelativePath, const Module *Imported,
9190
SrcMgr::CharacteristicKind FileType) override {
9291
auto IncludeURI = toURI(File);

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

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -898,9 +898,7 @@ class Foo final {})cpp";
898898
HI.CalleeArgInfo.emplace();
899899
HI.CalleeArgInfo->Name = "arg_b";
900900
HI.CalleeArgInfo->Type = "int &";
901-
HI.CallPassType.emplace();
902-
HI.CallPassType->PassBy = PassMode::Ref;
903-
HI.CallPassType->Converted = false;
901+
HI.CallPassType = HoverInfo::PassType{PassMode::Ref, false};
904902
}},
905903
{// Extra info for method call.
906904
R"cpp(
@@ -926,9 +924,7 @@ class Foo final {})cpp";
926924
HI.CalleeArgInfo->Name = "arg_a";
927925
HI.CalleeArgInfo->Type = "int";
928926
HI.CalleeArgInfo->Default = "3";
929-
HI.CallPassType.emplace();
930-
HI.CallPassType->PassBy = PassMode::Value;
931-
HI.CallPassType->Converted = false;
927+
HI.CallPassType = HoverInfo::PassType{PassMode::Value, false};
932928
}},
933929
{// Dont crash on invalid decl
934930
R"cpp(
@@ -3037,9 +3033,7 @@ private: union foo {})",
30373033
HI.CalleeArgInfo->Name = "arg_a";
30383034
HI.CalleeArgInfo->Type = "int";
30393035
HI.CalleeArgInfo->Default = "7";
3040-
HI.CallPassType.emplace();
3041-
HI.CallPassType->PassBy = PassMode::Value;
3042-
HI.CallPassType->Converted = false;
3036+
HI.CallPassType = HoverInfo::PassType{PassMode::Value, false};
30433037
},
30443038
R"(variable foo
30453039
@@ -3062,9 +3056,7 @@ int foo = 3)",
30623056
HI.CalleeArgInfo->Name = "arg_a";
30633057
HI.CalleeArgInfo->Type = "int";
30643058
HI.CalleeArgInfo->Default = "7";
3065-
HI.CallPassType.emplace();
3066-
HI.CallPassType->PassBy = PassMode::Ref;
3067-
HI.CallPassType->Converted = false;
3059+
HI.CallPassType = HoverInfo::PassType{PassMode::Ref, false};
30683060
},
30693061
R"(variable foo
30703062
@@ -3087,9 +3079,7 @@ int foo = 3)",
30873079
HI.CalleeArgInfo->Name = "arg_a";
30883080
HI.CalleeArgInfo->Type = {"alias_int", "int"};
30893081
HI.CalleeArgInfo->Default = "7";
3090-
HI.CallPassType.emplace();
3091-
HI.CallPassType->PassBy = PassMode::Value;
3092-
HI.CallPassType->Converted = true;
3082+
HI.CallPassType = HoverInfo::PassType{PassMode::Value, true};
30933083
},
30943084
R"(variable foo
30953085
@@ -3127,9 +3117,7 @@ int foo = 3)",
31273117
HI.CalleeArgInfo->Name = "arg_a";
31283118
HI.CalleeArgInfo->Type = "int";
31293119
HI.CalleeArgInfo->Default = "7";
3130-
HI.CallPassType.emplace();
3131-
HI.CallPassType->PassBy = PassMode::ConstRef;
3132-
HI.CallPassType->Converted = true;
3120+
HI.CallPassType = HoverInfo::PassType{PassMode::ConstRef, true};
31333121
},
31343122
R"(variable foo
31353123

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,8 @@ TEST(ParsedASTTest, ReplayPreambleForTidyCheckers) {
380380

381381
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
382382
StringRef FileName, bool IsAngled,
383-
CharSourceRange FilenameRange,
384-
Optional<FileEntryRef>, StringRef, StringRef,
385-
const clang::Module *,
383+
CharSourceRange FilenameRange, OptionalFileEntryRef,
384+
StringRef, StringRef, const clang::Module *,
386385
SrcMgr::CharacteristicKind) override {
387386
Includes.emplace_back(SM, HashLoc, IncludeTok, FileName, IsAngled,
388387
FilenameRange);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class PPRecorder : public PPCallbacks {
3535
void InclusionDirective(SourceLocation Hash, const Token &IncludeTok,
3636
StringRef SpelledFilename, bool IsAngled,
3737
CharSourceRange FilenameRange,
38-
llvm::Optional<FileEntryRef> File,
39-
StringRef SearchPath, StringRef RelativePath,
40-
const Module *, SrcMgr::CharacteristicKind) override {
38+
OptionalFileEntryRef File, StringRef SearchPath,
39+
StringRef RelativePath, const Module *,
40+
SrcMgr::CharacteristicKind) override {
4141
if (!Active)
4242
return;
4343

@@ -180,7 +180,7 @@ class PragmaIncludes::RecordPragma : public PPCallbacks, public CommentHandler {
180180
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
181181
llvm::StringRef FileName, bool IsAngled,
182182
CharSourceRange /*FilenameRange*/,
183-
Optional<FileEntryRef> File,
183+
OptionalFileEntryRef File,
184184
llvm::StringRef /*SearchPath*/,
185185
llvm::StringRef /*RelativePath*/,
186186
const clang::Module * /*Imported*/,

clang-tools-extra/modularize/CoverageChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class CoverageCheckerCallbacks : public PPCallbacks {
8989
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
9090
StringRef FileName, bool IsAngled,
9191
CharSourceRange FilenameRange,
92-
Optional<FileEntryRef> File, StringRef SearchPath,
92+
OptionalFileEntryRef File, StringRef SearchPath,
9393
StringRef RelativePath, const Module *Imported,
9494
SrcMgr::CharacteristicKind FileType) override {
9595
Checker.collectUmbrellaHeaderHeader(File->getName());

0 commit comments

Comments
 (0)