diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-05-04 16:32:21 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-05-04 16:32:21 +0000 |
commit | d10099e5c8238fa0327f03921cf2e3c8975c881e (patch) | |
tree | 5a13e7a0ddc7b1c7866bbf826401161188218b45 /lib/Sema/SemaInit.cpp | |
parent | bbba25fa8e388e82e04f66784c2fc9f89b901abe (diff) |
Move Sema::RequireCompleteType() and Sema::RequireCompleteExprType()
off PartialDiagnostic. PartialDiagnostic is rather heavyweight for
something that is in the critical path and is rarely used. So, switch
over to an abstract-class-based callback mechanism that delays most of
the work until a diagnostic is actually produced. Good for ~11k code
size reduction in the compiler and 1% speedup in -fsyntax-only on the
code in <rdar://problem/11004361>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 7d88c7eea9..0ef1b1e81f 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -3108,7 +3108,7 @@ static void TryListInitialization(Sema &S, return; } if (DestType->isRecordType()) { - if (S.RequireCompleteType(InitList->getLocStart(), DestType, S.PDiag())) { + if (S.RequireCompleteType(InitList->getLocStart(), DestType, 0)) { Sequence.setIncompleteTypeFailure(DestType); return; } @@ -4452,7 +4452,7 @@ static ExprResult CopyObject(Sema &S, SourceLocation Loc = getInitializationLoc(Entity, CurInit.get()); // Make sure that the type we are copying is complete. - if (S.RequireCompleteType(Loc, T, S.PDiag(diag::err_temp_copy_incomplete))) + if (S.RequireCompleteType(Loc, T, diag::err_temp_copy_incomplete)) return move(CurInit); // Perform overload resolution using the class's copy/move constructors. @@ -4516,7 +4516,7 @@ static ExprResult CopyObject(Sema &S, for (unsigned I = 1, N = Constructor->getNumParams(); I != N; ++I) { ParmVarDecl *Parm = Constructor->getParamDecl(I); if (S.RequireCompleteType(Loc, Parm->getType(), - S.PDiag(diag::err_call_incomplete_argument))) + diag::err_call_incomplete_argument)) break; // Build the default argument expression; we don't actually care |