mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
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.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225682 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -55,7 +55,8 @@ DIBuilder::DIBuilder(Module &m, bool AllowUnresolvedNodes)
|
||||
AllowUnresolvedNodes(AllowUnresolvedNodes) {}
|
||||
|
||||
static bool isUnresolved(MDNode *N) {
|
||||
return N && (isa<MDNodeFwdDecl>(N) || !cast<GenericMDNode>(N)->isResolved());
|
||||
return N &&
|
||||
(isa<MDNodeFwdDecl>(N) || !cast<UniquableMDNode>(N)->isResolved());
|
||||
}
|
||||
|
||||
void DIBuilder::trackIfUnresolved(MDNode *N) {
|
||||
@ -110,7 +111,7 @@ void DIBuilder::finalize() {
|
||||
// cycles.
|
||||
for (const auto &N : UnresolvedNodes)
|
||||
if (N)
|
||||
cast<GenericMDNode>(N)->resolveCycles();
|
||||
cast<UniquableMDNode>(N)->resolveCycles();
|
||||
UnresolvedNodes.clear();
|
||||
|
||||
// Can't handle unresolved nodes anymore.
|
||||
|
Reference in New Issue
Block a user