@@ -22,8 +22,10 @@ using namespace clang;
2222using namespace clang ::interp;
2323
2424Context::Context (ASTContext &Ctx) : Ctx(Ctx), P(new Program(*this )) {
25+ this ->ShortWidth = Ctx.getTargetInfo ().getShortWidth ();
2526 this ->IntWidth = Ctx.getTargetInfo ().getIntWidth ();
2627 this ->LongWidth = Ctx.getTargetInfo ().getLongWidth ();
28+ this ->LongLongWidth = Ctx.getTargetInfo ().getLongLongWidth ();
2729 assert (Ctx.getTargetInfo ().getCharWidth () == 8 &&
2830 " We're assuming 8 bit chars" );
2931}
@@ -265,6 +267,11 @@ std::optional<PrimType> Context::classify(QualType T) const {
265267 return PT_MemberPtr;
266268
267269 // 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+
268275 if (Kind == BuiltinType::Int)
269276 return integralTypeToPrimTypeS (this ->IntWidth );
270277 if (Kind == BuiltinType::UInt)
@@ -273,6 +280,11 @@ std::optional<PrimType> Context::classify(QualType T) const {
273280 return integralTypeToPrimTypeS (this ->LongWidth );
274281 if (Kind == BuiltinType::ULong)
275282 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+
276288 if (Kind == BuiltinType::SChar || Kind == BuiltinType::Char_S)
277289 return integralTypeToPrimTypeS (8 );
278290 if (Kind == BuiltinType::UChar || Kind == BuiltinType::Char_U ||
0 commit comments