summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-c-test/helpers.c
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2016-11-11 21:39:26 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2016-11-11 21:39:26 +0000
commit1fe189d79585b5d1aea84e6c2f3eca781e21f32f (patch)
treed801eb0cc1d5e5e479e622b0115f29d2bc1131e3 /llvm/tools/llvm-c-test/helpers.c
parentd4372f783b52919c569f3e2007e3ba9edb45c7fb (diff)
downloadbcm5719-llvm-1fe189d79585b5d1aea84e6c2f3eca781e21f32f.tar.gz
bcm5719-llvm-1fe189d79585b5d1aea84e6c2f3eca781e21f32f.zip
[cfi] Fix weak functions handling.
When a function pointer is replaced with a jumptable pointer, special case is needed to preserve the semantics of extern_weak functions. Since a jumptable entry can not be extern_weak, we emulate that behaviour by replacing all references to F (the extern_weak function) with the following expression: F != nullptr ? JumpTablePtr : nullptr. Extra special care is needed for global initializers, since most (or probably all) backends can not lower an initializer that includes this kind of constant expression. Initializers like that are replaced with a global constructor (i.e. a runtime initializer). llvm-svn: 286636
Diffstat (limited to 'llvm/tools/llvm-c-test/helpers.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud