diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-05-15 13:17:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-15 13:17:29 +0200 |
commit | 767a203a9e61e307086be96288947d130367a267 (patch) | |
tree | 90341e9fb0e51c808a86d905832c0e48d3a8468e /clang/lib/AST/ByteCode/Compiler.cpp | |
parent | f8f11c541dec9bfc19f80918cf12da71d6ae7b99 (diff) | |
download | llvm-767a203a9e61e307086be96288947d130367a267.zip llvm-767a203a9e61e307086be96288947d130367a267.tar.gz llvm-767a203a9e61e307086be96288947d130367a267.tar.bz2 |
[clang][bytecode] Fix discarded LValueToRValueBitCasts (#140034)
We handle discarding fine, but we used to ignore all discarded cast
expressions. Handle bitcasts differently.
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/Compiler.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index 67b6ae4..2580fb1 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -474,10 +474,6 @@ bool Compiler<Emitter>::VisitCastExpr(const CastExpr *CE) { return false; return this->emitDecayPtr(*FromT, *ToT, CE); } - - case CK_LValueToRValueBitCast: - return this->emitBuiltinBitCast(CE); - case CK_IntegralToBoolean: case CK_FixedPointToBoolean: { // HLSL uses this to cast to one-element vectors. @@ -736,6 +732,11 @@ bool Compiler<Emitter>::VisitCastExpr(const CastExpr *CE) { } template <class Emitter> +bool Compiler<Emitter>::VisitBuiltinBitCastExpr(const BuiltinBitCastExpr *E) { + return this->emitBuiltinBitCast(E); +} + +template <class Emitter> bool Compiler<Emitter>::VisitIntegerLiteral(const IntegerLiteral *LE) { if (DiscardResult) return true; |