Home | History | Annotate | Download | only in src

Lines Matching full:clang

21 #include <clang/Tooling/Core/QualTypeNames.h>
22 #include <clang/Index/CodegenNameGenerator.h>
29 clang::MangleContext *mangle_contextp,
30 clang::ASTContext *ast_contextp,
31 const clang::CompilerInstance *cip,
41 const clang::Decl *decl, const clang::CompilerInstance *cip) {
50 static const clang::TagDecl *GetTagDecl(clang::QualType qual_type) {
51 const clang::Type *type_ptr = qual_type.getCanonicalType().getTypePtr();
53 const clang::TagDecl *tag_decl = type_ptr->getAsTagDecl();
57 static const clang::RecordDecl *GetAnonymousRecord(clang::QualType type) {
58 const clang::Type *type_ptr = type.getTypePtr();
63 const clang::TagDecl *tag_decl = type_ptr->getAsTagDecl();
67 const clang::RecordDecl *record_decl =
68 llvm::dyn_cast<clang::RecordDecl>(tag_decl);
77 static const clang::EnumDecl *GetAnonymousEnum(
78 const clang::QualType qual_type) {
79 const clang::Type *type_ptr = qual_type.getTypePtr();
81 const clang::TagDecl *tag_decl = type_ptr->getAsTagDecl();
85 const clang::EnumDecl *enum_decl = llvm::dyn_cast<clang::EnumDecl>(tag_decl);
92 static bool IsReferencingType(clang::QualType qual_type) {
93 const clang::QualType canonical_type = qual_type.getCanonicalType();
94 const clang::Type *base_type = canonical_type.getTypePtr();
102 static clang::QualType GetReferencedType(const clang::QualType qual_type);
104 static clang::QualType GetFinalReferencedType(clang::QualType qual_type) {
111 std::string ABIWrapper::TypeNameWithFinalDestination(clang::QualType qual_type) {
112 clang::QualType canonical_qual_type = qual_type.getCanonicalType();
114 clang::QualType final_destination_type =
116 const clang::RecordDecl *anon_record =
119 clang::SourceManager &sm = cip_->getSourceManager();
120 clang::SourceLocation location = anon_record->getLocation();
126 std::string ABIWrapper::GetKeyForTypeId(clang::QualType qual_type) {
127 clang::QualType canonical_qual_type = qual_type.getCanonicalType();
128 clang::QualType final_destination_type =
138 std::string ABIWrapper::GetDeclSourceFile(const clang::Decl *decl,
139 const clang::CompilerInstance *cip) {
140 clang::SourceManager &sm = cip->getSourceManager();
141 clang::SourceLocation location = decl->getLocation();
148 clang::SourceLocation expansion_location = sm.getExpansionLoc(location);
154 const clang::AccessSpecifier sp) {
156 case clang::AS_private: {
160 case clang::AS_protected: {
171 bool ABIWrapper::CreateAnonymousRecord(const clang::RecordDecl *record_decl) {
182 static clang::QualType GetReferencedType(const clang::QualType qual_type) {
183 const clang::Type *type_ptr = qual_type.getTypePtr();
198 clang::QualType qual_type,
200 const clang::QualType canonical_type = qual_type.getCanonicalType();
208 clang::QualType qual_type, const std::string &source_file) {
210 const clang::QualType canonical_type = qual_type.getCanonicalType();
211 const clang::Type *base_type = canonical_type.getTypePtr();
237 const clang::CXXRecordDecl *cxx_record_decl) {
238 clang::QualType qual_type =
246 std::string ABIWrapper::GetTypeUniqueId(const clang::TagDecl *tag_decl) {
250 clang::QualType qual_type =
266 clang::QualType canonical_type,
270 const clang::Type *base_type = canonical_type.getTypePtr();
272 clang::Type::TypeClass type_class = base_type->getTypeClass();
274 if ((type_class != clang::Type::Auto) && !base_type->isIncompleteType() &&
276 std::pair<clang::CharUnits, clang::CharUnits> size_and_alignment =
291 clang::QualType referenced_type = GetReferencedType(canonical_type);
299 std::string ABIWrapper::GetTypeLinkageName(const clang::Type *typep) {
301 clang::QualType qt = typep->getCanonicalTypeInternal();
309 const clang::QualType canonical_type, const std::string &source_file) {
319 const clang::Type *type_ptr = canonical_type.getTypePtr();
352 llvm::dyn_cast<const clang::FunctionType>(type_ptr)) {
363 const clang::RecordDecl *anon_record = GetAnonymousRecord(canonical_type);
373 const clang::NamedDecl *decl, clang::MangleContext *mangle_contextp) {
375 clang::IdentifierInfo *identifier = decl->getIdentifier();
386 const clang::TagDecl *decl) {
394 const clang::TemplateArgumentList *tl,
399 const clang::TemplateArgument &arg = (*tl)[i];
401 if (arg.getKind() != clang::TemplateArgument::Type) {
404 clang::QualType type = arg.getAsType();
418 const clang::QualType &sweet_qt) {
419 const clang::QualType salty_qt = sweet_qt.getCanonicalType();
420 // clang::TypeName::getFullyQualifiedName removes the part of the type related
425 return clang::TypeName::getFullyQualifiedName(salty_qt, *ast_contextp_);
429 clang::MangleContext *mangle_contextp, clang::ASTContext *ast_contextp,
430 const clang::CompilerInstance *compiler_instance_p,
431 const clang::FunctionType *function_type, abi_util::IRDumper *ir_dumper,
443 const clang::FunctionProtoType *function_pt =
444 llvm::dyn_cast<clang::FunctionProtoType>(function_type_);
449 clang::QualType param_type = function_pt->getParamType(i);
460 clang::QualType canonical_type = function_type_->getCanonicalTypeInternal();
470 clang::MangleContext *mangle_contextp,
471 clang::ASTContext *ast_contextp,
472 const clang::CompilerInstance *compiler_instance_p,
473 const clang::FunctionDecl *decl,
482 const clang::CXXMethodDecl *cxx_method_decl =
483 llvm::dyn_cast<clang::CXXMethodDecl>(function_decl_);
488 clang::QualType this_type = cxx_method_decl->getThisType(*ast_contextp_);
493 abi_util::CFunctionLikeIR *functionp, const clang::QualType qual_type,
508 clang::FunctionDecl::param_const_iterator param_it =
519 clang::QualType param_qt = (*param_it)->getType();
536 clang::QualType return_type = function_decl_->getReturnType();
550 case clang::FunctionDecl::TK_FunctionTemplateSpecialization: {
551 const clang::TemplateArgumentList *arg_list =
576 clang::MangleContext *mangle_contextp,
577 clang::ASTContext *ast_contextp,
578 const clang::CompilerInstance *compiler_instance_p,
579 const clang::RecordDecl *decl, abi_util::IRDumper *ir_dumper,
587 clang::RecordDecl::field_iterator field = record_decl_->field_begin();
589 const clang::ASTRecordLayout &record_layout =
592 clang::QualType field_type = field->getType();
594 if (const clang::EnumDecl *enum_decl =
616 const clang::CXXRecordDecl *cxx_record_decl) {
620 clang::CXXRecordDecl::base_class_const_iterator base_class =
638 const clang::CXXRecordDecl *cxx_record_decl) {
642 clang::VTableContextBase *base_vtable_contextp =
644 const clang::Type *typep = cxx_record_decl->getTypeForDecl();
649 clang::ItaniumVTableContext *itanium_vtable_contextp =
650 llvm::dyn_cast<clang::ItaniumVTableContext>(base_vtable_contextp);
655 const clang::VTableLayout &vtable_layout =
668 const clang::VTableComponent &vtable_component) {
674 clang::VTableComponent::Kind clang_component_kind =
677 case clang::VTableComponent::CK_VCallOffset:
681 case clang::VTableComponent::CK_VBaseOffset:
685 case clang::VTableComponent::CK_OffsetToTop:
689 case clang::VTableComponent::CK_RTTI:
692 const clang::CXXRecordDecl *rtti_decl =
698 case clang::VTableComponent::CK_FunctionPointer:
699 case clang::VTableComponent::CK_CompleteDtorPointer:
700 case clang::VTableComponent::CK_DeletingDtorPointer:
701 case clang::VTableComponent::CK_UnusedFunctionPointer:
703 const clang::CXXMethodDecl *method_decl =
707 case clang::VTableComponent::CK_FunctionPointer:
712 case clang::VTableComponent::CK_CompleteDtorPointer:
716 clang::CXXDtorType::Dtor_Complete, ostream);
719 case clang::VTableComponent::CK_DeletingDtorPointer:
723 clang::CXXDtorType::Dtor_Deleting, ostream);
726 case clang::VTableComponent::CK_UnusedFunctionPointer:
742 const clang::CXXRecordDecl *cxx_record_decl,
745 const clang::ClassTemplateSpecializationDecl *specialization_decl =
746 clang::dyn_cast<clang::ClassTemplateSpecializationDecl>(cxx_record_decl);
748 const clang::TemplateArgumentList *arg_list =
774 const clang::Type *basic_type = nullptr;
778 clang::QualType qual_type = basic_type->getCanonicalTypeInternal();
795 const clang::CXXRecordDecl *cxx_record_decl =
796 clang::dyn_cast<clang::CXXRecordDecl>(record_decl_);
805 // TODO: Can we use clang's ODR hash to do faster ODR checking ?
823 clang::MangleContext *mangle_contextp,
824 clang::ASTContext *ast_contextp,
825 const clang::CompilerInstance *compiler_instance_p,
826 const clang::EnumDecl *decl, abi_util::IRDumper *ir_dumper,
836 clang::EnumDecl::enumerator_iterator enum_it = enum_decl_->enumerator_begin();
849 clang::QualType enum_qual_type =
875 clang::MangleContext *mangle_contextp,
876 clang::ASTContext *ast_contextp,
877 const clang::CompilerInstance *compiler_instance_p,
878 const clang::VarDecl *decl, abi_util::IRDumper *ir_dumper,
887 // Temporary fix : clang segfaults on trying to mangle global variable which