]> granicus.if.org Git - clang/commit
CodeGen: Do not give local-linkage functions externally available linkage, even tempo...
authorPeter Collingbourne <peter@pcc.me.uk>
Wed, 1 Jul 2015 02:10:26 +0000 (02:10 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 1 Jul 2015 02:10:26 +0000 (02:10 +0000)
commitcbbee9496cc7535e78f4b864812326495c98d779
tree07f45f5590e526c6b6308112b6f6d7857b45c376
parent21fee9f9985e692cac70a891a56a7c80479e91d6
CodeGen: Do not give local-linkage functions externally available linkage, even temporarily.

When an internal-linkage thunk is code gen'd, CodeGenVTables::emitThunk
will first be called with ForVTable=true (which incorrectly set the
thunk's linkage to available_externally under the Itanium ABI) and later
with ForVTable=false (which reset it to internal). Because we will always
see a call with ForVTable=false, this incorrect linkage never ended up in
the final IR. However, the temporary presence of this linkage caused us
to give such functions a comdat as a result of code introduced in r241102.
To avoid this, check that the thunk is externally visible before giving it
available_externally linkage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241136 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/ItaniumCXXABI.cpp
test/CodeGenCXX/thunks.cpp