diff options
Diffstat (limited to 'clang/lib/Frontend/DependencyGraph.cpp')
-rw-r--r-- | clang/lib/Frontend/DependencyGraph.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/clang/lib/Frontend/DependencyGraph.cpp b/clang/lib/Frontend/DependencyGraph.cpp index ccf34ac..4cbdb3d 100644 --- a/clang/lib/Frontend/DependencyGraph.cpp +++ b/clang/lib/Frontend/DependencyGraph.cpp @@ -11,16 +11,15 @@ // //===----------------------------------------------------------------------===// +#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; @@ -49,9 +48,8 @@ public: void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, bool IsAngled, CharSourceRange FilenameRange, - std::optional<FileEntryRef> File, - StringRef SearchPath, StringRef RelativePath, - const Module *Imported, + Optional<FileEntryRef> File, StringRef SearchPath, + StringRef RelativePath, const Module *Imported, SrcMgr::CharacteristicKind FileType) override; void EndOfMainFile() override { @@ -68,16 +66,21 @@ void clang::AttachDependencyGraphGen(Preprocessor &PP, StringRef OutputFile, } void DependencyGraphCallback::InclusionDirective( - SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, - bool IsAngled, CharSourceRange FilenameRange, - std::optional<FileEntryRef> File, StringRef SearchPath, - StringRef RelativePath, const Module *Imported, + SourceLocation HashLoc, + const Token &IncludeTok, + StringRef FileName, + bool IsAngled, + CharSourceRange FilenameRange, + Optional<FileEntryRef> File, + StringRef SearchPath, + StringRef RelativePath, + const Module *Imported, SrcMgr::CharacteristicKind FileType) { if (!File) return; SourceManager &SM = PP->getSourceManager(); - std::optional<FileEntryRef> FromFile = + Optional<FileEntryRef> FromFile = SM.getFileEntryRefForID(SM.getFileID(SM.getExpansionLoc(HashLoc))); if (!FromFile) return; |