diff options
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 74 |
1 files changed, 1 insertions, 73 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 6d0b6d7ce20..0b3febd0bdb 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -205,7 +205,7 @@ ASTContext::ASTContext(const LangOptions& LOpts, SourceManager &SM, DeclarationNames(*this), ExternalSource(0), Listener(0), PrintingPolicy(LOpts), LastSDM(0, 0), - UniqueBlockByRefTypeID(0), UniqueBlockParmTypeID(0) { + UniqueBlockByRefTypeID(0) { ObjCIdRedefinitionType = QualType(); ObjCClassRedefinitionType = QualType(); ObjCSelRedefinitionType = QualType(); @@ -3619,78 +3619,6 @@ ASTContext::BuildByRefType(llvm::StringRef DeclName, QualType Ty) const { return getPointerType(getTagDeclType(T)); } - -QualType ASTContext::getBlockParmType( - bool BlockHasCopyDispose, - llvm::SmallVectorImpl<const Expr *> &Layout) const { - - // FIXME: Move up - llvm::SmallString<36> Name; - llvm::raw_svector_ostream(Name) << "__block_literal_" - << ++UniqueBlockParmTypeID; - RecordDecl *T; - T = CreateRecordDecl(*this, TTK_Struct, TUDecl, SourceLocation(), - &Idents.get(Name.str())); - T->startDefinition(); - QualType FieldTypes[] = { - getPointerType(VoidPtrTy), - IntTy, - IntTy, - getPointerType(VoidPtrTy), - (BlockHasCopyDispose ? - getPointerType(getBlockDescriptorExtendedType()) : - getPointerType(getBlockDescriptorType())) - }; - - const char *FieldNames[] = { - "__isa", - "__flags", - "__reserved", - "__FuncPtr", - "__descriptor" - }; - - for (size_t i = 0; i < 5; ++i) { - FieldDecl *Field = FieldDecl::Create(*this, T, SourceLocation(), - &Idents.get(FieldNames[i]), - FieldTypes[i], /*TInfo=*/0, - /*BitWidth=*/0, /*Mutable=*/false); - Field->setAccess(AS_public); - T->addDecl(Field); - } - - for (unsigned i = 0; i < Layout.size(); ++i) { - const Expr *E = Layout[i]; - - QualType FieldType = E->getType(); - IdentifierInfo *FieldName = 0; - if (isa<CXXThisExpr>(E)) { - FieldName = &Idents.get("this"); - } else if (const BlockDeclRefExpr *BDRE = dyn_cast<BlockDeclRefExpr>(E)) { - const ValueDecl *D = BDRE->getDecl(); - FieldName = D->getIdentifier(); - if (BDRE->isByRef()) - FieldType = BuildByRefType(D->getName(), FieldType); - } else { - // Padding. - assert(isa<ConstantArrayType>(FieldType) && - isa<DeclRefExpr>(E) && - !cast<DeclRefExpr>(E)->getDecl()->getDeclName() && - "doesn't match characteristics of padding decl"); - } - - FieldDecl *Field = FieldDecl::Create(*this, T, SourceLocation(), - FieldName, FieldType, /*TInfo=*/0, - /*BitWidth=*/0, /*Mutable=*/false); - Field->setAccess(AS_public); - T->addDecl(Field); - } - - T->completeDefinition(); - - return getPointerType(getTagDeclType(T)); -} - void ASTContext::setObjCFastEnumerationStateType(QualType T) { const RecordType *Rec = T->getAs<RecordType>(); assert(Rec && "Invalid ObjCFAstEnumerationStateType"); |

