Skip to content

Commit ff48353

Browse files
authored
[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.
1 parent 792c65c commit ff48353

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

clang/lib/Interpreter/Interpreter.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -581,12 +581,7 @@ Interpreter::Parse(llvm::StringRef Code) {
581581
if (!TuOrErr)
582582
return TuOrErr.takeError();
583583

584-
PTUs.emplace_back(PartialTranslationUnit());
585-
PartialTranslationUnit &LastPTU = PTUs.back();
586-
LastPTU.TUPart = *TuOrErr;
587-
588-
if (std::unique_ptr<llvm::Module> M = Act->GenModule())
589-
LastPTU.TheModule = std::move(M);
584+
PartialTranslationUnit &LastPTU = IncrParser->RegisterPTU(*TuOrErr);
590585

591586
return LastPTU;
592587
}

0 commit comments

Comments
 (0)