LLVM每日谈之五十 LLVM 后端文档解析3 —目标描述类

栏目: 服务器 · 编程工具 · 发布时间: 5年前

内容简介:前文理清楚了六大部分、七大环节和七大步骤的对应关系。那么我们接下来要深入的去分析:Target description classes的1、Target description classes,作为LLVM后端六大部分的第一大部分,主要是提供目标机器的一个抽象描述,不依赖于任何特定的客户端。

前文理清楚了六大部分、七大环节和七大步骤的对应关系。那么我们接下来要深入的去分析: Target description classes : abstract target description interfaces (代码地址:include/llvm/Target/)。

Target description classes的 特点 主要有以下几点:

1、Target description classes,作为LLVM后端六大部分的第一大部分,主要是提供目标机器的一个抽象描述,不依赖于任何特定的客户端。

2、Target description classes所包含的类,是设计来捕捉目标的抽象特性,和具体的代码生成算法没有任何关系。

3、所有的Target description classes(除了DataLayout之外),都是设计来做具体目标实现的父类的(具体的目标实现要实现这些类的子类),所以这些类的实现都是虚函数实现的。

4、TargetMachine类是目标机器的完整机器描述的初始入口,通过该接口可以获取特定目标的所有信息。(Primary interface to the complete machine description for the target machine. All target-specific information should be accessible through this interface.)该类包含了一系列的get*Info 虚函数,以便获目标机器的相关信息,这些虚函数在具体的目标机器实现的时候会做具体实现。

总结起来,在所有的Target description classes中,TargetMachine和DataLayout是比较特殊的。TargetMachine是访问具体目标机器实现的一个最初入口,包含了大量可以访问具体目标机器信息的接口。而DataLayout是Target description classes类中唯一不可扩展的,存放在include/llvm/IR/DataLayout.h 。具体代码: DataLayout.h

在Target description classes中,除了 TargetMachineDataLayout 两个比较特殊的类之外,还有如下一些类:

TargetLowering (include/llvm/Codegen/TargetLowering.h)

TargetRegisterInfo (include/llvm/CodeGen/TargetRegisterInfo.h)

TargetInstrInfo (include/llvm/CodeGen/TargetInstrInfo.h)

TargetFrameLowering (include/llvm/CodeGen/TargetFrameLowering.h)

TargetSubtarget (目前已经没有TargetSubtarget类,只有 TargetSubtargetInfo 类,地址为:include/llvm/CodeGen/TargetSubtargetInfo.h)

TargetJITInfo (目前已经没有TargetJITInfo类)

---------------------------------------------------------------------------------------

注意!注意!注意!

文档没有跟上最新的代码变动。所以,我们提到的 Target description classes 的代码地址:include/llvm/Target/,已经完全不适用了。我们目前除了TargetMachine类还在这里之外,其他的类已经都换地方了。多数类移动到了include/llvm/CodeGen/目录之下,提交节点为: rL318490


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Learn Python 3 the Hard Way

Learn Python 3 the Hard Way

Zed A. Shaw / Addison / 2017-7-7 / USD 30.74

You Will Learn Python 3! Zed Shaw has perfected the world’s best system for learning Python 3. Follow it and you will succeed—just like the millions of beginners Zed has taught to date! You bring t......一起来看看 《Learn Python 3 the Hard Way》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换