[PATCH] D127284: [clang-repl] Support statements on global scope in incremental mode.

Vassil Vassilev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 30 07:53:42 PST 2022


v.g.vassilev marked an inline comment as done.
v.g.vassilev added inline comments.


================
Comment at: clang/lib/Parse/Parser.cpp:1032-1034
+    // FIXME: Remove the incremental processing pre-condition and verify clang
+    // still can pass its test suite, which will harden
+    // `isDeclarationStatement`.
----------------
rsmith wrote:
> v.g.vassilev wrote:
> > rsmith wrote:
> > > Have you tried this with the latest version of the patch? Can the FIXME be removed?
> > I have tried. The failures are a couple of hundred now. However, the failing tests are due to the fact that the tests check for expected diagnostics from ill-formed code. There the decisions if something that's a statement or a declaration are harder and sometimes we produce unexpected diagnostics. I am not sure if we should be fixing the test files.
> > 
> > I will investigate more thoroughly but I have removed the FIXME as the majority of the failures are resolved by the current version of the patch.
> OK, I think that's reasonable. I think it would be interesting to try building some non-trivial C++ code, perhaps bootstrapping Clang, with `-Xclang -fincremental-extensions`, as a check for whether there are any cases where we disambiguate a valid top-level declaration as a statement. But I don't think that should be a blocker for landing this patch.
I don't want to hold off that patch any longer as well. 

I started looking into that. Currently I have decided to track it here https://reviews.llvm.org/D139016 as some of the changes might require further review/discussion. 

Parsing things seems fine, I get up to libSupport but then there are some linker failures I need to investigate. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127284/new/

https://reviews.llvm.org/D127284



More information about the cfe-commits mailing list