llvm.org GIT mirror llvm / 91b6092
Add handling for GlobalAliases in ExecutionEngine::getConstantValue. Patch by Brad Moody. Thanks Brad! https://reviews.llvm.org/D42160 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333217 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 2 years ago
2 changed file(s) with 17 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
902902 Result.IntVal = cast(C)->getValue();
903903 break;
904904 case Type::PointerTyID:
905 while (auto *A = dyn_cast(C)) {
906 C = A->getAliasee();
907 }
905908 if (isa(C))
906909 Result.PointerVal = nullptr;
907910 else if (const Function *F = dyn_cast(C))
0 ; RUN: %lli -force-interpreter %s
1
2 define i32 @func() {
3 entry:
4 ret i32 0
5 }
6
7 @alias = alias i32 (), i32 ()* @func
8
9 define i32 @main() {
10 entry:
11 %call = call i32 @alias()
12 ret i32 %call
13 }