diff options
author | Mariya Podchishchaeva <mariya.podchishchaeva@intel.com> | 2025-03-20 13:02:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-20 13:02:29 +0100 |
commit | 8c6f309023a9c5b6d8488e89ed0be8da7d117a68 (patch) | |
tree | 7f471bf287c56188243c6ae70f77a0262da3f9bd /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 68180d8d16f07db8200dfce7bae26a80c43ebc5e (diff) | |
download | llvm-8c6f309023a9c5b6d8488e89ed0be8da7d117a68.zip llvm-8c6f309023a9c5b6d8488e89ed0be8da7d117a68.tar.gz llvm-8c6f309023a9c5b6d8488e89ed0be8da7d117a68.tar.bz2 |
[clang] Introduce "binary" StringLiteral for #embed data (#127629)
StringLiteral is used as internal data of EmbedExpr and we directly use
it as an initializer if a single EmbedExpr appears in the initializer
list of a char array. It is fast and convenient, but it is causing
problems when string literal character values are checked because #embed
data values are within a range [0-2^(char width)] but ordinary
StringLiteral is of maybe signed char type.
This PR introduces new kind of StringLiteral to hold binary data coming
from an embedded resource to mitigate these problems. The new kind of
StringLiteral is not assumed to have signed char type. The new kind of
StringLiteral also helps to prevent crashes when trying to find
StringLiteral token locations since these simply do not exist for binary
data.
Fixes https://github.com/llvm/llvm-project/issues/119256
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions