aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Lex/LexerTest.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-06-09 19:22:32 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-06-09 19:22:32 +0000
commit5d2ed489870cb4b093ec8f52ab4a4ef81428d6fe (patch)
treee160351d0bb3ac6668d13998c903dc916851bf50 /clang/unittests/Lex/LexerTest.cpp
parent01a48b5dfde850f1818c511f08188d9a15945222 (diff)
downloadllvm-5d2ed489870cb4b093ec8f52ab4a4ef81428d6fe.zip
llvm-5d2ed489870cb4b093ec8f52ab4a4ef81428d6fe.tar.gz
llvm-5d2ed489870cb4b093ec8f52ab4a4ef81428d6fe.tar.bz2
Add #pragma clang module build/endbuild pragmas for performing a module build
as part of a compilation. This is intended for two purposes: 1) Writing self-contained test cases for modules: we can now write a single source file test that builds some number of module files on the side and imports them. 2) Debugging / test case reduction. A single-source testcase is much more amenable to reduction, compared to a VFS tarball or .pcm files. llvm-svn: 305101
Diffstat (limited to 'clang/unittests/Lex/LexerTest.cpp')
-rw-r--r--clang/unittests/Lex/LexerTest.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/clang/unittests/Lex/LexerTest.cpp b/clang/unittests/Lex/LexerTest.cpp
index b5a6fd9..e2507d3 100644
--- a/clang/unittests/Lex/LexerTest.cpp
+++ b/clang/unittests/Lex/LexerTest.cpp
@@ -27,24 +27,6 @@ using namespace clang;
namespace {
-class VoidModuleLoader : public ModuleLoader {
- ModuleLoadResult loadModule(SourceLocation ImportLoc,
- ModuleIdPath Path,
- Module::NameVisibilityKind Visibility,
- bool IsInclusionDirective) override {
- return ModuleLoadResult();
- }
-
- void makeModuleVisible(Module *Mod,
- Module::NameVisibilityKind Visibility,
- SourceLocation ImportLoc) override { }
-
- GlobalModuleIndex *loadGlobalModuleIndex(SourceLocation TriggerLoc) override
- { return nullptr; }
- bool lookupMissingImports(StringRef Name, SourceLocation TriggerLoc) override
- { return 0; }
-};
-
// The test fixture.
class LexerTest : public ::testing::Test {
protected:
@@ -64,7 +46,7 @@ protected:
llvm::MemoryBuffer::getMemBuffer(Source);
SourceMgr.setMainFileID(SourceMgr.createFileID(std::move(Buf)));
- VoidModuleLoader ModLoader;
+ TrivialModuleLoader ModLoader;
MemoryBufferCache PCMCache;
HeaderSearch HeaderInfo(std::make_shared<HeaderSearchOptions>(), SourceMgr,
Diags, LangOpts, Target.get());