源码路径
llvm\include\llvm\IR\Constant.h
llvm Constant class
在llvm中,用Constant类作为所有常量的基类,代表值不会在运行时发生变化。
Constant类定义如下,可以看到Constant类继承自User,因为Constant会引用其他Value,也会被其他Value引用。
class Constant : public User {
};
Constant类继承树如下:
ConstantData:简单常量,如int,float等。
ConstantAggregate:复合常量,如struct,array等。
BlockAddress:BasicBlock的地址。
ConstantExpr:常量表达式。
GlobalValue:全局常量值,如全局变量等。