diff options
Diffstat (limited to 'unittests/Basic/SourceManagerTest.cpp')
-rw-r--r-- | unittests/Basic/SourceManagerTest.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/unittests/Basic/SourceManagerTest.cpp b/unittests/Basic/SourceManagerTest.cpp index de3b723..6f404b5 100644 --- a/unittests/Basic/SourceManagerTest.cpp +++ b/unittests/Basic/SourceManagerTest.cpp @@ -10,12 +10,15 @@ #include "clang/Basic/SourceManager.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/Diagnostic.h" +#include "clang/Basic/DiagnosticOptions.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/TargetOptions.h" #include "clang/Basic/TargetInfo.h" #include "clang/Lex/ModuleLoader.h" #include "clang/Lex/HeaderSearch.h" +#include "clang/Lex/HeaderSearchOptions.h" #include "clang/Lex/Preprocessor.h" +#include "clang/Lex/PreprocessorOptions.h" #include "llvm/ADT/SmallString.h" #include "llvm/Config/config.h" @@ -32,10 +35,11 @@ protected: SourceManagerTest() : FileMgr(FileMgrOpts), DiagID(new DiagnosticIDs()), - Diags(DiagID, new IgnoringDiagConsumer()), - SourceMgr(Diags, FileMgr) { - TargetOpts.Triple = "x86_64-apple-darwin11.1.0"; - Target = TargetInfo::CreateTargetInfo(Diags, TargetOpts); + Diags(DiagID, new DiagnosticOptions, new IgnoringDiagConsumer()), + SourceMgr(Diags, FileMgr), + TargetOpts(new TargetOptions) { + TargetOpts->Triple = "x86_64-apple-darwin11.1.0"; + Target = TargetInfo::CreateTargetInfo(Diags, *TargetOpts); } FileSystemOptions FileMgrOpts; @@ -44,7 +48,7 @@ protected: DiagnosticsEngine Diags; SourceManager SourceMgr; LangOptions LangOpts; - TargetOptions TargetOpts; + IntrusiveRefCntPtr<TargetOptions> TargetOpts; IntrusiveRefCntPtr<TargetInfo> Target; }; @@ -64,9 +68,9 @@ TEST_F(SourceManagerTest, isBeforeInTranslationUnit) { FileID mainFileID = SourceMgr.createMainFileIDForMemBuffer(buf); VoidModuleLoader ModLoader; - HeaderSearch HeaderInfo(FileMgr, Diags, LangOpts, &*Target); - Preprocessor PP(Diags, LangOpts, - Target.getPtr(), + HeaderSearch HeaderInfo(new HeaderSearchOptions, FileMgr, Diags, LangOpts, + &*Target); + Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, Target.getPtr(), SourceMgr, HeaderInfo, ModLoader, /*IILookup =*/ 0, /*OwnsHeaderSearch =*/false, @@ -179,9 +183,9 @@ TEST_F(SourceManagerTest, getMacroArgExpandedLocation) { SourceMgr.overrideFileContents(headerFile, headerBuf); VoidModuleLoader ModLoader; - HeaderSearch HeaderInfo(FileMgr, Diags, LangOpts, &*Target); - Preprocessor PP(Diags, LangOpts, - Target.getPtr(), + HeaderSearch HeaderInfo(new HeaderSearchOptions, FileMgr, Diags, LangOpts, + &*Target); + Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, Target.getPtr(), SourceMgr, HeaderInfo, ModLoader, /*IILookup =*/ 0, /*OwnsHeaderSearch =*/false, @@ -276,9 +280,9 @@ TEST_F(SourceManagerTest, isBeforeInTranslationUnitWithMacroInInclude) { SourceMgr.overrideFileContents(headerFile, headerBuf); VoidModuleLoader ModLoader; - HeaderSearch HeaderInfo(FileMgr, Diags, LangOpts, &*Target); - Preprocessor PP(Diags, LangOpts, - Target.getPtr(), + HeaderSearch HeaderInfo(new HeaderSearchOptions, FileMgr, Diags, LangOpts, + &*Target); + Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, Target.getPtr(), SourceMgr, HeaderInfo, ModLoader, /*IILookup =*/ 0, /*OwnsHeaderSearch =*/false, |