From: Douglas Gregor Date: Mon, 29 Mar 2010 20:28:52 +0000 (+0000) Subject: Exit early from the simple form of Sema::RequireNonAbstractType(), for X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb9bafeb9bcd8c92ab9647a4a3f074180ce6dedb;p=clang Exit early from the simple form of Sema::RequireNonAbstractType(), for a 2.47% speedup in 403.gcc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99830 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index ee16b9c4b1..a7671a2cf8 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -1939,6 +1939,9 @@ void Sema::ActOnDefaultCtorInitializers(DeclPtrTy CDtorDecl) { bool Sema::RequireNonAbstractType(SourceLocation Loc, QualType T, unsigned DiagID, AbstractDiagSelID SelID, const CXXRecordDecl *CurrentRD) { + if (!getLangOptions().CPlusPlus) + return false; + if (SelID == -1) return RequireNonAbstractType(Loc, T, PDiag(DiagID), CurrentRD);