本文整理汇总了C++中ASTContext::getExtQualType方法的典型用法代码示例。如果您正苦于以下问题:C++ ASTContext::getExtQualType方法的具体用法?C++ ASTContext::getExtQualType怎么用?C++ ASTContext::getExtQualType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASTContext
的用法示例。
在下文中一共展示了ASTContext::getExtQualType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ActOnTypeName
/// \brief Convert the specified DeclSpec to the appropriate type object.
QualType Sema::ActOnTypeName(ASTContext &C, DeclSpec &DS) {
QualType Result;
switch (DS.getTypeSpecType()) {
case DeclSpec::TST_integer:
Result = C.IntegerTy;
break;
case DeclSpec::TST_unspecified: // FIXME: Correct?
case DeclSpec::TST_real:
Result = C.RealTy;
break;
case DeclSpec::TST_doubleprecision:
Result = C.DoublePrecisionTy;
break;
case DeclSpec::TST_character:
Result = C.CharacterTy;
break;
case DeclSpec::TST_logical:
Result = C.LogicalTy;
break;
case DeclSpec::TST_complex:
Result = C.ComplexTy;
break;
case DeclSpec::TST_struct:
// FIXME: Finish this.
break;
}
if (!DS.hasAttributes())
return Result;
const Type *TypeNode = Result.getTypePtr();
Qualifiers Quals = Qualifiers::fromOpaqueValue(DS.getAttributeSpecs());
Quals.setIntentAttr(DS.getIntentSpec());
Quals.setAccessAttr(DS.getAccessSpec());
QualType EQs = C.getExtQualType(TypeNode, Quals, DS.getKindSelector(),
DS.getLengthSelector());
if (!Quals.hasAttributeSpec(Qualifiers::AS_dimension))
return EQs;
return ActOnArraySpec(C, EQs, DS.getDimensions());
}
示例2: ActOnTypeName
/// \brief Convert the specified DeclSpec to the appropriate type object.
QualType Sema::ActOnTypeName(ASTContext &C, DeclSpec &DS) {
QualType Result;
switch (DS.getTypeSpecType()) {
case DeclSpec::TST_integer:
Result = C.IntegerTy;
break;
case DeclSpec::TST_unspecified: // FIXME: Correct?
case DeclSpec::TST_real:
Result = C.RealTy;
break;
case DeclSpec::TST_character:
if(DS.isStarLengthSelector())
Result = C.NoLengthCharacterTy;
else if(DS.hasLengthSelector())
Result = QualType(C.getCharacterType(
EvalAndCheckCharacterLength(DS.getLengthSelector())), 0);
else Result = C.CharacterTy;
break;
case DeclSpec::TST_logical:
Result = C.LogicalTy;
break;
case DeclSpec::TST_complex:
Result = C.ComplexTy;
break;
case DeclSpec::TST_struct:
if(!DS.getRecord())
Result = C.RealTy;
else
Result = C.getRecordType(DS.getRecord());
break;
}
Type::TypeKind Kind = Type::NoKind;
if(DS.hasKindSelector())
Kind = EvalAndCheckTypeKind(Result, DS.getKindSelector());
if(Kind != Type::NoKind || DS.isDoublePrecision() || DS.isByte()) {
switch (DS.getTypeSpecType()) {
case DeclSpec::TST_integer:
Result = Kind == Type::NoKind? C.IntegerTy :
QualType(C.getBuiltinType(BuiltinType::Integer, Kind, true), 0);
break;
case DeclSpec::TST_real:
Result = Kind == Type::NoKind? (DS.isDoublePrecision()? C.DoublePrecisionTy : C.RealTy) :
QualType(C.getBuiltinType(BuiltinType::Real, Kind, true), 0);
break;
case DeclSpec::TST_logical:
Result = Kind == Type::NoKind? (DS.isByte()? C.ByteTy : C.LogicalTy) :
QualType(C.getBuiltinType(BuiltinType::Logical, Kind, true), 0);
break;
case DeclSpec::TST_complex:
Result = Kind == Type::NoKind? (DS.isDoublePrecision()? C.DoubleComplexTy : C.ComplexTy) :
QualType(C.getBuiltinType(BuiltinType::Complex, Kind, true), 0);
break;
default:
break;
}
}
if (!DS.hasAttributes())
return Result;
const Type *TypeNode = Result.getTypePtr();
Qualifiers Quals = Qualifiers::fromOpaqueValue(DS.getAttributeSpecs());
Quals.setIntentAttr(DS.getIntentSpec());
Quals.setAccessAttr(DS.getAccessSpec());
Result = C.getExtQualType(TypeNode, Quals);
if (!Quals.hasAttributeSpec(Qualifiers::AS_dimension))
return Result;
return ActOnArraySpec(C, Result, DS.getDimensions());
}