[PATCH] Make ExecutionEngine::getPointerToGlobal understand GlobalAlias

David Blaikie dblaikie at gmail.com
Sun Jun 22 06:52:12 PDT 2014


Any chance of a test? (I know JIT stuff isn't the most testable)
On Jun 22, 2014 3:10 AM, "Yaron Keren" <yaron.keren at gmail.com> wrote:

> 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()) {
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140622/0aec7d65/attachment.html>


More information about the llvm-commits mailing list