aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-29 20:28:52 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-29 20:28:52 +0000
commitcb9bafeb9bcd8c92ab9647a4a3f074180ce6dedb (patch)
treea91238fdf24ea4b5c17d0dda0d8b88311a04d85c
parent1c3639351f8c252ddcc13d234cabf8780b1c235f (diff)
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
-rw-r--r--lib/Sema/SemaDeclCXX.cpp3
1 files changed, 3 insertions, 0 deletions
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);