================
@@ -265,7 +275,16 @@ Error llvm::createCtxProfFromYAML(StringRef Profile, 
raw_ostream &Out) {
       if (!TopList)
         return createStringError(
             "Unexpected error converting internal structure to ctx profile");
-      Writer.writeContextual(*TopList, DC.TotalRootEntryCount);
+
+      ctx_profile::ContextNode *FirstUnhandled = nullptr;
+      for (const auto &U : DC.Unhandled) {
+        SerializableCtxRepresentation Unhandled;
+        Unhandled.Guid = U.first;
+        Unhandled.Counters.insert(Unhandled.Counters.begin(), U.second.begin(),
----------------
snehasish wrote:

Repeatedly inserting in the front is inefficient. How about reserve(size), 
append and then reverse the vector?

https://github.com/llvm/llvm-project/pull/131417
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to