summaryrefslogtreecommitdiff
path: root/unittests/Basic/SourceManagerTest.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-05-02 03:43:30 +0000
committerAlp Toker <alp@nuanti.com>2014-05-02 03:43:30 +0000
commite36c959c4dca91ff6d63f59a912a1240b846e19d (patch)
tree5402652c5e3bbc43e9f801e97eb81f0028ac57c3 /unittests/Basic/SourceManagerTest.cpp
parent850a105f72797a8e194a2b139432f63d9037cbd3 (diff)
downloadclang-e36c959c4dca91ff6d63f59a912a1240b846e19d.tar.gz
Factor TargetInfo pointer/DelayInitialization bool pair out of Preprocessor ctor
The Preprocessor::Initialize() function already offers a clear interface to achieve this, further reducing the confusing number of states a newly constructed preprocessor can have. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207825 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Basic/SourceManagerTest.cpp')
-rw-r--r--unittests/Basic/SourceManagerTest.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/unittests/Basic/SourceManagerTest.cpp b/unittests/Basic/SourceManagerTest.cpp
index 88c3fb76ca..5f39bd41f6 100644
--- a/unittests/Basic/SourceManagerTest.cpp
+++ b/unittests/Basic/SourceManagerTest.cpp
@@ -80,11 +80,11 @@ TEST_F(SourceManagerTest, isBeforeInTranslationUnit) {
VoidModuleLoader ModLoader;
HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, LangOpts,
&*Target);
- Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, Target.getPtr(),
+ Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts,
SourceMgr, HeaderInfo, ModLoader,
/*IILookup =*/ 0,
- /*OwnsHeaderSearch =*/false,
- /*DelayInitialization =*/ false);
+ /*OwnsHeaderSearch =*/false);
+ PP.Initialize(*Target);
PP.EnterMainSourceFile();
std::vector<Token> toks;
@@ -195,11 +195,11 @@ TEST_F(SourceManagerTest, getMacroArgExpandedLocation) {
VoidModuleLoader ModLoader;
HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, LangOpts,
&*Target);
- Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, Target.getPtr(),
+ Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts,
SourceMgr, HeaderInfo, ModLoader,
/*IILookup =*/ 0,
- /*OwnsHeaderSearch =*/false,
- /*DelayInitialization =*/ false);
+ /*OwnsHeaderSearch =*/false);
+ PP.Initialize(*Target);
PP.EnterMainSourceFile();
std::vector<Token> toks;
@@ -293,11 +293,11 @@ TEST_F(SourceManagerTest, isBeforeInTranslationUnitWithMacroInInclude) {
VoidModuleLoader ModLoader;
HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, LangOpts,
&*Target);
- Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, Target.getPtr(),
+ Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts,
SourceMgr, HeaderInfo, ModLoader,
/*IILookup =*/ 0,
- /*OwnsHeaderSearch =*/false,
- /*DelayInitialization =*/ false);
+ /*OwnsHeaderSearch =*/false);
+ PP.Initialize(*Target);
std::vector<MacroAction> Macros;
PP.addPPCallbacks(new MacroTracker(Macros));