This does not conceptually belongs here. Instead provide a shortcut
getModule() that provides access to the DataLayout.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM with perhaps a comment of "this can crash if parent is null, don't call this without a parent" or something. Up to you on the comment :)
-eric
Comment Actions
Thanks.
Note there is already a comment in the Doxygen.
This one for the BasicBlock:
/// Note: this is undefined behavior if the block does not have a parent.
And this one for the instruction:
/// Note: this is undefined behavior if the instruction does not have a /// parent, or the parent basic block does not have a parent function.
—
Mehdi