summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Lex/PPCallbacksTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Lex/PPCallbacksTest.cpp')
-rw-r--r--clang/unittests/Lex/PPCallbacksTest.cpp41
1 files changed, 11 insertions, 30 deletions
diff --git a/clang/unittests/Lex/PPCallbacksTest.cpp b/clang/unittests/Lex/PPCallbacksTest.cpp
index 4f528712aef..67b56a601c7 100644
--- a/clang/unittests/Lex/PPCallbacksTest.cpp
+++ b/clang/unittests/Lex/PPCallbacksTest.cpp
@@ -39,18 +39,16 @@ public:
StringRef FileName, bool IsAngled,
CharSourceRange FilenameRange, const FileEntry *File,
StringRef SearchPath, StringRef RelativePath,
- const Module *Imported,
- SrcMgr::CharacteristicKind FileType) override {
- this->HashLoc = HashLoc;
- this->IncludeTok = IncludeTok;
- this->FileName = FileName.str();
- this->IsAngled = IsAngled;
- this->FilenameRange = FilenameRange;
- this->File = File;
- this->SearchPath = SearchPath.str();
- this->RelativePath = RelativePath.str();
- this->Imported = Imported;
- this->FileType = FileType;
+ const Module *Imported) override {
+ this->HashLoc = HashLoc;
+ this->IncludeTok = IncludeTok;
+ this->FileName = FileName.str();
+ this->IsAngled = IsAngled;
+ this->FilenameRange = FilenameRange;
+ this->File = File;
+ this->SearchPath = SearchPath.str();
+ this->RelativePath = RelativePath.str();
+ this->Imported = Imported;
}
SourceLocation HashLoc;
@@ -62,7 +60,6 @@ public:
SmallString<16> SearchPath;
SmallString<16> RelativePath;
const Module* Imported;
- SrcMgr::CharacteristicKind FileType;
};
// Stub to collect data from PragmaOpenCLExtension callbacks.
@@ -141,13 +138,6 @@ protected:
// the InclusionDirective callback.
CharSourceRange InclusionDirectiveFilenameRange(const char* SourceText,
const char* HeaderPath, bool SystemHeader) {
- return InclusionDirectiveCallback(SourceText, HeaderPath, SystemHeader)
- ->FilenameRange;
- }
-
- InclusionDirectiveCallbacks *
- InclusionDirectiveCallback(const char *SourceText, const char *HeaderPath,
- bool SystemHeader) {
std::unique_ptr<llvm::MemoryBuffer> Buf =
llvm::MemoryBuffer::getMemBuffer(SourceText);
SourceMgr.setMainFileID(SourceMgr.createFileID(std::move(Buf)));
@@ -178,7 +168,7 @@ protected:
}
// Callbacks have been executed at this point -- return filename range.
- return Callbacks;
+ return Callbacks->FilenameRange;
}
PragmaOpenCLExtensionCallbacks::CallbackParameters
@@ -232,15 +222,6 @@ protected:
}
};
-TEST_F(PPCallbacksTest, UserFileCharacteristics) {
- const char *Source = "#include \"quoted.h\"\n";
-
- SrcMgr::CharacteristicKind Kind =
- InclusionDirectiveCallback(Source, "/quoted.h", false)->FileType;
-
- ASSERT_EQ(SrcMgr::CharacteristicKind::C_User, Kind);
-}
-
TEST_F(PPCallbacksTest, QuotedFilename) {
const char* Source =
"#include \"quoted.h\"\n";
OpenPOWER on IntegriCloud