aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@quicinc.com>2022-12-17 13:57:30 -0800
committerKrzysztof Parzyszek <kparzysz@quicinc.com>2022-12-17 15:24:14 -0800
commit8f0df9f3bbc6d7f3d5cbfd955c5ee4404c53a75d (patch)
treeb16c78031a5bff93437c00aba53b03bc6a166bc0 /clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
parent1d43966bc33a55cad1db7758bf4d82526d125db7 (diff)
downloadllvm-8f0df9f3bbc6d7f3d5cbfd955c5ee4404c53a75d.zip
llvm-8f0df9f3bbc6d7f3d5cbfd955c5ee4404c53a75d.tar.gz
llvm-8f0df9f3bbc6d7f3d5cbfd955c5ee4404c53a75d.tar.bz2
[clang] Convert OptionalFileEntryRefDegradesToFileEntryPtr to std::optional
Diffstat (limited to 'clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
index f701bd1..617dfb6 100644
--- a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
+++ b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
@@ -13,6 +13,7 @@
#include "llvm/ADT/STLExtras.h"
#include <map>
+#include <optional>
namespace clang {
namespace tidy {
@@ -28,8 +29,9 @@ public:
void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
StringRef FileName, bool IsAngled,
CharSourceRange FilenameRange,
- Optional<FileEntryRef> File, StringRef SearchPath,
- StringRef RelativePath, const Module *Imported,
+ std::optional<FileEntryRef> File,
+ StringRef SearchPath, StringRef RelativePath,
+ const Module *Imported,
SrcMgr::CharacteristicKind FileType) override;
void EndOfMainFile() override;
@@ -82,8 +84,9 @@ static int getPriority(StringRef Filename, bool IsAngled, bool IsMainModule) {
void IncludeOrderPPCallbacks::InclusionDirective(
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
- bool IsAngled, CharSourceRange FilenameRange, Optional<FileEntryRef> File,
- StringRef SearchPath, StringRef RelativePath, const Module *Imported,
+ bool IsAngled, CharSourceRange FilenameRange,
+ std::optional<FileEntryRef> File, StringRef SearchPath,
+ StringRef RelativePath, const Module *Imported,
SrcMgr::CharacteristicKind FileType) {
// We recognize the first include as a special main module header and want
// to leave it in the top position.