[clang] [clang] Remove dead incremental Parser code (PR #102450)

via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 8 03:54:07 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Jonas Hahnfeld (hahnjo)

<details>
<summary>Changes</summary>

When incremental processing is enabled, the Parser will never report `tok::eof` but `tok::annot_repl_input_end`. However, that case is already taken care of in `IncrementalParser::ParseOrWrapTopLevelDecl()` so this check was never executing.

---
Full diff: https://github.com/llvm/llvm-project/pull/102450.diff


1 Files Affected:

- (modified) clang/lib/Parse/Parser.cpp (-5) 


``````````diff
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index 5ebe71e496a2e8..04c2f1d380bc48 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -629,11 +629,6 @@ bool Parser::ParseTopLevelDecl(DeclGroupPtrTy &Result,
                                Sema::ModuleImportState &ImportState) {
   DestroyTemplateIdAnnotationsRAIIObj CleanupRAII(*this);
 
-  // Skip over the EOF token, flagging end of previous input for incremental
-  // processing
-  if (PP.isIncrementalProcessingEnabled() && Tok.is(tok::eof))
-    ConsumeToken();
-
   Result = nullptr;
   switch (Tok.getKind()) {
   case tok::annot_pragma_unused:

``````````

</details>


https://github.com/llvm/llvm-project/pull/102450


More information about the cfe-commits mailing list