- 
                Notifications
    You must be signed in to change notification settings 
- Fork 15k
[clang-repl] Use RegisterPTU for tracking generated TranslationUnitDecl through parse #164778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @llvm/pr-subscribers-clang Author: Anutosh Bhat (anutosh491) ChangesFull diff: https://github.com/llvm/llvm-project/pull/164778.diff 1 Files Affected: 
 diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index b05cb5a0f1dbe..cde354c9cd8d1 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;
 }
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| LLVM Buildbot has detected a new failure on builder  Full details are available at: https://lab.llvm.org/buildbot/#/builders/55/builds/19167 Here is the relevant piece of the build log for the reference | 
…cl through parse (llvm#164778) Instead of manually creating and adding a PTU, we should be able to use `RegisterPTU` which does the same job here.
…cl through parse (llvm#164778) Instead of manually creating and adding a PTU, we should be able to use `RegisterPTU` which does the same job here.
…cl through parse (llvm#164778) Instead of manually creating and adding a PTU, we should be able to use `RegisterPTU` which does the same job here.
…cl through parse (llvm#164778) Instead of manually creating and adding a PTU, we should be able to use `RegisterPTU` which does the same job here.
Instead of manually creating and adding a PTU, we should be able to use
RegisterPTUwhich does the same job here.