[PATCH] D104918: [clang-repl] Implement partial translation units and error recovery.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 29 13:57:02 PDT 2021


rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

I'm (happily) surprised this required so few changes!



================
Comment at: clang/include/clang/Basic/LangOptions.h:690-691
+
+  /// The translation unit is a partial translation unit, growing incrementally.
+  TU_Partial
 };
----------------
I don't think this is clear enough about the difference between `TU_Prefix` and `TU_Partial`. I think the difference is:

* `TU_Prefix` is an incomplete prefix of a translation unit. Because it's not complete, we don't perform (most) finalization steps (eg, template instantiation) at the end.
* `TU_Partial` is a complete translation unit that we might nonetheless incrementally extend later. Because it is complete (and we might want to generate code for it), we do perform template instantiation, but because it might be extended later, we don't warn if it declares or uses undefined internal-linkage symbols.

I wonder if `TU_Incremental` would be a better name than `TU_Partial`.


Repository:
  rC Clang

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

https://reviews.llvm.org/D104918



More information about the cfe-commits mailing list