[clang] a6ae223 - [clang][bytecode][NFC] Avoid an implicit integer conversion (#139845)

via cfe-commits cfe-commits at lists.llvm.org
Wed May 14 00:16:24 PDT 2025


Author: Timm Baeder
Date: 2025-05-14T09:16:20+02:00
New Revision: a6ae2237aad763c2abf90f28c247a084216a48b2

URL: https://github.com/llvm/llvm-project/commit/a6ae2237aad763c2abf90f28c247a084216a48b2
DIFF: https://github.com/llvm/llvm-project/commit/a6ae2237aad763c2abf90f28c247a084216a48b2.diff

LOG: [clang][bytecode][NFC] Avoid an implicit integer conversion (#139845)

getCharByteWidth() returns an unsigned.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Compiler.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 96ae1f58ef4a6..3d1311a5391f8 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -2435,7 +2435,7 @@ bool Compiler<Emitter>::VisitStringLiteral(const StringLiteral *E) {
   // emitted. Read only the array length from the string literal.
   unsigned ArraySize = CAT->getZExtSize();
   unsigned N = std::min(ArraySize, E->getLength());
-  size_t CharWidth = E->getCharByteWidth();
+  unsigned CharWidth = E->getCharByteWidth();
 
   for (unsigned I = 0; I != N; ++I) {
     uint32_t CodeUnit = E->getCodeUnit(I);


        


More information about the cfe-commits mailing list