[clang] [CIR] Support wide string literals in CIR codegen (PR #171541)

via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 11 09:39:24 PST 2025


adams381 wrote:

Addressed all reviewer feedback:

**Code Style Improvements:**
- Changed `dyn_cast<>` + `assert` to `cast<>` (lines 967, 969)
- Replaced `auto` with explicit types (`uint64_t`, `unsigned`) for method returns (lines 971, 972)
- Removed unnecessary SmallVector size parameters (line 989)

**Performance Optimizations:**
- Moved zero-check before building the vector to enable early exit (lines 977-983)
- Eliminated double-looping by building elements directly from string literal instead of intermediate vector
- Removed intermediate `elementValues` vector entirely

**Test Improvements:**
- Added LLVM and OGCG checks to test file (as requested)

All reviewer suggestions have been implemented. The code now follows LLVM coding standards and includes performance optimizations.

https://github.com/llvm/llvm-project/pull/171541


More information about the cfe-commits mailing list