From: Chris Lattner Date: Wed, 28 Oct 2009 04:12:16 +0000 (+0000) Subject: 'static const void *X = &&y' can only be put in the X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5d81befc217bdd89ec17979797cfa297985e79d7;p=oota-llvm.git '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 --- diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index c2402da257b..31d850cfc0e 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(this)) + return BA->getFunction()->getRelocationInfo(); + PossibleRelocationsTy Result = NoRelocation; for (unsigned i = 0, e = getNumOperands(); i != e; ++i) Result = std::max(Result, getOperand(i)->getRelocationInfo());