From 118632dbf6851afc878098903a5baf7c8851d3c2 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Mon, 12 Jan 2015 20:09:34 +0000 Subject: IR: Split GenericMDNode into MDTuple and UniquableMDNode Split `GenericMDNode` into two classes (with more descriptive names). - `UniquableMDNode` will be a common subclass for `MDNode`s that are sometimes uniqued like constants, and sometimes 'distinct'. This class gets the (short-lived) RAUW support and related API. - `MDTuple` is the basic tuple that has always been returned by `MDNode::get()`. This is as opposed to more specific nodes to be added soon, which have additional fields, custom assembly syntax, and extra semantics. This class gets the hash-related logic, since other sublcasses of `UniquableMDNode` may need to hash based on other fields. To keep this diff from getting too big, I've added casts to `MDTuple` that won't really scale as new subclasses of `UniquableMDNode` are added, but I'll clean those up incrementally. (No functionality change intended.) llvm-svn: 225682 --- llvm/lib/IR/MetadataTracking.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/IR/MetadataTracking.cpp') diff --git a/llvm/lib/IR/MetadataTracking.cpp b/llvm/lib/IR/MetadataTracking.cpp index 5b4b55586a9..ba97ca033a4 100644 --- a/llvm/lib/IR/MetadataTracking.cpp +++ b/llvm/lib/IR/MetadataTracking.cpp @@ -18,8 +18,8 @@ using namespace llvm; ReplaceableMetadataImpl *ReplaceableMetadataImpl::get(Metadata &MD) { if (auto *N = dyn_cast(&MD)) { - if (auto *G = dyn_cast(N)) - return G->ReplaceableUses.get(); + if (auto *U = dyn_cast(N)) + return U->ReplaceableUses.get(); return cast(N); } return dyn_cast(&MD); -- cgit v1.2.3