Skip to content

Conversation

@abhishek-kaushik22
Copy link
Contributor

No description provided.

@llvmbot llvmbot added the llvm:mc Machine (object) code label Aug 10, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 10, 2025

@llvm/pr-subscribers-mc

Author: Abhishek Kaushik (abhishek-kaushik22)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/MC/MCAsmInfoGOFF.cpp (+1-1)
diff --git a/llvm/lib/MC/MCAsmInfoGOFF.cpp b/llvm/lib/MC/MCAsmInfoGOFF.cpp
index 0a5d1927b1a22..d0f931d03d532 100644
--- a/llvm/lib/MC/MCAsmInfoGOFF.cpp
+++ b/llvm/lib/MC/MCAsmInfoGOFF.cpp
@@ -72,7 +72,7 @@ static void emitCATTR(raw_ostream &OS, StringRef Name, GOFF::ESDRmode Rmode,
       OS << "64";
       break;
     case GOFF::ESD_RMODE_None:
-      break;
+      llvm_unreachable("GOFF::ESD_RMODE_None should not be handled here");
     }
     OS << ')';
   }

break;
case GOFF::ESD_RMODE_None:
break;
llvm_unreachable("GOFF::ESD_RMODE_None should not be handled here");
Copy link
Member

Choose a reason for hiding this comment

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

I would move GOFF::ESD_RMODE_None: above to make it clear that this case has already been handled and use an empty llvm_unreachable as it's obvious.

Copy link
Member

@MaskRay MaskRay left a comment

Choose a reason for hiding this comment

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

The title can mention GOFF

@abhishek-kaushik22 abhishek-kaushik22 changed the title [NFC][MC] Use llvm_unreachable for unreachable case [NFC][MC][GOFF] Use llvm_unreachable for unreachable case Aug 11, 2025
@abhishek-kaushik22 abhishek-kaushik22 merged commit 2415e3b into llvm:main Aug 13, 2025
9 checks passed
@abhishek-kaushik22 abhishek-kaushik22 deleted the unreachable branch August 13, 2025 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:mc Machine (object) code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants