aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Lex/ModuleDeclStateTest.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2025-04-04 10:11:14 -0700
committerGitHub <noreply@github.com>2025-04-04 10:11:14 -0700
commit1688c3062a56b4fca1f8ad28f2865df0ed8ca940 (patch)
tree54a166397652bb5c96fdd30caabf46765eb06f6e /clang/unittests/Lex/ModuleDeclStateTest.cpp
parent90cf2e31abdee050b5811155c86605935046b07e (diff)
downloadllvm-1688c3062a56b4fca1f8ad28f2865df0ed8ca940.zip
llvm-1688c3062a56b4fca1f8ad28f2865df0ed8ca940.tar.gz
llvm-1688c3062a56b4fca1f8ad28f2865df0ed8ca940.tar.bz2
[clang] Do not share ownership of `PreprocessorOptions` (#133467)
This PR makes it so that `CompilerInvocation` is the sole owner of the `PreprocessorOptions` instance.
Diffstat (limited to 'clang/unittests/Lex/ModuleDeclStateTest.cpp')
-rw-r--r--clang/unittests/Lex/ModuleDeclStateTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/unittests/Lex/ModuleDeclStateTest.cpp b/clang/unittests/Lex/ModuleDeclStateTest.cpp
index 16e726b..5b2719d 100644
--- a/clang/unittests/Lex/ModuleDeclStateTest.cpp
+++ b/clang/unittests/Lex/ModuleDeclStateTest.cpp
@@ -77,11 +77,10 @@ protected:
HeaderInfo.emplace(HSOpts, SourceMgr, Diags, LangOpts, Target.get());
- return std::make_unique<Preprocessor>(
- std::make_shared<PreprocessorOptions>(), Diags, LangOpts, SourceMgr,
- *HeaderInfo, ModLoader,
- /*IILookup =*/nullptr,
- /*OwnsHeaderSearch =*/false);
+ return std::make_unique<Preprocessor>(PPOpts, Diags, LangOpts, SourceMgr,
+ *HeaderInfo, ModLoader,
+ /*IILookup=*/nullptr,
+ /*OwnsHeaderSearch=*/false);
}
void preprocess(Preprocessor &PP, std::unique_ptr<PPCallbacks> C) {
@@ -103,6 +102,7 @@ protected:
TrivialModuleLoader ModLoader;
HeaderSearchOptions HSOpts;
std::optional<HeaderSearch> HeaderInfo;
+ PreprocessorOptions PPOpts;
};
TEST_F(ModuleDeclStateTest, NamedModuleInterface) {