本文整理汇总了C++中QualType::split方法的典型用法代码示例。如果您正苦于以下问题:C++ QualType::split方法的具体用法?C++ QualType::split怎么用?C++ QualType::split使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QualType
的用法示例。
在下文中一共展示了QualType::split方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stripType
QualType stripType(const QualType & qualType)
{
QualType qType = qualType;
SplitQualType splitQualType = qType.split();
const Type * t = splitQualType.Ty;
for(;;) {
if(t->isArrayType()) {
qType = dyn_cast<ArrayType>(t->getCanonicalTypeInternal())->getElementType();
}
else if(t->isPointerType()) {
qType = dyn_cast<PointerType>(t)->getPointeeType();
}
else if(t->isReferenceType()) {
qType = dyn_cast<ReferenceType>(t)->getPointeeType();
}
else {
break;
}
splitQualType = qType.split();
t = splitQualType.Ty;
}
return qType;
}
示例2: AddQualType
void ODRHash::AddQualType(QualType T) {
AddBoolean(T.isNull());
if (T.isNull())
return;
SplitQualType split = T.split();
ID.AddInteger(split.Quals.getAsOpaqueValue());
AddType(split.Ty);
}
示例3: getTypeWithAttribute
static QualType getTypeWithAttribute(ASTContext &C, QualType T, Qualifiers::AS AS) {
auto Split = T.split();
if(Split.second.hasAttributeSpec(AS))
return T;
QualifierCollector QC(Split.second);
QC.addAttributeSpecs(AS);
return C.getTypeWithQualifers(T, QC);
}
示例4: getQualTypeOtherKind
QualType ASTContext::getQualTypeOtherKind(QualType Type, QualType KindType) {
auto BTy = Type->asBuiltinType();
auto DesiredBTy = KindType->asBuiltinType();
if(BTy->getBuiltinTypeKind() == DesiredBTy->getBuiltinTypeKind())
return Type;
auto Split = Type.split();
return getExtQualType(getBuiltinType(BTy->getTypeSpec(), DesiredBTy->getBuiltinTypeKind(),
DesiredBTy->isKindExplicitlySpecified(),
DesiredBTy->isDoublePrecisionKindSpecified(),
DesiredBTy->isByteKindSpecified()), Split.second);
}
示例5: dumpBareType
void ASTDumper::dumpBareType(QualType T) {
SplitQualType T_split = T.split();
OS << "'" << QualType::getAsString(T_split) << "'";
if (!T.isNull()) {
// If the type is sugared, also dump a (shallow) desugared type.
SplitQualType D_split = T.getSplitDesugaredType();
if (T_split != D_split)
OS << ":'" << QualType::getAsString(D_split) << "'";
}
}
示例6: printBefore
void TypePrinter::printBefore(QualType T, raw_ostream &OS) {
SplitQualType Split = T.split();
// If we have cv1 T, where T is substituted for cv2 U, only print cv1 - cv2
// at this level.
Qualifiers Quals = Split.Quals;
if (const SubstTemplateTypeParmType *Subst =
dyn_cast<SubstTemplateTypeParmType>(Split.Ty))
Quals -= QualType(Subst, 0).getQualifiers();
printBefore(Split.Ty, Quals, OS);
}
示例7: VisitObjCMessageExpr
bool VisitObjCMessageExpr(ObjCMessageExpr *node)
{
if (!node->isImplicit())
{
if (node->getReceiverKind() == ObjCMessageExpr::Instance)
{
if (node->getReceiverInterface())
{
countInterface(node->getReceiverInterface());
}
}
else if (node->getReceiverKind() == ObjCMessageExpr::Class)
{
QualType qualType = node->getClassReceiver();
countClassName(QualType::getAsString(qualType.split()));
}
}
return true;
}
示例8: getTypeWithQualifers
QualType ASTContext::getTypeWithQualifers(QualType Type, Qualifiers Quals) {
auto Split = Type.split();
return getExtQualType(Split.first, Quals);
}
示例9: printAfter
void TypePrinter::printAfter(QualType t, raw_ostream &OS) {
SplitQualType split = t.split();
printAfter(split.Ty, split.Quals, OS);
}
示例10: print
void TypePrinter::print(QualType t, raw_ostream &OS, StringRef PlaceHolder) {
SplitQualType split = t.split();
print(split.Ty, split.Quals, OS, PlaceHolder);
}
示例11: print
void TypePrinter::print(QualType t, std::string &buffer) {
SplitQualType split = t.split();
print(split.first, split.second, buffer);
}
示例12: print
void TypePrinter::print(QualType t, std::string &buffer) {
SplitQualType split = t.split();
print(split.Ty, split.Quals, buffer);
}