aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/DependencyGraph.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/lib/Frontend/DependencyGraph.cpp
parent1d43966bc33a55cad1db7758bf4d82526d125db7 (diff)
downloadllvm-8f0df9f3bbc6d7f3d5cbfd955c5ee4404c53a75d.zip
llvm-8f0df9f3bbc6d7f3d5cbfd955c5ee4404c53a75d.tar.gz
llvm-8f0df9f3bbc6d7f3d5cbfd955c5ee4404c53a75d.tar.bz2
[clang] Convert OptionalFileEntryRefDegradesToFileEntryPtr to std::optional
Diffstat (limited to 'clang/lib/Frontend/DependencyGraph.cpp')
-rw-r--r--clang/lib/Frontend/DependencyGraph.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/clang/lib/Frontend/DependencyGraph.cpp b/clang/lib/Frontend/DependencyGraph.cpp
index 4cbdb3d..ccf34ac 100644
--- a/clang/lib/Frontend/DependencyGraph.cpp
+++ b/clang/lib/Frontend/DependencyGraph.cpp
@@ -11,15 +11,16 @@
//
//===----------------------------------------------------------------------===//
-#include "clang/Frontend/Utils.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Frontend/FrontendDiagnostic.h"
+#include "clang/Frontend/Utils.h"
#include "clang/Lex/PPCallbacks.h"
#include "clang/Lex/Preprocessor.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Support/GraphWriter.h"
#include "llvm/Support/raw_ostream.h"
+#include <optional>
using namespace clang;
namespace DOT = llvm::DOT;
@@ -48,8 +49,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 {
@@ -66,21 +68,16 @@ void clang::AttachDependencyGraphGen(Preprocessor &PP, StringRef OutputFile,
}
void DependencyGraphCallback::InclusionDirective(
- SourceLocation HashLoc,
- const Token &IncludeTok,
- StringRef FileName,
- bool IsAngled,
- CharSourceRange FilenameRange,
- Optional<FileEntryRef> File,
- StringRef SearchPath,
- StringRef RelativePath,
- const Module *Imported,
+ SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
+ bool IsAngled, CharSourceRange FilenameRange,
+ std::optional<FileEntryRef> File, StringRef SearchPath,
+ StringRef RelativePath, const Module *Imported,
SrcMgr::CharacteristicKind FileType) {
if (!File)
return;
SourceManager &SM = PP->getSourceManager();
- Optional<FileEntryRef> FromFile =
+ std::optional<FileEntryRef> FromFile =
SM.getFileEntryRefForID(SM.getFileID(SM.getExpansionLoc(HashLoc)));
if (!FromFile)
return;