[PATCH] D145715: Remove -lower-global-dtors-via-cxa-atexit flag

Roy Sundahl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 12:31:51 PST 2023


rsundahl added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:1205
     unsigned Priority, const MCSymbol *KeySym) const {
-  // TODO(yln): Remove -lower-global-dtors-via-cxa-atexit fallback flag
-  // (LowerGlobalDtorsViaCxaAtExit) and always issue a fatal error here.
-  if (TM->Options.LowerGlobalDtorsViaCxaAtExit)
-    report_fatal_error("@llvm.global_dtors should have been lowered already");
-  return StaticDtorSection;
+  report_fatal_error("@llvm.global_dtors should have been lowered already");
 }
----------------
So the new assertion will be that it's a fatal error to get here at all. Currently, it's a fatal error only if you get here with the flag set. Are we sure that someone isn't getting here w/o the flag set and so they don't get an error but now will? Provided we don't mind surfacing any users of the flag with an explicit fatal error, then this LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145715



More information about the llvm-commits mailing list