================
@@ -98,6 +98,21 @@ MDNode *MMRAMetadata::combine(LLVMContext &Ctx, const 
MMRAMetadata &A,
   return MDTuple::get(Ctx, Result);
 }
 
+void MMRAMetadata::appendTags(Instruction &I, ArrayRef<TagT> Tags) {
+  if (Tags.empty())
+    return;
+  SmallVector<MMRAMetadata::TagT> MMRAs(Tags);
+  LLVMContext &Ctx = I.getContext();
+  if (MDNode *Existing = I.getMetadata(LLVMContext::MD_mmra)) {
+    // Merge with existing MMRA tags.
+    MMRAMetadata Parsed(Existing);
+    MMRAs.append(Parsed.begin(), Parsed.end());
+  }
+  llvm::sort(MMRAs);
+  MMRAs.erase(llvm::unique(MMRAs), MMRAs.end());
----------------
ssahasra wrote:

I grepped for such uses ... there was exactly one instance were "llvm::" prefix 
was not used. That aligns with my own built-in habit of being explicit about 
the llvm:: namespace for things that "feel like they should be in std::"

https://github.com/llvm/llvm-project/pull/199621
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to