rnk added subscribers: ayzhao, usaxena95, ilya-biryukov.
rnk added a comment.

I think this is a straightforward improvement. I would like to see it land. Do 
the other reviewers have any outstanding concerns?

+cc other clang people @ayzhao @ilya-biryukov @usaxena95



================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:544
   }
+  llvm::stable_sort(GlobalCtors, [](const Structor &L, const Structor &R) {
+    return L.LexOrder < R.LexOrder;
----------------
Please move this sorting into EmitCtorList and apply it to destructors. I 
believe they are currently emitted in source order, and the loader executes 
them in reverse order, so we get the desired reverse source order cleanup 
behavior.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127233/new/

https://reviews.llvm.org/D127233

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to