[CodeGen] Restrict addEmittedDeferredDecl to incremental extensions
authorJonas Hahnfeld <jonas.hahnfeld@cern.ch>
Tue, 8 Aug 2023 09:25:17 +0000 (11:25 +0200)
committerTobias Hieta <tobias@hieta.se>
Mon, 21 Aug 2023 08:05:22 +0000 (10:05 +0200)
commit0a3a9197247edbd33803a3691efa513ac228860f
tree2bc5c3ecfd9ca08d3a34fe7668be83e642ec860e
parent3a38e93ee086ad7946b70fa103aac6dda16a72aa
[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 d43a3d6346961e639e29b8083b262416889e78ec)
clang/lib/CodeGen/CodeGenModule.h