diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-08 14:20:14 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-10-08 14:20:14 +0000 |
commit | 46d311da19762fde07b2f43b5e4d615f4014f5ef (patch) | |
tree | b625a1645e38abac1b6093d4890fcbd62a190730 /clang/unittests/Lex/PPCallbacksTest.cpp | |
parent | 989157a3ad530316cd099140fa1af1ecf67e5269 (diff) | |
download | bcm5719-llvm-46d311da19762fde07b2f43b5e4d615f4014f5ef.tar.gz bcm5719-llvm-46d311da19762fde07b2f43b5e4d615f4014f5ef.zip |
[VFS] Use VFS instead of virtual files in PPCallbacks test.
llvm-svn: 249693
Diffstat (limited to 'clang/unittests/Lex/PPCallbacksTest.cpp')
-rw-r--r-- | clang/unittests/Lex/PPCallbacksTest.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/unittests/Lex/PPCallbacksTest.cpp b/clang/unittests/Lex/PPCallbacksTest.cpp index 08bc351e8c5..cbce5c6e167 100644 --- a/clang/unittests/Lex/PPCallbacksTest.cpp +++ b/clang/unittests/Lex/PPCallbacksTest.cpp @@ -110,15 +110,16 @@ public: class PPCallbacksTest : public ::testing::Test { protected: PPCallbacksTest() - : FileMgr(FileMgrOpts), DiagID(new DiagnosticIDs()), - DiagOpts(new DiagnosticOptions()), + : InMemoryFileSystem(new vfs::InMemoryFileSystem), + FileMgr(FileSystemOptions(), InMemoryFileSystem), + DiagID(new DiagnosticIDs()), DiagOpts(new DiagnosticOptions()), Diags(DiagID, DiagOpts.get(), new IgnoringDiagConsumer()), SourceMgr(Diags, FileMgr), TargetOpts(new TargetOptions()) { TargetOpts->Triple = "x86_64-apple-darwin11.1.0"; Target = TargetInfo::CreateTargetInfo(Diags, TargetOpts); } - FileSystemOptions FileMgrOpts; + IntrusiveRefCntPtr<vfs::InMemoryFileSystem> InMemoryFileSystem; FileManager FileMgr; IntrusiveRefCntPtr<DiagnosticIDs> DiagID; IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts; @@ -133,7 +134,8 @@ protected: void AddFakeHeader(HeaderSearch& HeaderInfo, const char* HeaderPath, bool IsSystemHeader) { // Tell FileMgr about header. - FileMgr.getVirtualFile(HeaderPath, 0, 0); + InMemoryFileSystem->addFile(HeaderPath, 0, + llvm::MemoryBuffer::getMemBuffer("\n")); // Add header's parent path to search path. StringRef SearchPath = llvm::sys::path::parent_path(HeaderPath); |