Runtime系列:LLVM的中间代码(IR)【07】

简介: Runtime系列:LLVM的中间代码(IR)

Objective-C在变为机器代码之前,会被LLVM编译器转换为中间代码(Intermediate Representation)


可以使用以下命令行指令生成中间代码:


clang -emit-llvm -S main.m

常用语法简介:


@ - 全局变量

% - 局部变量

alloca - 在当前执行的函数的堆栈帧中分配内存,当该函数返回到其调用者时,将自动释放内存

i32 - 32位4字节的整数

align - 对齐

load - 读出

store - 写入

icmp - 两个整数值比较,返回布尔

br - 选择分支,根据条件来转向label,不根据条件跳转的话类似 goto

label - 代码标签

call - 调用函数


具体参考官方文档:https://llvm.org/docs/LangRef.html


相关文章
|
5月前
|
iOS开发 Perl
解决pod install报错:ffi is an incompatible architecture
解决pod install报错:ffi is an incompatible architecture
145 2
|
5月前
|
编译器 Linux API
BPF的可移植性和CO-RE (Compile Once – Run Everywhere)
BPF的可移植性和CO-RE (Compile Once – Run Everywhere)
52 2
|
5月前
|
机器学习/深度学习 Linux TensorFlow
【Tensorflow 2】解决tensorflow.python.framework.errors_impl.UnknownError: [_Derived_] Fail to find the...
本文解决了在使用TensorFlow 2.0和Keras API时,尝试使用双向LSTM (tf.keras.layers.Bidirectional) 出现的未知错误问题,并提供了三种解决该问题的方法。
80 3
|
机器人 Linux 编译器
替代notepad++,notepad--介绍及插件cmake编译
替代notepad++,notepad--介绍及插件cmake编译
|
并行计算 编译器 TensorFlow
win10 install tensorflow error:Loaded runtime CuDNN library: 7102 but source was compiled with 7005
win10 install tensorflow error:Loaded runtime CuDNN library: 7102 but source was compiled with 7005
174 0
编译OpenJDK11:configure: error: Target CPU mismatch. We are building for x86_64 but CL is for “版“; exp
编译OpenJDK11:configure: error: Target CPU mismatch. We are building for x86_64 but CL is for “版“; exp
175 0
MAC编译OpenJDK8:error: ‘&&‘ within ‘||‘ [-Werror,-Wlogical-op-parentheses]
MAC编译OpenJDK8:error: ‘&&‘ within ‘||‘ [-Werror,-Wlogical-op-parentheses]
105 0
编译OpenJDK12:Target CPU mismatch. We are building for x86_64 but CL is for ""; expected "x64"
编译OpenJDK12:Target CPU mismatch. We are building for x86_64 but CL is for ""; expected "x64"
124 0
编译OpenJDK8:Target CPU mismatch. We are building for x86_64 but CL is for ""; expected "x64"
编译OpenJDK8:Target CPU mismatch. We are building for x86_64 but CL is for ""; expected "x64"
115 0

热门文章

最新文章