[clang] 5fc891b - [clang][bytecode][NFC] Use getElemType() in __builtin_memchr as well (#132550)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 22 08:34:26 PDT 2025
Author: Timm Baeder
Date: 2025-03-22T16:34:22+01:00
New Revision: 5fc891b965223d66b552397e49fb4b09d781d5da
URL: https://github.com/llvm/llvm-project/commit/5fc891b965223d66b552397e49fb4b09d781d5da
DIFF: https://github.com/llvm/llvm-project/commit/5fc891b965223d66b552397e49fb4b09d781d5da.diff
LOG: [clang][bytecode][NFC] Use getElemType() in __builtin_memchr as well (#132550)
For consistency.
Added:
Modified:
clang/lib/AST/ByteCode/InterpBuiltin.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index 2cbbfe5a9987f..4c359b100ab7e 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -2053,9 +2053,7 @@ static bool interp__builtin_memchr(InterpState &S, CodePtr OpPC,
(ID == Builtin::BIstrchr || ID == Builtin::BI__builtin_strchr);
PrimType ElemT =
- IsRawByte
- ? PT_Sint8
- : *S.getContext().classify(Ptr.getFieldDesc()->getElemQualType());
+ IsRawByte ? PT_Sint8 : *S.getContext().classify(getElemType(Ptr));
size_t Index = Ptr.getIndex();
size_t Step = 0;
More information about the cfe-commits
mailing list