@@ -22,8 +22,10 @@ using namespace clang;
22
22
using namespace clang ::interp;
23
23
24
24
Context::Context (ASTContext &Ctx) : Ctx(Ctx), P(new Program(*this )) {
25
+ this ->ShortWidth = Ctx.getTargetInfo ().getShortWidth ();
25
26
this ->IntWidth = Ctx.getTargetInfo ().getIntWidth ();
26
27
this ->LongWidth = Ctx.getTargetInfo ().getLongWidth ();
28
+ this ->LongLongWidth = Ctx.getTargetInfo ().getLongLongWidth ();
27
29
assert (Ctx.getTargetInfo ().getCharWidth () == 8 &&
28
30
" We're assuming 8 bit chars" );
29
31
}
@@ -265,6 +267,11 @@ std::optional<PrimType> Context::classify(QualType T) const {
265
267
return PT_MemberPtr;
266
268
267
269
// Just trying to avoid the ASTContext::getIntWidth call below.
270
+ if (Kind == BuiltinType::Short)
271
+ return integralTypeToPrimTypeS (this ->ShortWidth );
272
+ if (Kind == BuiltinType::UShort)
273
+ return integralTypeToPrimTypeU (this ->ShortWidth );
274
+
268
275
if (Kind == BuiltinType::Int)
269
276
return integralTypeToPrimTypeS (this ->IntWidth );
270
277
if (Kind == BuiltinType::UInt)
@@ -273,6 +280,11 @@ std::optional<PrimType> Context::classify(QualType T) const {
273
280
return integralTypeToPrimTypeS (this ->LongWidth );
274
281
if (Kind == BuiltinType::ULong)
275
282
return integralTypeToPrimTypeU (this ->LongWidth );
283
+ if (Kind == BuiltinType::LongLong)
284
+ return integralTypeToPrimTypeS (this ->LongLongWidth );
285
+ if (Kind == BuiltinType::ULongLong)
286
+ return integralTypeToPrimTypeU (this ->LongLongWidth );
287
+
276
288
if (Kind == BuiltinType::SChar || Kind == BuiltinType::Char_S)
277
289
return integralTypeToPrimTypeS (8 );
278
290
if (Kind == BuiltinType::UChar || Kind == BuiltinType::Char_U ||
0 commit comments