Author: Nikita Popov
Date: 2025-12-16T14:32:16+01:00
New Revision: 9e11754c80dafef162543f7e1169c13d6a802cf4

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

LOG: [CGHLSLRuntime] Use getSigned() for total array size

This may be -1 for incompete array types.

Added: 
    

Modified: 
    clang/lib/CodeGen/CGHLSLRuntime.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGHLSLRuntime.cpp 
b/clang/lib/CodeGen/CGHLSLRuntime.cpp
index f485fdd49e43f..2e9602d1b3793 100644
--- a/clang/lib/CodeGen/CGHLSLRuntime.cpp
+++ b/clang/lib/CodeGen/CGHLSLRuntime.cpp
@@ -1279,8 +1279,8 @@ std::optional<LValue> 
CGHLSLRuntime::emitResourceArraySubscriptExpr(
       AggValueSlot::DoesNotOverlap);
 
   // Calculate total array size (= range size).
-  llvm::Value *Range =
-      llvm::ConstantInt::get(CGM.IntTy, getTotalArraySize(AST, ResArrayTy));
+  llvm::Value *Range = llvm::ConstantInt::getSigned(
+      CGM.IntTy, getTotalArraySize(AST, ResArrayTy));
 
   // If the result of the subscript operation is a single resource, call the
   // constructor.


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to