[clang] [C++20] [Modules] Introduce reduced BMI (PR #75894)

Iain Sandoe via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 5 01:02:01 PST 2024


================
@@ -830,6 +843,19 @@ class PCHGenerator : public SemaConsumer {
   bool hasEmittedPCH() const { return Buffer->IsComplete; }
 };
 
+class ReducedBMIGenerator : public PCHGenerator {
+public:
+  ReducedBMIGenerator(const Preprocessor &PP, InMemoryModuleCache &ModuleCache,
+                      StringRef OutputFile, std::shared_ptr<PCHBuffer> Buffer,
+                      bool IncludeTimestamps);
+
+  void HandleTranslationUnit(ASTContext &Ctx) override;
+};
+
+/// If the definition may impact the ABI. If yes, we're allowed to eliminate
+/// the definition of D in reduced BMI.
+bool MayDefAffectABI(const Decl *D);
----------------
iains wrote:

Perhaps this would be better named ShouldElideDecl?
I also find the comment a bit confusing - normally if something affects ABI we cannot change it (so I think we really mean that this would introduce a break into the 'module interface ABI').  Maybe the comment could better refer to the bug and/or descriiption of the issue.

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


More information about the cfe-commits mailing list