Skip to content

Commit 0a3a919

Browse files
hahnjotru
authored andcommitted
[CodeGen] Restrict addEmittedDeferredDecl to incremental extensions
Reemission is only needed in incremental mode. With this early return, we avoid overhead from addEmittedDeferredDecl in non-incremental mode. Differential Revision: https://reviews.llvm.org/D157379 (cherry picked from commit d43a3d6)
1 parent 3a38e93 commit 0a3a919

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/lib/CodeGen/CodeGenModule.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,10 @@ class CodeGenModule : public CodeGenTypeCache {
361361
llvm::DenseMap<llvm::StringRef, GlobalDecl> EmittedDeferredDecls;
362362

363363
void addEmittedDeferredDecl(GlobalDecl GD) {
364+
// Reemission is only needed in incremental mode.
365+
if (!Context.getLangOpts().IncrementalExtensions)
366+
return;
367+
364368
// Assume a linkage by default that does not need reemission.
365369
auto L = llvm::GlobalValue::ExternalLinkage;
366370
if (llvm::isa<FunctionDecl>(GD.getDecl()))

0 commit comments

Comments
 (0)