本文整理汇总了C++中UnitEmitter::emitInt32方法的典型用法代码示例。如果您正苦于以下问题:C++ UnitEmitter::emitInt32方法的具体用法?C++ UnitEmitter::emitInt32怎么用?C++ UnitEmitter::emitInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitEmitter
的用法示例。
在下文中一共展示了UnitEmitter::emitInt32方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: encode_member_key
void encode_member_key(MemberKey mk, UnitEmitter& ue) {
ue.emitByte(mk.mcode);
switch (mk.mcode) {
case MEC: case MEL: case MPC: case MPL:
ue.emitIVA(mk.iva);
break;
case MEI:
ue.emitInt64(mk.int64);
break;
case MET: case MPT: case MQT:
ue.emitInt32(ue.mergeLitstr(mk.litstr));
break;
case MW:
// No immediate
break;
}
}
示例2: encodeRAT
void encodeRAT(UnitEmitter& ue, RepoAuthType rat) {
using T = RepoAuthType::Tag;
switch (rat.tag()) {
case T::Uninit:
case T::InitNull:
case T::Null:
case T::Int:
case T::OptInt:
case T::Dbl:
case T::OptDbl:
case T::Res:
case T::OptRes:
case T::Bool:
case T::OptBool:
case T::SStr:
case T::OptSStr:
case T::Str:
case T::OptStr:
case T::SVec:
case T::OptSVec:
case T::Vec:
case T::OptVec:
case T::SDict:
case T::OptSDict:
case T::Dict:
case T::OptDict:
case T::SKeyset:
case T::OptSKeyset:
case T::Keyset:
case T::OptKeyset:
case T::Obj:
case T::OptObj:
case T::UncArrKey:
case T::ArrKey:
case T::OptUncArrKey:
case T::OptArrKey:
case T::InitUnc:
case T::Unc:
case T::InitCell:
case T::Cell:
case T::Ref:
case T::InitGen:
case T::Gen:
ue.emitByte(static_cast<uint8_t>(rat.tag()));
break;
case T::SArr:
case T::OptSArr:
case T::Arr:
case T::OptArr:
case T::SVArr:
case T::OptSVArr:
case T::VArr:
case T::OptVArr:
case T::SDArr:
case T::OptSDArr:
case T::DArr:
case T::OptDArr:
{
auto tagByte = static_cast<uint8_t>(rat.tag());
if (rat.hasArrData()) tagByte |= kRATArrayDataBit;
ue.emitByte(tagByte);
if (rat.hasArrData()) {
ue.emitInt32(rat.arrayId());
}
break;
}
case T::ExactObj:
case T::SubObj:
case T::OptExactObj:
case T::OptSubObj:
ue.emitByte(static_cast<uint8_t>(rat.tag()));
ue.emitInt32(ue.mergeLitstr(rat.clsName()));
break;
}
}