[PATCH] D148723: [clang] Enforce external linkage for inline builtin original declaration

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 19 06:27:51 PDT 2023


serge-sans-paille added a comment.

> So if isInlineBuiltinDeclaration() simply returns false for C++ code, everything should just work, without messing with the linkage.

Unfortunately not. See the example from `clang/test/CodeGen/inline-builtin-comdat.c` above. There's no C++ involved, the actual issue is that the initial Global Declacaration is stripped from its body which is moved to it's `.inline` suffixed version. But during codegen, if we don't take into account the fact that it's an inline builtin, we still put it in a COMDAT (because it's *inline*) while it shouldn't (because it's a declaration. I've uploaded a new patch that should be slightly less intrusive.


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

https://reviews.llvm.org/D148723



More information about the cfe-commits mailing list