Skip to content

Print more descriptive error message when trying to link a global with appending linkage #69613

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

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

arrowd
Copy link
Contributor

@arrowd arrowd commented Oct 19, 2023

This is a proper fix for #40308

@llvmbot
Copy link
Member

llvmbot commented Oct 19, 2023

@llvm/pr-subscribers-backend-x86

Author: Gleb Popov (arrowd)

Changes

This is a proper fix for #40308


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

2 Files Affected:

  • (modified) llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (+1-1)
  • (modified) llvm/test/CodeGen/X86/AppendingLinkage.ll (+1-1)
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 072c55f79caa9dc..dab02272fadf9b9 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -2746,7 +2746,7 @@ bool AsmPrinter::emitSpecialLLVMGlobal(const GlobalVariable *GV) {
     return true;
   }
 
-  report_fatal_error("unknown special variable");
+  report_fatal_error("unknown special variable with appending linkage");
 }
 
 /// EmitLLVMUsedList - For targets that define a MAI::UsedDirective, mark each
diff --git a/llvm/test/CodeGen/X86/AppendingLinkage.ll b/llvm/test/CodeGen/X86/AppendingLinkage.ll
index 83bfbe85240afb1..ace5d192b7ea7ee 100644
--- a/llvm/test/CodeGen/X86/AppendingLinkage.ll
+++ b/llvm/test/CodeGen/X86/AppendingLinkage.ll
@@ -1,4 +1,4 @@
 ; RUN: not --crash llc < %s -mtriple=i686-- 2>&1 | FileCheck %s
 
-; CHECK: unknown special variable
+; CHECK: unknown special variable with appending linkage
 @foo = appending constant [1 x i32 ]zeroinitializer

@arrowd
Copy link
Contributor Author

arrowd commented Nov 18, 2023

Ping, this is a trivial PR and can be easily merged in.

@arrowd arrowd force-pushed the appending-linkage-error branch from 1e3bce3 to 255924c Compare January 10, 2024 19:45
@arrowd
Copy link
Contributor Author

arrowd commented Jan 10, 2024

Bump. Can we get this in?

@RKSimon RKSimon requested a review from efriedma-quic January 11, 2024 09:55
@arrowd arrowd force-pushed the appending-linkage-error branch from 255924c to 4546489 Compare February 10, 2024 11:37
@arrowd
Copy link
Contributor Author

arrowd commented Mar 17, 2024

Bump.

Copy link
Collaborator

@RKSimon RKSimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RKSimon
Copy link
Collaborator

RKSimon commented Apr 3, 2024

@arrowd Happy to commit this now?

@arrowd
Copy link
Contributor Author

arrowd commented Apr 3, 2024

I don't have rights to merge this.

@RKSimon RKSimon merged commit 0356d0c into llvm:main Apr 3, 2024
@arrowd arrowd deleted the appending-linkage-error branch April 3, 2024 11:26
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