OSDN Git Service

Allow dso_local on ifunc.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 12 Jan 2018 17:03:43 +0000 (17:03 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 12 Jan 2018 17:03:43 +0000 (17:03 +0000)
commit41f99d789571ea41e49634397888730805b5c90b
tree648839ce8170828d7773412805375f473511d4d1
parent379dc2786ea64d44f96b61a7569b96803392dd8a
Allow dso_local on ifunc.

It was never fully disallowed. We were rejecting it in the asm parser,
but not in the verifier.

Currently TargetMachine::shouldAssumeDSOLocal returns true for hidden
ifuncs. I considered changing it and moving the check from the asm
parser to the verifier.

The reason for deciding to allow it instead is that all linkers handle
a direct reference just fine. They use the plt address as the address
of the function. In fact doing that means that clang doesn't have the
same bug as gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83782.

This patch then removes the check from the asm parser and updates the
bitcode reader and writer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322378 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/GlobalValue.h
lib/AsmParser/LLParser.cpp
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp
test/Assembler/ifunc-dsolocal.ll [moved from test/Assembler/ifunc-dsolocal-daig.ll with 50% similarity]