[llvm-commits] [llvm] r85370 - /llvm/trunk/lib/VMCore/Constants.cpp
Chris Lattner
sabre at nondot.org
Tue Oct 27 21:12:24 PDT 2009
Author: lattner
Date: Tue Oct 27 23:12:16 2009
New Revision: 85370
URL: http://llvm.org/viewvc/llvm-project?rev=85370&view=rev
Log:
'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.
Modified:
llvm/trunk/lib/VMCore/Constants.cpp
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=85370&r1=85369&r2=85370&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Tue Oct 27 23:12:16 2009
@@ -182,6 +182,9 @@
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());
More information about the llvm-commits
mailing list