diff options
author | Lang Hames <lhames@gmail.com> | 2018-05-24 19:07:34 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2018-05-24 19:07:34 +0000 |
commit | 7d60b9052a4a5d7d6e2baef09ac790a88c5e2214 (patch) | |
tree | 7b5c59be6137e4f86b347363b6d01af73c33f979 /llvm/lib/ExecutionEngine/ExecutionEngine.cpp | |
parent | 80968a9aba7560d7ccad36639ec4c9586d3f461c (diff) | |
download | bcm5719-llvm-7d60b9052a4a5d7d6e2baef09ac790a88c5e2214.tar.gz bcm5719-llvm-7d60b9052a4a5d7d6e2baef09ac790a88c5e2214.zip |
Add handling for GlobalAliases in ExecutionEngine::getConstantValue.
Patch by Brad Moody. Thanks Brad!
https://reviews.llvm.org/D42160
llvm-svn: 333217
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index dae0ea89420..ae96c7f5955 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -903,6 +903,9 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) { Result.IntVal = cast<ConstantInt>(C)->getValue(); break; case Type::PointerTyID: + while (auto *A = dyn_cast<GlobalAlias>(C)) { + C = A->getAliasee(); + } if (isa<ConstantPointerNull>(C)) Result.PointerVal = nullptr; else if (const Function *F = dyn_cast<Function>(C)) |