LLVM - 为什么@a 是 i32* 的类型
LLVM - why @a is type of i32*
我不明白为什么 @a
是 i32*
的类型。有人可以给我解释一下吗?
@a = internal global i32 0
define i32 @main() {
store i32 42, i32* @a
%1 = load i32* @a
ret i32 %1
}
来自 the language reference(强调我的):
Global variables define regions of memory allocated at compilation time instead of run-time.
[...]
As SSA values, global variables define pointer values that are in scope (i.e. they dominate) all basic blocks in the program. Global variables always define a pointer to their “content” type because they describe a region of memory, and all memory objects in LLVM are accessed through pointers.
我不明白为什么 @a
是 i32*
的类型。有人可以给我解释一下吗?
@a = internal global i32 0
define i32 @main() {
store i32 42, i32* @a
%1 = load i32* @a
ret i32 %1
}
来自 the language reference(强调我的):
Global variables define regions of memory allocated at compilation time instead of run-time.
[...]
As SSA values, global variables define pointer values that are in scope (i.e. they dominate) all basic blocks in the program. Global variables always define a pointer to their “content” type because they describe a region of memory, and all memory objects in LLVM are accessed through pointers.