summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulie Hockett <juliehockett@google.com>2018-05-10 19:13:14 +0000
committerJulie Hockett <juliehockett@google.com>2018-05-10 19:13:14 +0000
commit546943f9f1ab8d7885b54fc44f95620458967d7e (patch)
treea15529646032d9d3394cf309459f74fef7302999
parenta3686c9a285e5ba0a78b9dbad4cb11052ea101c9 (diff)
downloadbcm5719-llvm-546943f9f1ab8d7885b54fc44f95620458967d7e.tar.gz
bcm5719-llvm-546943f9f1ab8d7885b54fc44f95620458967d7e.zip
Reland "[tools] Updating PPCallbacks::InclusionDirective calls"
This commit relands r331905. r331904 added SrcMgr::CharacteristicKind to the InclusionDirective callback, this revision updates instances of it in clang-tools-extra. llvm-svn: 332023
-rw-r--r--clang-tools-extra/clang-move/ClangMove.cpp3
-rw-r--r--clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp6
-rw-r--r--clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp6
-rw-r--r--clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp3
-rw-r--r--clang-tools-extra/clangd/ClangdUnit.cpp3
-rw-r--r--clang-tools-extra/clangd/Headers.cpp3
-rw-r--r--clang-tools-extra/modularize/CoverageChecker.cpp3
-rw-r--r--clang-tools-extra/modularize/PreprocessorTracker.cpp5
-rw-r--r--clang-tools-extra/pp-trace/PPCallbacksTracker.cpp2
-rw-r--r--clang-tools-extra/pp-trace/PPCallbacksTracker.h3
10 files changed, 24 insertions, 13 deletions
diff --git a/clang-tools-extra/clang-move/ClangMove.cpp b/clang-tools-extra/clang-move/ClangMove.cpp
index d600daa22c5..b89e0be1c37 100644
--- a/clang-tools-extra/clang-move/ClangMove.cpp
+++ b/clang-tools-extra/clang-move/ClangMove.cpp
@@ -131,7 +131,8 @@ public:
clang::CharSourceRange FilenameRange,
const clang::FileEntry * /*File*/,
StringRef SearchPath, StringRef /*RelativePath*/,
- const clang::Module * /*Imported*/) override {
+ const clang::Module * /*Imported*/,
+ SrcMgr::CharacteristicKind /*FileType*/) override {
if (const auto *FileEntry = SM.getFileEntryForID(SM.getFileID(HashLoc)))
MoveTool->addIncludes(FileName, IsAngled, SearchPath,
FileEntry->getName(), FilenameRange, SM);
diff --git a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
index c277a45d2a0..f1fdb39c263 100644
--- a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
+++ b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
@@ -28,7 +28,8 @@ 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;
private:
@@ -76,7 +77,8 @@ static int getPriority(StringRef Filename, bool IsAngled, bool IsMainModule) {
void IncludeOrderPPCallbacks::InclusionDirective(
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
bool IsAngled, CharSourceRange FilenameRange, const FileEntry *File,
- StringRef SearchPath, StringRef RelativePath, const Module *Imported) {
+ 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.
IncludeDirective ID = {HashLoc, FilenameRange, FileName, IsAngled, false};
diff --git a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
index ea5943e97a0..1ff3f898840 100644
--- a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
@@ -30,7 +30,8 @@ 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;
private:
ClangTidyCheck &Check;
@@ -94,7 +95,8 @@ IncludeModernizePPCallbacks::IncludeModernizePPCallbacks(ClangTidyCheck &Check,
void IncludeModernizePPCallbacks::InclusionDirective(
SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName,
bool IsAngled, CharSourceRange FilenameRange, const FileEntry *File,
- StringRef SearchPath, StringRef RelativePath, const Module *Imported) {
+ StringRef SearchPath, StringRef RelativePath, const Module *Imported,
+ SrcMgr::CharacteristicKind FileType) {
// FIXME: Take care of library symbols from the global namespace.
//
// Reasonable options for the check:
diff --git a/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp b/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
index 9fc7f52139d..64e4213c52b 100644
--- a/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
+++ b/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
@@ -25,7 +25,8 @@ public:
bool IsAngled, CharSourceRange FileNameRange,
const FileEntry * /*IncludedFile*/,
StringRef /*SearchPath*/, StringRef /*RelativePath*/,
- const Module * /*ImportedModule*/) override {
+ const Module * /*ImportedModule*/,
+ SrcMgr::CharacteristicKind /*FileType*/) override {
Inserter->AddInclude(FileNameRef, IsAngled, HashLocation,
IncludeToken.getEndLoc());
}
diff --git a/clang-tools-extra/clangd/ClangdUnit.cpp b/clang-tools-extra/clangd/ClangdUnit.cpp
index c750f578e65..fd8f1ec2765 100644
--- a/clang-tools-extra/clangd/ClangdUnit.cpp
+++ b/clang-tools-extra/clangd/ClangdUnit.cpp
@@ -93,7 +93,8 @@ 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 {
auto SR = FilenameRange.getAsRange();
if (SR.isInvalid() || !File || File->tryGetRealPathName().empty())
return;
diff --git a/clang-tools-extra/clangd/Headers.cpp b/clang-tools-extra/clangd/Headers.cpp
index 3d82fe5ee6b..af244553179 100644
--- a/clang-tools-extra/clangd/Headers.cpp
+++ b/clang-tools-extra/clangd/Headers.cpp
@@ -34,7 +34,8 @@ public:
CharSourceRange /*FilenameRange*/,
const FileEntry *File, llvm::StringRef /*SearchPath*/,
llvm::StringRef /*RelativePath*/,
- const Module * /*Imported*/) override {
+ const Module * /*Imported*/,
+ SrcMgr::CharacteristicKind /*FileType*/) override {
WrittenHeaders.insert(
(IsAngled ? "<" + FileName + ">" : "\"" + FileName + "\"").str());
if (File != nullptr && !File->tryGetRealPathName().empty())
diff --git a/clang-tools-extra/modularize/CoverageChecker.cpp b/clang-tools-extra/modularize/CoverageChecker.cpp
index 3687872871c..4e2a23cadab 100644
--- a/clang-tools-extra/modularize/CoverageChecker.cpp
+++ b/clang-tools-extra/modularize/CoverageChecker.cpp
@@ -90,7 +90,8 @@ 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 {
Checker.collectUmbrellaHeaderHeader(File->getName());
}
diff --git a/clang-tools-extra/modularize/PreprocessorTracker.cpp b/clang-tools-extra/modularize/PreprocessorTracker.cpp
index a9d61f05d04..6cb34c7b25a 100644
--- a/clang-tools-extra/modularize/PreprocessorTracker.cpp
+++ b/clang-tools-extra/modularize/PreprocessorTracker.cpp
@@ -750,7 +750,8 @@ public:
const clang::FileEntry *File,
llvm::StringRef SearchPath,
llvm::StringRef RelativePath,
- const clang::Module *Imported) override;
+ const clang::Module *Imported,
+ clang::SrcMgr::CharacteristicKind FileType) override;
void FileChanged(clang::SourceLocation Loc,
clang::PPCallbacks::FileChangeReason Reason,
clang::SrcMgr::CharacteristicKind FileType,
@@ -1289,7 +1290,7 @@ void PreprocessorCallbacks::InclusionDirective(
llvm::StringRef FileName, bool IsAngled,
clang::CharSourceRange FilenameRange, const clang::FileEntry *File,
llvm::StringRef SearchPath, llvm::StringRef RelativePath,
- const clang::Module *Imported) {
+ const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) {
int DirectiveLine, DirectiveColumn;
std::string HeaderPath = getSourceLocationFile(PP, HashLoc);
getSourceLocationLineAndColumn(PP, HashLoc, DirectiveLine, DirectiveColumn);
diff --git a/clang-tools-extra/pp-trace/PPCallbacksTracker.cpp b/clang-tools-extra/pp-trace/PPCallbacksTracker.cpp
index 4bb126c080c..2530dc2d319 100644
--- a/clang-tools-extra/pp-trace/PPCallbacksTracker.cpp
+++ b/clang-tools-extra/pp-trace/PPCallbacksTracker.cpp
@@ -139,7 +139,7 @@ void PPCallbacksTracker::InclusionDirective(
llvm::StringRef FileName, bool IsAngled,
clang::CharSourceRange FilenameRange, const clang::FileEntry *File,
llvm::StringRef SearchPath, llvm::StringRef RelativePath,
- const clang::Module *Imported) {
+ const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) {
beginCallback("InclusionDirective");
appendArgument("IncludeTok", IncludeTok);
appendFilePathArgument("FileName", FileName);
diff --git a/clang-tools-extra/pp-trace/PPCallbacksTracker.h b/clang-tools-extra/pp-trace/PPCallbacksTracker.h
index 7b57d34692a..b46210ef25a 100644
--- a/clang-tools-extra/pp-trace/PPCallbacksTracker.h
+++ b/clang-tools-extra/pp-trace/PPCallbacksTracker.h
@@ -102,7 +102,8 @@ public:
const clang::FileEntry *File,
llvm::StringRef SearchPath,
llvm::StringRef RelativePath,
- const clang::Module *Imported) override;
+ const clang::Module *Imported,
+ clang::SrcMgr::CharacteristicKind FileType) override;
void moduleImport(clang::SourceLocation ImportLoc, clang::ModuleIdPath Path,
const clang::Module *Imported) override;
void EndOfMainFile() override;
OpenPOWER on IntegriCloud