From cb9bafeb9bcd8c92ab9647a4a3f074180ce6dedb Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 29 Mar 2010 20:28:52 +0000 Subject: [PATCH] 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 --- lib/Sema/SemaDeclCXX.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.50.1