Skip to content

Conversation

kazutakahirata
Copy link
Contributor

C is already of unsigned char.

C is already of unsigned char.
@llvmbot
Copy link
Member

llvmbot commented Jun 30, 2025

@llvm/pr-subscribers-llvm-ir

Author: Kazu Hirata (kazutakahirata)

Changes

C is already of unsigned char.


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

1 Files Affected:

  • (modified) llvm/lib/IR/AsmWriter.cpp (+1-2)
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index ff45afe399c82..af268b4fc6941 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -447,8 +447,7 @@ void llvm::printLLVMNameWithoutPrefix(raw_ostream &OS, StringRef Name) {
       // in the range 0-255.  This is important when building with MSVC because
       // its implementation will assert.  This situation can arise when dealing
       // with UTF-8 multibyte characters.
-      if (!isalnum(static_cast<unsigned char>(C)) && C != '-' && C != '.' &&
-          C != '_') {
+      if (!isalnum(C) && C != '-' && C != '.' && C != '_') {
         NeedsQuotes = true;
         break;
       }

@kazutakahirata kazutakahirata merged commit 6a83a84 into llvm:main Jun 30, 2025
9 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250630_cast_llvm_IR branch June 30, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants