I have a MDNode, and one of its operand is an int. I'd like to assign a new int value to that operand during the llvm optimization. What is the right way to do this ? (There is no setOperand() with MDNode class.) Junjie
On Jun 7, 2010, at 3:35 PM, Junjie Gu wrote:> I have a MDNode, and one of its operand is an int. I'd like to > assign a new int value to that operand during the llvm optimization. > What is the right way to do this ? (There is no setOperand() with > MDNode class.)Hi Junjie, MDNodes are uniqued, so you can't change them. Just make a new MDNode with the new operand list you want. -Chris
Hi Chris, Thanks. Junjie On Tue, Jun 8, 2010 at 9:33 AM, Chris Lattner <clattner at apple.com> wrote:> > On Jun 7, 2010, at 3:35 PM, Junjie Gu wrote: > >> I have a MDNode, and one of its operand is an int. I'd like to >> assign a new int value to that operand during the llvm optimization. >> What is the right way to do this ? (There is no setOperand() with >> MDNode class.) > > Hi Junjie, > > MDNodes are uniqued, so you can't change them. Just make a new MDNode with the new operand list you want. > > -Chris