The constructor for Value class is declared as follows:
Value::Value ( Type * Ty,
unsigned scid
)
What is scid here and what values should be passed to it ?
The constructor for Value class is declared as follows:
Value::Value ( Type * Ty,
unsigned scid
)
What is scid here and what values should be passed to it ?
You never construct a Value
directly, only one of its subclasses. So you almost certainly don’t need to worry about scid
.
Instead, the ways you generally get Value
s are:
Instruction
is a Value
(i.e. the value of its result). So using IRBuilder::CreateWhatever
calls to create instructions and insert them into blocks is common.Constant
is its own separate hierarchy, but also already a value, so you often see things like ConstantInt::get(...)
.Constant
too, but they live inside a Module
so you usually use Module::getOrInsertWhatever(...)
to create these.