[clang] 5b3a9ac - [clang][bytecode] Handle more types in `canClassify()` (#203669)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Jun 13 07:34:40 PDT 2026
Author: Timm Baeder
Date: 2026-06-13T16:34:36+02:00
New Revision: 5b3a9ac949aba6e062bcd9062cb8c0f2eaf7f776
URL: https://github.com/llvm/llvm-project/commit/5b3a9ac949aba6e062bcd9062cb8c0f2eaf7f776
DIFF: https://github.com/llvm/llvm-project/commit/5b3a9ac949aba6e062bcd9062cb8c0f2eaf7f776.diff
LOG: [clang][bytecode] Handle more types in `canClassify()` (#203669)
Avoid having to go through the normal `classify()` path.
Added:
Modified:
clang/lib/AST/ByteCode/Context.h
Removed:
################################################################################
diff --git a/clang/lib/AST/ByteCode/Context.h b/clang/lib/AST/ByteCode/Context.h
index 235a4e44a9342..789f72ae34f73 100644
--- a/clang/lib/AST/ByteCode/Context.h
+++ b/clang/lib/AST/ByteCode/Context.h
@@ -121,6 +121,7 @@ class Context final {
}
bool canClassify(QualType T) const {
+ T = T.getCanonicalType();
if (const auto *BT = dyn_cast<BuiltinType>(T)) {
if (BT->isInteger() || BT->isFloatingPoint())
return true;
@@ -133,6 +134,10 @@ class Context final {
if (T->isArrayType() || T->isRecordType() || T->isAnyComplexType() ||
T->isVectorType())
return false;
+
+ if (const auto *D = T->getAsEnumDecl())
+ return D->isComplete();
+
return classify(T) != std::nullopt;
}
bool canClassify(const Expr *E) const {
More information about the cfe-commits
mailing list