aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Interpreter/Interpreter.cpp
diff options
context:
space:
mode:
authorAnutosh Bhat <andersonbhat491@gmail.com>2025-10-26 16:07:59 +0530
committerGitHub <noreply@github.com>2025-10-26 10:37:59 +0000
commitff48353aaeb51a5c3ccf6720de9e756c1270ad2f (patch)
tree4bc8dbdfb81123653370c159f5a20df3f6b1420f /clang/lib/Interpreter/Interpreter.cpp
parent792c65c39f9ecf0d1bb36e846583470c492b3fca (diff)
downloadllvm-ff48353aaeb51a5c3ccf6720de9e756c1270ad2f.zip
llvm-ff48353aaeb51a5c3ccf6720de9e756c1270ad2f.tar.gz
llvm-ff48353aaeb51a5c3ccf6720de9e756c1270ad2f.tar.bz2
[clang-repl] Use RegisterPTU for tracking generated TranslationUnitDecl through parse (#164778)
Instead of manually creating and adding a PTU, we should be able to use `RegisterPTU` which does the same job here.
Diffstat (limited to 'clang/lib/Interpreter/Interpreter.cpp')
-rw-r--r--clang/lib/Interpreter/Interpreter.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index b05cb5a..cde354c 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -581,12 +581,7 @@ Interpreter::Parse(llvm::StringRef Code) {
if (!TuOrErr)
return TuOrErr.takeError();
- PTUs.emplace_back(PartialTranslationUnit());
- PartialTranslationUnit &LastPTU = PTUs.back();
- LastPTU.TUPart = *TuOrErr;
-
- if (std::unique_ptr<llvm::Module> M = Act->GenModule())
- LastPTU.TheModule = std::move(M);
+ PartialTranslationUnit &LastPTU = IncrParser->RegisterPTU(*TuOrErr);
return LastPTU;
}