'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
This commit is contained in:
Chris Lattner 2009-10-28 04:12:16 +00:00
parent 6688d61797
commit 5d81befc21

View File

@ -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());