As suggested in review for r255909, rename MDMaterialized to AllowTemps,
and identify the name of the boolean flag being set in calls to
saveMetadataList.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256653
91177308-0d34-0410-b5e6-
96231b3b80d8
/// \brief Resolve cycles.
///
/// Once all forward declarations have been resolved, force cycles to be
- /// resolved. If \p MDMaterialized is true, then any temporary metadata
+ /// resolved. If \p AllowTemps is true, then any temporary metadata
/// is ignored, otherwise it asserts when encountering temporary metadata.
///
/// \pre No operands (or operands' operands, etc.) have \a isTemporary().
- void resolveCycles(bool MDMaterialized = true);
+ void resolveCycles(bool AllowTemps = false);
/// \brief Replace a temporary node with a permanent one.
///
resolve();
}
-void MDNode::resolveCycles(bool MDMaterialized) {
+void MDNode::resolveCycles(bool AllowTemps) {
if (isResolved())
return;
if (!N)
continue;
- if (N->isTemporary() && !MDMaterialized)
+ if (N->isTemporary() && AllowTemps)
continue;
assert(!N->isTemporary() &&
"Expected all forward declarations to be resolved");
// a function and before remapping metadata on instructions below
// in RemapInstruction, as the saved mapping is used to handle
// the temporary metadata hanging off instructions.
- SrcM.getMaterializer()->saveMetadataList(MetadataToIDs, true);
+ SrcM.getMaterializer()->saveMetadataList(MetadataToIDs,
+ /* OnlyTempMD = */ true);
// Link in the prefix data.
if (Src.hasPrefixData())
// Ensure metadata materialized
if (SrcM.getMaterializer()->materializeMetadata())
return true;
- SrcM.getMaterializer()->saveMetadataList(MetadataToIDs, false);
+ SrcM.getMaterializer()->saveMetadataList(MetadataToIDs,
+ /* OnlyTempMD = */ false);
}
linkNamedMDNodes();
}
/// Resolve uniquing cycles involving the given metadata.
-static void resolveCycles(Metadata *MD, bool MDMaterialized) {
+static void resolveCycles(Metadata *MD, bool AllowTemps) {
if (auto *N = dyn_cast_or_null<MDNode>(MD)) {
- if (!MDMaterialized && N->isTemporary())
+ if (AllowTemps && N->isTemporary())
return;
if (!N->isResolved())
- N->resolveCycles(MDMaterialized);
+ N->resolveCycles(AllowTemps);
}
}
// Resolve uniquing cycles underneath distinct nodes on the fly so they
// don't infect later operands.
if (IsDistinct)
- resolveCycles(New, !(Flags & RF_HaveUnmaterializedMetadata));
+ resolveCycles(New, Flags & RF_HaveUnmaterializedMetadata);
}
}
return NewMD;
// Resolve cycles involving the entry metadata.
- resolveCycles(NewMD, !(Flags & RF_HaveUnmaterializedMetadata));
+ resolveCycles(NewMD, Flags & RF_HaveUnmaterializedMetadata);
// Remap the operands of distinct MDNodes.
while (!DistinctWorklist.empty())