Skip to content

Commit 94c751d

Browse files
authored
[clang][bytecode][NFC] Check pointer types in canClassify() (#168069)
And return true. Also make those two functions const.
1 parent 3d41567 commit 94c751d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/lib/AST/ByteCode/Context.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,22 @@ class Context final {
9898
return classify(E->getType());
9999
}
100100

101-
bool canClassify(QualType T) {
101+
bool canClassify(QualType T) const {
102102
if (const auto *BT = dyn_cast<BuiltinType>(T)) {
103103
if (BT->isInteger() || BT->isFloatingPoint())
104104
return true;
105105
if (BT->getKind() == BuiltinType::Bool)
106106
return true;
107107
}
108+
if (T->isPointerOrReferenceType())
109+
return true;
108110

109111
if (T->isArrayType() || T->isRecordType() || T->isAnyComplexType() ||
110112
T->isVectorType())
111113
return false;
112114
return classify(T) != std::nullopt;
113115
}
114-
bool canClassify(const Expr *E) {
116+
bool canClassify(const Expr *E) const {
115117
if (E->isGLValue())
116118
return true;
117119
return canClassify(E->getType());

0 commit comments

Comments
 (0)