embedded metadata

I have a quick question about embedded metadata. I've lost track of exactly what we want to support.

What about making MDNodes that refer to Instructions? Is that desired any more, or is that obsolete? I had a patch to do this locally and I either want to fix it up and commit it or discard it.

The relevant section of my locally modified test/Feature/embeddedmetadata.ll reads:

define void @foo() {
   ;; Intrinsic using MDNode and MDString
   %x = call i8 @llvm.something(metadata !21, i32 42, metadata !"bar")
   %y = call i8 @llvm.something(
       metadata !{i8 %x, i8 %y, i32 %z, metadata* @llvm.foo, null,
       i32* null, metadata undef, metadata !{i8 %y, metadata !"foo"}, metadata !"foo"})
   %z = add i32 1, 1
   ret void
}

where %y is a new instruction demonstrating the MDNode's ability to refer to other instructions.

Nick

I have a quick question about embedded metadata. I've lost track of
exactly what we want to support.

What about making MDNodes that refer to Instructions? Is that desired

yes.

any more, or is that obsolete? I had a patch to do this locally and I
either want to fix it up and commit it or discard it.

MDNode now holds values so it should work, but have not tried it yet.
If you run into to issues please let us know.

LLParser requires one change (that is -- accept inline metadata
content) and Victor is working on it so that
  call @llvm.dbg.declare(metadata !{i32* %X }, metadata !4)

works.