[llvm] r222205 - IR: Split MDNode into GenericMDNode and MDNodeFwdDecl

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Nov 17 23:55:42 PST 2014


> On 2014 Nov 17, at 20:46, Eric Christopher <echristo at gmail.com> wrote:
> 
> 
> 
> On Mon Nov 17 2014 at 4:45:03 PM Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
> Author: dexonsmith
> Date: Mon Nov 17 18:37:17 2014
> New Revision: 222205
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=222205&view=rev
> Log:
> IR: Split MDNode into GenericMDNode and MDNodeFwdDecl
> 
> 
> Small bikeshedding:

Bikeshedding welcome :).

> 
> ReplaceableNDNode maybe?
>  
> Best name I've been able to come up with so far.

I think "forward declaration" should be in the name somewhere -- or
"temporary", which was the old name for the concept.

These metadata are relatively expensive, since they're going to support
RAUW, so I'd like the name to make it clear that they're not supposed to
be long-lived.

I like "forward declaration" because that's the only purpose I know for
them (well, aside from temporary uniquing hacks).  Also, there won't be
any support for serializing these (assembly or bitcode), since they're
not supposed to live that long.  Forward declaration implies that they'll
be resolved eventually... but maybe it doesn't make it clear enough?

(Essentially, I think "NeedsToBeReplacedMDNode" is more accurate than
"ReplaceableMDNode".)

Note that after-the-split, I plan to implement the RAUW support for both
this class (whatever it's name) and `ValueAsMetadata` using a helper
class called `ReplaceableMetadataImpl`, which is pretty similar to the
name you suggested, but it's an Impl class so its name might not matter
as much.

Thoughts?



More information about the llvm-commits mailing list