@@ -136,12 +136,11 @@ TEST_F(SourceManagerTest, isBeforeInTranslationUnit) {
136
136
SourceMgr.setMainFileID (mainFileID);
137
137
138
138
HeaderSearchOptions HSOpts;
139
+ PreprocessorOptions PPOpts;
139
140
TrivialModuleLoader ModLoader;
140
141
HeaderSearch HeaderInfo (HSOpts, SourceMgr, Diags, LangOpts, &*Target);
141
- Preprocessor PP (std::make_shared<PreprocessorOptions>(), Diags, LangOpts,
142
- SourceMgr, HeaderInfo, ModLoader,
143
- /* IILookup =*/ nullptr ,
144
- /* OwnsHeaderSearch =*/ false );
142
+ Preprocessor PP (PPOpts, Diags, LangOpts, SourceMgr, HeaderInfo, ModLoader,
143
+ /* IILookup =*/ nullptr , /* OwnsHeaderSearch =*/ false );
145
144
PP.Initialize (*Target);
146
145
PP.EnterMainSourceFile ();
147
146
@@ -186,12 +185,11 @@ TEST_F(SourceManagerTest, isBeforeInTranslationUnitWithTokenSplit) {
186
185
SourceMgr.createFileID (llvm::MemoryBuffer::getMemBuffer (main)));
187
186
188
187
HeaderSearchOptions HSOpts;
188
+ PreprocessorOptions PPOpts;
189
189
TrivialModuleLoader ModLoader;
190
190
HeaderSearch HeaderInfo (HSOpts, SourceMgr, Diags, LangOpts, &*Target);
191
- Preprocessor PP (std::make_shared<PreprocessorOptions>(), Diags, LangOpts,
192
- SourceMgr, HeaderInfo, ModLoader,
193
- /* IILookup =*/ nullptr ,
194
- /* OwnsHeaderSearch =*/ false );
191
+ Preprocessor PP (PPOpts, Diags, LangOpts, SourceMgr, HeaderInfo, ModLoader,
192
+ /* IILookup=*/ nullptr , /* OwnsHeaderSearch=*/ false );
195
193
PP.Initialize (*Target);
196
194
PP.EnterMainSourceFile ();
197
195
llvm::SmallString<8 > Scratch;
@@ -462,11 +460,10 @@ TEST_F(SourceManagerTest, ResetsIncludeLocMap) {
462
460
auto ParseFile = [&] {
463
461
TrivialModuleLoader ModLoader;
464
462
HeaderSearchOptions HSOpts;
463
+ PreprocessorOptions PPOpts;
465
464
HeaderSearch HeaderInfo (HSOpts, SourceMgr, Diags, LangOpts, &*Target);
466
- Preprocessor PP (std::make_shared<PreprocessorOptions>(), Diags, LangOpts,
467
- SourceMgr, HeaderInfo, ModLoader,
468
- /* IILookup =*/ nullptr ,
469
- /* OwnsHeaderSearch =*/ false );
465
+ Preprocessor PP (PPOpts, Diags, LangOpts, SourceMgr, HeaderInfo, ModLoader,
466
+ /* IILookup=*/ nullptr , /* OwnsHeaderSearch=*/ false );
470
467
PP.Initialize (*Target);
471
468
PP.EnterMainSourceFile ();
472
469
PP.LexTokensUntilEOF ();
@@ -538,13 +535,12 @@ TEST_F(SourceManagerTest, getMacroArgExpandedLocation) {
538
535
SourceMgr.overrideFileContents (headerFile, std::move (HeaderBuf));
539
536
540
537
HeaderSearchOptions HSOpts;
538
+ PreprocessorOptions PPOpts;
541
539
TrivialModuleLoader ModLoader;
542
540
HeaderSearch HeaderInfo (HSOpts, SourceMgr, Diags, LangOpts, &*Target);
543
541
544
- Preprocessor PP (std::make_shared<PreprocessorOptions>(), Diags, LangOpts,
545
- SourceMgr, HeaderInfo, ModLoader,
546
- /* IILookup =*/ nullptr ,
547
- /* OwnsHeaderSearch =*/ false );
542
+ Preprocessor PP (PPOpts, Diags, LangOpts, SourceMgr, HeaderInfo, ModLoader,
543
+ /* IILookup=*/ nullptr , /* OwnsHeaderSearch=*/ false );
548
544
// Ensure we can get expanded locations in presence of implicit includes.
549
545
// These are different than normal includes since predefines buffer doesn't
550
546
// have a valid insertion location.
@@ -657,12 +653,11 @@ TEST_F(SourceManagerTest, isBeforeInTranslationUnitWithMacroInInclude) {
657
653
SourceMgr.overrideFileContents (headerFile, std::move (HeaderBuf));
658
654
659
655
HeaderSearchOptions HSOpts;
656
+ PreprocessorOptions PPOpts;
660
657
TrivialModuleLoader ModLoader;
661
658
HeaderSearch HeaderInfo (HSOpts, SourceMgr, Diags, LangOpts, &*Target);
662
- Preprocessor PP (std::make_shared<PreprocessorOptions>(), Diags, LangOpts,
663
- SourceMgr, HeaderInfo, ModLoader,
664
- /* IILookup =*/ nullptr ,
665
- /* OwnsHeaderSearch =*/ false );
659
+ Preprocessor PP (PPOpts, Diags, LangOpts, SourceMgr, HeaderInfo, ModLoader,
660
+ /* IILookup=*/ nullptr , /* OwnsHeaderSearch=*/ false );
666
661
PP.Initialize (*Target);
667
662
668
663
std::vector<MacroAction> Macros;
0 commit comments