================
@@ -6860,6 +6860,18 @@ void 
CodeGenModule::HandleCXXStaticMemberVarInstantiation(VarDecl *VD) {
   EmitTopLevelDecl(VD);
 }
 
+/// Return the ELF section prefix for a function based on the function's
+/// code-region affinity: "startup" for functions that run exclusively at
+/// program startup, "exit" for functions that run exclusively at program
+/// exit. Returns nullptr when the function has no such affinity.
+static const char *getCodeRegionSectionPrefix(const FunctionDecl *D) {
+  if (D->hasAttr<ConstructorAttr>())
+    return "startup";
+  if (D->hasAttr<DestructorAttr>())
----------------
MaskRay wrote:

We should use `.text.startup.` and `.text.exit.` if we accept this change. 
`.text.exit` can be confused with the function `exit` compiled in 
-ffunction-sections mode.

https://github.com/llvm/llvm-project/pull/200221
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to