From b773203fb58f3ef282fb69c832d8710cab5bc82d Mon Sep 17 00:00:00 2001 From: patrick Date: Sun, 27 Jan 2019 16:42:12 +0000 Subject: Import LLVM 7.0.1 release including clang, lld and lldb. --- .../tools/clang/lib/Frontend/DependencyGraph.cpp | 41 ++++++++++++---------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'gnu/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp') diff --git a/gnu/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp b/gnu/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp index 67a977e38be..c6c9ac2ea2f 100644 --- a/gnu/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp +++ b/gnu/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp @@ -33,9 +33,9 @@ class DependencyGraphCallback : public PPCallbacks { llvm::SetVector AllFiles; typedef llvm::DenseMap > DependencyMap; - + DependencyMap Dependencies; - + private: raw_ostream &writeNodeReference(raw_ostream &OS, const FileEntry *Node); @@ -50,12 +50,13 @@ public: StringRef FileName, bool IsAngled, CharSourceRange FilenameRange, const FileEntry *File, StringRef SearchPath, StringRef RelativePath, - const Module *Imported) override; + const Module *Imported, + SrcMgr::CharacteristicKind FileType) override; void EndOfMainFile() override { OutputGraphFile(); } - + }; } @@ -65,18 +66,20 @@ void clang::AttachDependencyGraphGen(Preprocessor &PP, StringRef OutputFile, SysRoot)); } -void DependencyGraphCallback::InclusionDirective(SourceLocation HashLoc, - const Token &IncludeTok, - StringRef FileName, - bool IsAngled, - CharSourceRange FilenameRange, - const FileEntry *File, - StringRef SearchPath, - StringRef RelativePath, - const Module *Imported) { +void DependencyGraphCallback::InclusionDirective( + SourceLocation HashLoc, + const Token &IncludeTok, + StringRef FileName, + bool IsAngled, + CharSourceRange FilenameRange, + const FileEntry *File, + StringRef SearchPath, + StringRef RelativePath, + const Module *Imported, + SrcMgr::CharacteristicKind FileType) { if (!File) return; - + SourceManager &SM = PP->getSourceManager(); const FileEntry *FromFile = SM.getFileEntryForID(SM.getFileID(SM.getExpansionLoc(HashLoc))); @@ -84,7 +87,7 @@ void DependencyGraphCallback::InclusionDirective(SourceLocation HashLoc, return; Dependencies[FromFile].push_back(File); - + AllFiles.insert(File); AllFiles.insert(FromFile); } @@ -106,7 +109,7 @@ void DependencyGraphCallback::OutputGraphFile() { } OS << "digraph \"dependencies\" {\n"; - + // Write the nodes for (unsigned I = 0, N = AllFiles.size(); I != N; ++I) { // Write the node itself. @@ -116,15 +119,15 @@ void DependencyGraphCallback::OutputGraphFile() { StringRef FileName = AllFiles[I]->getName(); if (FileName.startswith(SysRoot)) FileName = FileName.substr(SysRoot.size()); - + OS << DOT::EscapeString(FileName) << "\"];\n"; } // Write the edges - for (DependencyMap::iterator F = Dependencies.begin(), + for (DependencyMap::iterator F = Dependencies.begin(), FEnd = Dependencies.end(); - F != FEnd; ++F) { + F != FEnd; ++F) { for (unsigned I = 0, N = F->second.size(); I != N; ++I) { OS.indent(2); writeNodeReference(OS, F->first); -- cgit v1.2.3-59-g8ed1b