[PATCH] Make ExecutionEngine::getPointerToGlobal understand GlobalAlias

Yaron Keren yaron.keren at gmail.com
Sun Jun 22 03:06:57 PDT 2014


ExecutionEngine::getPointerToGlobal gets to unreachable if passed a GlobalAlias.

http://reviews.llvm.org/D4245

Files:
  lib/ExecutionEngine/ExecutionEngine.cpp

Index: lib/ExecutionEngine/ExecutionEngine.cpp
===================================================================
--- lib/ExecutionEngine/ExecutionEngine.cpp
+++ lib/ExecutionEngine/ExecutionEngine.cpp
@@ -865,6 +865,9 @@
     report_fatal_error(OS.str());
   }
 
+  if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(C))
+    return getConstantValue(GA->getAliasee());
+
   // Otherwise, we have a simple constant.
   GenericValue Result;
   switch (C->getType()->getTypeID()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4245.10729.patch
Type: text/x-patch
Size: 480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140622/562c1533/attachment.bin>


More information about the llvm-commits mailing list