本文整理汇总了C++中ASTContext::getTypes方法的典型用法代码示例。如果您正苦于以下问题:C++ ASTContext::getTypes方法的具体用法?C++ ASTContext::getTypes怎么用?C++ ASTContext::getTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASTContext
的用法示例。
在下文中一共展示了ASTContext::getTypes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printer
void
TraverseTUnitConsumer::InvestigateASTContextTypes( ASTContext& context )
{
// const SmallVectorImpl<Type *>&
auto& types = context.getTypes();
TypePrinter printer(context.getPrintingPolicy(), /* indentation */ 2);
const char *placeholder = ""; // "hey"
for(const Type *type : types) {
llvm::errs() << " - ";
printer.print(type, Qualifiers(), llvm::errs(), placeholder);
llvm::errs() << "\n";
}
(terrs().magenta() << "InvestigateASTContextTypes(): END.\n").reset();
}
示例2: Create
void Type::Create(ASTContext& Context, unsigned i, Deserializer& D) {
Type::TypeClass K = static_cast<Type::TypeClass>(D.ReadInt());
SerializedPtrID PtrID = D.ReadPtrID();
switch (K) {
default:
assert (false && "Deserialization for type not supported.");
break;
case Type::Builtin:
assert (i < Context.getTypes().size());
assert (isa<BuiltinType>(Context.getTypes()[i]));
D.RegisterPtr(PtrID,Context.getTypes()[i]);
break;
case Type::ExtQual:
D.RegisterPtr(PtrID,ExtQualType::CreateImpl(Context,D));
break;
case Type::Complex:
D.RegisterPtr(PtrID,ComplexType::CreateImpl(Context,D));
break;
case Type::ConstantArray:
D.RegisterPtr(PtrID,ConstantArrayType::CreateImpl(Context,D));
break;
case Type::FunctionNoProto:
D.RegisterPtr(PtrID,FunctionNoProtoType::CreateImpl(Context,D));
break;
case Type::FunctionProto:
D.RegisterPtr(PtrID,FunctionProtoType::CreateImpl(Context,D));
break;
case Type::IncompleteArray:
D.RegisterPtr(PtrID,IncompleteArrayType::CreateImpl(Context,D));
break;
case Type::MemberPointer:
D.RegisterPtr(PtrID, MemberPointerType::CreateImpl(Context, D));
break;
case Type::Pointer:
D.RegisterPtr(PtrID, PointerType::CreateImpl(Context, D));
break;
case Type::BlockPointer:
D.RegisterPtr(PtrID, BlockPointerType::CreateImpl(Context, D));
break;
case Type::LValueReference:
D.RegisterPtr(PtrID, LValueReferenceType::CreateImpl(Context, D));
break;
case Type::RValueReference:
D.RegisterPtr(PtrID, RValueReferenceType::CreateImpl(Context, D));
break;
case Type::Record:
case Type::Enum:
// FIXME: Implement this!
assert(false && "Can't deserialize tag types!");
break;
case Type::Typedef:
D.RegisterPtr(PtrID, TypedefType::CreateImpl(Context, D));
break;
case Type::TypeOfExpr:
D.RegisterPtr(PtrID, TypeOfExprType::CreateImpl(Context, D));
break;
case Type::TypeOf:
D.RegisterPtr(PtrID, TypeOfType::CreateImpl(Context, D));
break;
case Type::TemplateTypeParm:
D.RegisterPtr(PtrID, TemplateTypeParmType::CreateImpl(Context, D));
break;
case Type::VariableArray:
D.RegisterPtr(PtrID, VariableArrayType::CreateImpl(Context, D));
break;
}
}