[PATCH] D149451: [NVPTX] Add NVPTXCtorDtorLoweringPass to handle global ctors / dtors

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 1 13:27:48 PDT 2023


tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.

LGTM overall.



================
Comment at: llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.cpp:58
+        ((IsCtor ? "__init_array_object_" : "__fini_array_object_") +
+         F->getName() + "_" + getHash(M.getName()) + "_" +
+         std::to_string(Priority))
----------------
Source file name may be a little bit better, though it's still easy to clash if someone does `cd A; clang ./foo.c; cd ../B; clang ./foo.c` and the file name uses relative paths.

I think we'll need a way to override this unique suffix explicitly as an escape hatch for cases where someone runs into a clash.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149451



More information about the cfe-commits mailing list