Ensure target-multiversioning emits deferred declarations
authorErich Keane <erich.keane@intel.com>
Tue, 20 Apr 2021 14:35:57 +0000 (07:35 -0700)
committerErich Keane <erich.keane@intel.com>
Tue, 20 Apr 2021 15:10:26 +0000 (08:10 -0700)
commit0ed613612c5daa047e639877b1c24b36f6069384
tree9a41d9261c3c9b39d44e66ed557132285b9f9d2e
parent83a25a101051b404bec1a5ba9cb867705f31262d
Ensure target-multiversioning emits deferred declarations

As reported in PR50025, sometimes we would end up not emitting functions
needed by inline multiversioned variants. This is because we typically
use the 'deferred decl' mechanism to emit these.  However, the variants
are emitted after that typically happens.  This fixes that by ensuring
we re-run deferred decls after this happens. Also, the multiversion
emission is done recursively to ensure that MV functions that require
other MV functions to be emitted get emitted.
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGen/attr-target-mv.c