[all-commits] [llvm/llvm-project] b719e4: [CodeGen] Clean up access to EmittedDeferredDecls, ...

Jonas Hahnfeld via All-commits all-commits at lists.llvm.org
Thu Aug 17 01:53:30 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b719e410781ce9f3a2b316afea31c156bf99e036
  Author: Jonas Hahnfeld <jonas.hahnfeld at cern.ch>
  Date:   2023-08-17 (Thu, 17 Aug 2023)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/CodeGenModule.h

  Log Message:
  [CodeGen] Clean up access to EmittedDeferredDecls, NFCI.

GlobalDecls should only be added to EmittedDeferredDecls if they
need reemission. This is checked in addEmittedDeferredDecl, which
is called via addDeferredDeclToEmit. Extend these checks to also
handle VarDecls (for lambdas, as tested in Interpreter/lambda.cpp)
and remove the direct access of EmittedDeferredDecls in EmitGlobal
that may actually end up duplicating FunctionDecls.

Differential Revision: https://reviews.llvm.org/D156897

More information about the All-commits mailing list