[PATCH] D94202: Preserve the lexical order of global variables during llvm-link merge

Jin Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 17:57:17 PST 2021


jinlin added inline comments.


================
Comment at: llvm/lib/Linker/IRMover.cpp:1477
+    // global variable.
+    auto *NewV = Mapper.mapValue(*GV);
+    if (InitCnst) {
----------------
hiraditya wrote:
> Can we move this inside the condition below?
Sure.


================
Comment at: llvm/lib/Linker/IRMover.cpp:1508
+
+      unsigned Size = OldElements.size();
+      while (Size > 0) {
----------------
hiraditya wrote:
> use `erase`
In some cases, the size of NewElements is larger than that
of OldElemts. You cannot simply use erase.


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

https://reviews.llvm.org/D94202



More information about the llvm-commits mailing list