summaryrefslogtreecommitdiff
path: root/unittests/Lex/LexerTest.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2014-11-24 09:15:30 +0000
committerDimitry Andric <dim@FreeBSD.org>2014-11-24 09:15:30 +0000
commit9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 (patch)
tree47df2c12b57214af6c31e47404b005675b8b7ffc /unittests/Lex/LexerTest.cpp
parentf73d5f23a889b93d89ddef61ac0995df40286bb8 (diff)
Notes
Diffstat (limited to 'unittests/Lex/LexerTest.cpp')
-rw-r--r--unittests/Lex/LexerTest.cpp38
1 files changed, 21 insertions, 17 deletions
diff --git a/unittests/Lex/LexerTest.cpp b/unittests/Lex/LexerTest.cpp
index 40ce928014d54..2d75b52276ccc 100644
--- a/unittests/Lex/LexerTest.cpp
+++ b/unittests/Lex/LexerTest.cpp
@@ -20,7 +20,6 @@
#include "clang/Lex/ModuleLoader.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/PreprocessorOptions.h"
-#include "llvm/Config/config.h"
#include "gtest/gtest.h"
using namespace llvm;
@@ -29,17 +28,22 @@ using namespace clang;
namespace {
class VoidModuleLoader : public ModuleLoader {
- virtual ModuleLoadResult loadModule(SourceLocation ImportLoc,
- ModuleIdPath Path,
- Module::NameVisibilityKind Visibility,
- bool IsInclusionDirective) {
+ ModuleLoadResult loadModule(SourceLocation ImportLoc,
+ ModuleIdPath Path,
+ Module::NameVisibilityKind Visibility,
+ bool IsInclusionDirective) override {
return ModuleLoadResult();
}
- virtual void makeModuleVisible(Module *Mod,
- Module::NameVisibilityKind Visibility,
- SourceLocation ImportLoc,
- bool Complain) { }
+ void makeModuleVisible(Module *Mod,
+ Module::NameVisibilityKind Visibility,
+ SourceLocation ImportLoc,
+ bool Complain) override { }
+
+ GlobalModuleIndex *loadGlobalModuleIndex(SourceLocation TriggerLoc) override
+ { return nullptr; }
+ bool lookupMissingImports(StringRef Name, SourceLocation TriggerLoc) override
+ { return 0; };
};
// The test fixture.
@@ -53,21 +57,21 @@ protected:
TargetOpts(new TargetOptions)
{
TargetOpts->Triple = "x86_64-apple-darwin11.1.0";
- Target = TargetInfo::CreateTargetInfo(Diags, &*TargetOpts);
+ Target = TargetInfo::CreateTargetInfo(Diags, TargetOpts);
}
std::vector<Token> CheckLex(StringRef Source,
ArrayRef<tok::TokenKind> ExpectedTokens) {
MemoryBuffer *buf = MemoryBuffer::getMemBuffer(Source);
- (void) SourceMgr.createMainFileIDForMemBuffer(buf);
+ SourceMgr.setMainFileID(SourceMgr.createFileID(buf));
VoidModuleLoader ModLoader;
HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, LangOpts,
- Target.getPtr());
- Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, Target.getPtr(),
- SourceMgr, HeaderInfo, ModLoader, /*IILookup =*/ 0,
- /*OwnsHeaderSearch =*/ false,
- /*DelayInitialization =*/ false);
+ Target.get());
+ Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, SourceMgr,
+ HeaderInfo, ModLoader, /*IILookup =*/nullptr,
+ /*OwnsHeaderSearch =*/false);
+ PP.Initialize(*Target);
PP.EnterMainSourceFile();
std::vector<Token> toks;
@@ -104,7 +108,7 @@ protected:
DiagnosticsEngine Diags;
SourceManager SourceMgr;
LangOptions LangOpts;
- IntrusiveRefCntPtr<TargetOptions> TargetOpts;
+ std::shared_ptr<TargetOptions> TargetOpts;
IntrusiveRefCntPtr<TargetInfo> Target;
};