分享

llvm libLLVMCore源码分析 15 - Constant Class

 码农书馆 2024-01-08 发布于上海

源码路径

llvm\include\llvm\IR\Constant.h

llvm Constant class

在llvm中,用Constant类作为所有常量的基类,代表值不会在运行时发生变化。

Constant类定义如下,可以看到Constant类继承自User,因为Constant会引用其他Value,也会被其他Value引用。

  1. class Constant : public User {
  2. };

Constant类继承树如下:

ConstantData:简单常量,如int,float等。

ConstantAggregate:复合常量,如struct,array等。

BlockAddress:BasicBlock的地址。

ConstantExpr:常量表达式。

GlobalValue:全局常量值,如全局变量等。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多