[LLVMdev] [LLVM] Modify ConstantArray object contents

Chris Lattner clattner at apple.com
Tue Jan 17 17:32:21 PST 2012


On Jan 17, 2012, at 11:16 AM, Stepan Dyatkovskiy wrote:

> Hi all. Is it allowed to modify ConstantArray object within setOperand 
> method, or it is better to leave old ConstantArray object and create new 
> one?

ConstantArray's are uniqued, so they should definitely *not* be mutated with setOperand.  You should create a new one with ConstantArray::get with the updated elements.

-Chris



More information about the llvm-dev mailing list