Skip to content

AsmPrinter: Do not use report_fatal_error for AIX XXStructor error #145273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Jun 23, 2025

No description provided.

Copy link
Contributor Author

arsenm commented Jun 23, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@arsenm arsenm marked this pull request as ready for review June 23, 2025 06:06
@llvmbot
Copy link
Member

llvmbot commented Jun 23, 2025

@llvm/pr-subscribers-backend-powerpc

Author: Matt Arsenault (arsenm)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/145273.diff

2 Files Affected:

  • (modified) llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (+4-2)
  • (modified) llvm/test/CodeGen/PowerPC/aix-static-init-key-object.ll (+3-3)
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 403963f33b65c..541373520ffb0 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -3243,9 +3243,11 @@ void AsmPrinter::preprocessXXStructorList(const DataLayout &DL,
     S.Priority = Priority->getLimitedValue(65535);
     S.Func = CS->getOperand(1);
     if (!CS->getOperand(2)->isNullValue()) {
-      if (TM.getTargetTriple().isOSAIX())
-        llvm::report_fatal_error(
+      if (TM.getTargetTriple().isOSAIX()) {
+        CS->getContext().emitError(
             "associated data of XXStructor list is not yet supported on AIX");
+      }
+
       S.ComdatKey =
           dyn_cast<GlobalValue>(CS->getOperand(2)->stripPointerCasts());
     }
diff --git a/llvm/test/CodeGen/PowerPC/aix-static-init-key-object.ll b/llvm/test/CodeGen/PowerPC/aix-static-init-key-object.ll
index e0a77c84b81a9..b8aba26b574c1 100644
--- a/llvm/test/CodeGen/PowerPC/aix-static-init-key-object.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-static-init-key-object.ll
@@ -1,5 +1,5 @@
-; RUN: not --crash llc -mtriple powerpc-ibm-aix-xcoff < %s 2>&1 | FileCheck %s
-; RUN: not --crash llc -mtriple powerpc64-ibm-aix-xcoff < %s 2>&1 | FileCheck %s
+; RUN: not llc -mtriple powerpc-ibm-aix-xcoff < %s 2>&1 | FileCheck %s
+; RUN: not llc -mtriple powerpc64-ibm-aix-xcoff < %s 2>&1 | FileCheck %s
 
 @v = global i8 0
 
@@ -9,4 +9,4 @@ define void @foo() {
   ret void
 }
 
-; CHECK: LLVM ERROR: associated data of XXStructor list is not yet supported on AIX
+; CHECK: error: associated data of XXStructor list is not yet supported on AIX

@arsenm arsenm changed the title AsmPrinter: Do not use report_fatal_error fir AIX XXStructor error AsmPrinter: Do not use report_fatal_error for AIX XXStructor error Jun 23, 2025
@arsenm arsenm merged commit 338ee67 into main Jun 23, 2025
12 checks passed
@arsenm arsenm deleted the users/arsenm/asm-printer/no-report-fatal-error-aix-XXstructor-list branch June 23, 2025 07:25
miguelcsx pushed a commit to miguelcsx/llvm-project that referenced this pull request Jun 23, 2025
Jaddyen pushed a commit to Jaddyen/llvm-project that referenced this pull request Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants