[clang] [clang][bytecode][NFC] Use getElemType() in __builtin_memchr as well (PR #132550)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 22 07:25:25 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timm Baeder (tbaederr)
<details>
<summary>Changes</summary>
For consistency.
---
Full diff: https://github.com/llvm/llvm-project/pull/132550.diff
1 Files Affected:
- (modified) clang/lib/AST/ByteCode/InterpBuiltin.cpp (+1-3)
``````````diff
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index 57037b674feba..300c4127a9856 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -2052,9 +2052,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;
``````````
</details>
https://github.com/llvm/llvm-project/pull/132550
More information about the cfe-commits
mailing list