[PATCH] D157379: [CodeGen] Restrict addEmittedDeferredDecl to incremental extensions

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 17 02:55:10 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGd43a3d634696: [CodeGen] Restrict addEmittedDeferredDecl to incremental extensions (authored by Hahnfeld).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157379

Files:
  clang/lib/CodeGen/CodeGenModule.h


Index: clang/lib/CodeGen/CodeGenModule.h
===================================================================
--- clang/lib/CodeGen/CodeGenModule.h
+++ clang/lib/CodeGen/CodeGenModule.h
@@ -361,6 +361,10 @@
   llvm::DenseMap<llvm::StringRef, GlobalDecl> EmittedDeferredDecls;
 
   void addEmittedDeferredDecl(GlobalDecl GD) {
+    // Reemission is only needed in incremental mode.
+    if (!Context.getLangOpts().IncrementalExtensions)
+      return;
+
     // Assume a linkage by default that does not need reemission.
     auto L = llvm::GlobalValue::ExternalLinkage;
     if (llvm::isa<FunctionDecl>(GD.getDecl()))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157379.551058.patch
Type: text/x-patch
Size: 617 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230817/5f069167/attachment-0001.bin>


More information about the cfe-commits mailing list