From 0a598fd7e428b5eb28b67770a66f3976ac365e42 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 27 Jun 2013 20:48:08 +0000 Subject: [PATCH] Delete dead code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185101 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/ASTContext.h | 1 - include/clang/AST/Stmt.h | 7 ------- include/clang/AST/Type.h | 5 ----- include/clang/AST/VTableBuilder.h | 6 ------ lib/AST/ASTContext.cpp | 9 --------- lib/AST/Stmt.cpp | 22 ---------------------- lib/AST/Type.cpp | 25 +++++-------------------- lib/AST/VTableBuilder.cpp | 11 +---------- 8 files changed, 6 insertions(+), 80 deletions(-) diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index ea772647f9..3f810f9a03 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -1918,7 +1918,6 @@ public: bool isObjCSelType(QualType T) const { return T == getObjCSelType(); } - bool QualifiedIdConformsQualifiedId(QualType LHS, QualType RHS); bool ObjCQualifiedIdTypesAreCompatible(QualType LHS, QualType RHS, bool ForCompare); diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 731a5d0b18..dff9a1df75 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -397,13 +397,6 @@ public: const_cast(this)->stripLabelLikeStatements()); } - /// hasImplicitControlFlow - Some statements (e.g. short circuited operations) - /// contain implicit control-flow in the order their subexpressions - /// are evaluated. This predicate returns true if this statement has - /// such implicit control-flow. Such statements are also specially handled - /// within CFGs. - bool hasImplicitControlFlow() const; - /// Child Iterators: All subclasses must implement 'children' /// to permit easy iteration over the substatements/subexpessions of an /// AST node. This permits easy iteration over all nodes in the AST. diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 2566268a62..1133d126c3 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -1512,7 +1512,6 @@ public: bool isRealType() const; // C99 6.2.5p17 (real floating + integer) bool isArithmeticType() const; // C99 6.2.5p18 (integer + floating) bool isVoidType() const; // C99 6.2.5p19 - bool isDerivedType() const; // C99 6.2.5p20 bool isScalarType() const; // C99 6.2.5p21 (arithmetic + pointers) bool isAggregateType() const; bool isFundamentalType() const; @@ -3707,10 +3706,6 @@ class TemplateSpecializationType public: /// \brief Determine whether any of the given template arguments are /// dependent. - static bool anyDependentTemplateArguments(const TemplateArgument *Args, - unsigned NumArgs, - bool &InstantiationDependent); - static bool anyDependentTemplateArguments(const TemplateArgumentLoc *Args, unsigned NumArgs, bool &InstantiationDependent); diff --git a/include/clang/AST/VTableBuilder.h b/include/clang/AST/VTableBuilder.h index efd388dcfd..d445d74fa1 100644 --- a/include/clang/AST/VTableBuilder.h +++ b/include/clang/AST/VTableBuilder.h @@ -267,8 +267,6 @@ public: }; class VTableContext { - ASTContext &Context; - public: typedef SmallVector, 1> VTableThunksTy; @@ -306,10 +304,6 @@ private: /// given record decl. void ComputeVTableRelatedInformation(const CXXRecordDecl *RD); - /// ErrorUnsupported - Print out an error that the v-table layout code - /// doesn't support the particular C++ feature yet. - void ErrorUnsupported(StringRef Feature, SourceLocation Location); - public: VTableContext(ASTContext &Context); ~VTableContext(); diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 44cb32db01..8374316ac6 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -6419,15 +6419,6 @@ ASTContext::ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto, return false; } -/// QualifiedIdConformsQualifiedId - compare id with id -/// return true if lhs's protocols conform to rhs's protocol; false -/// otherwise. -bool ASTContext::QualifiedIdConformsQualifiedId(QualType lhs, QualType rhs) { - if (lhs->isObjCQualifiedIdType() && rhs->isObjCQualifiedIdType()) - return ObjCQualifiedIdTypesAreCompatible(lhs, rhs, false); - return false; -} - /// ObjCQualifiedClassTypesAreCompatible - compare Class and /// Class. bool ASTContext::ObjCQualifiedClassTypesAreCompatible(QualType lhs, diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 7e85880b5f..d9d79f4ccc 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -298,28 +298,6 @@ AttributedStmt *AttributedStmt::CreateEmpty(ASTContext &C, unsigned NumAttrs) { return new (Mem) AttributedStmt(EmptyShell(), NumAttrs); } -bool Stmt::hasImplicitControlFlow() const { - switch (StmtBits.sClass) { - default: - return false; - - case CallExprClass: - case ConditionalOperatorClass: - case ChooseExprClass: - case StmtExprClass: - case DeclStmtClass: - return true; - - case Stmt::BinaryOperatorClass: { - const BinaryOperator* B = cast(this); - if (B->isLogicalOp() || B->getOpcode() == BO_Comma) - return true; - else - return false; - } - } -} - std::string AsmStmt::generateAsmString(ASTContext &C) const { if (const GCCAsmStmt *gccAsmStmt = dyn_cast(this)) return gccAsmStmt->generateAsmString(C); diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index c32df11b66..af4ea09672 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -357,23 +357,6 @@ const Type *Type::getUnqualifiedDesugaredType() const { } } } - -bool Type::isDerivedType() const { - switch (CanonicalType->getTypeClass()) { - case Pointer: - case VariableArray: - case ConstantArray: - case IncompleteArray: - case FunctionProto: - case FunctionNoProto: - case LValueReference: - case RValueReference: - case Record: - return true; - default: - return false; - } -} bool Type::isClassType() const { if (const RecordType *RT = getAs()) return RT->getDecl()->isClass(); @@ -1917,7 +1900,8 @@ anyDependentTemplateArguments(const TemplateArgumentLoc *Args, unsigned N, return false; } -bool TemplateSpecializationType:: +#ifndef NDEBUG +static bool anyDependentTemplateArguments(const TemplateArgument *Args, unsigned N, bool &InstantiationDependent) { for (unsigned i = 0; i != N; ++i) { @@ -1931,6 +1915,7 @@ anyDependentTemplateArguments(const TemplateArgument *Args, unsigned N, } return false; } +#endif TemplateSpecializationType:: TemplateSpecializationType(TemplateName T, @@ -1954,8 +1939,8 @@ TemplateSpecializationType(TemplateName T, (void)InstantiationDependent; assert((!Canon.isNull() || T.isDependent() || - anyDependentTemplateArguments(Args, NumArgs, - InstantiationDependent)) && + ::anyDependentTemplateArguments(Args, NumArgs, + InstantiationDependent)) && "No canonical type for non-dependent class template specialization"); TemplateArgument *TemplateArgs diff --git a/lib/AST/VTableBuilder.cpp b/lib/AST/VTableBuilder.cpp index 65e11b7af8..74669d565d 100644 --- a/lib/AST/VTableBuilder.cpp +++ b/lib/AST/VTableBuilder.cpp @@ -2272,8 +2272,7 @@ VTableLayout::VTableLayout(uint64_t NumVTableComponents, VTableLayout::~VTableLayout() { } VTableContext::VTableContext(ASTContext &Context) - : Context(Context), - IsMicrosoftABI(Context.getTargetInfo().getCXXABI().isMicrosoft()) { + : IsMicrosoftABI(Context.getTargetInfo().getCXXABI().isMicrosoft()) { } VTableContext::~VTableContext() { @@ -2378,14 +2377,6 @@ void VTableContext::ComputeVTableRelatedInformation(const CXXRecordDecl *RD) { } } -void VTableContext::ErrorUnsupported(StringRef Feature, - SourceLocation Location) { - clang::DiagnosticsEngine &Diags = Context.getDiagnostics(); - unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error, - "v-table layout for %0 is not supported yet"); - Diags.Report(Context.getFullLoc(Location), DiagID) << Feature; -} - VTableLayout *VTableContext::createConstructionVTableLayout( const CXXRecordDecl *MostDerivedClass, CharUnits MostDerivedClassOffset, -- 2.40.0