diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-28 04:12:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-28 04:12:16 +0000 |
commit | 4fa8f3294b576c0406061df2778cdc1983693f2c (patch) | |
tree | eec27098791cc9ff86cd738f9f366db04488c53e /lib/VMCore | |
parent | ed7cc32565a72f3a40d03cfc7e313515bca7b9e2 (diff) | |
download | external_llvm-4fa8f3294b576c0406061df2778cdc1983693f2c.zip external_llvm-4fa8f3294b576c0406061df2778cdc1983693f2c.tar.gz external_llvm-4fa8f3294b576c0406061df2778cdc1983693f2c.tar.bz2 |
'static const void *X = &&y' can only be put in the
readonly section if a reference to the containing function
is valid in the readonly section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85370 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Constants.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index c2402da..31d850c 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -182,6 +182,9 @@ Constant::PossibleRelocationsTy Constant::getRelocationInfo() const { return GlobalRelocations; // Global reference. } + if (const BlockAddress *BA = dyn_cast<BlockAddress>(this)) + return BA->getFunction()->getRelocationInfo(); + PossibleRelocationsTy Result = NoRelocation; for (unsigned i = 0, e = getNumOperands(); i != e; ++i) Result = std::max(Result, getOperand(i)->getRelocationInfo()); |