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/SemaExceptionSpec.cpp | |
parent | bbba25fa8e388e82e04f66784c2fc9f89b901abe (diff) | |
download | clang-d10099e5c8238fa0327f03921cf2e3c8975c881e.tar.gz |
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/SemaExceptionSpec.cpp')
-rw-r--r-- | lib/Sema/SemaExceptionSpec.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/SemaExceptionSpec.cpp b/lib/Sema/SemaExceptionSpec.cpp index ec33f0ac8e..f88ead56f4 100644 --- a/lib/Sema/SemaExceptionSpec.cpp +++ b/lib/Sema/SemaExceptionSpec.cpp @@ -51,7 +51,8 @@ bool Sema::CheckSpecifiedExceptionType(QualType T, const SourceRange &Range) { // C++ 15.4p2: A type denoted in an exception-specification shall not denote // an incomplete type. if (RequireCompleteType(Range.getBegin(), T, - PDiag(diag::err_incomplete_in_exception_spec) << /*direct*/0 << Range)) + diag::err_incomplete_in_exception_spec, + /*direct*/0, Range)) return true; // C++ 15.4p2: A type denoted in an exception-specification shall not denote @@ -71,8 +72,9 @@ bool Sema::CheckSpecifiedExceptionType(QualType T, const SourceRange &Range) { if (T->isRecordType() && T->getAs<RecordType>()->isBeingDefined()) return false; - if (!T->isVoidType() && RequireCompleteType(Range.getBegin(), T, - PDiag(diag::err_incomplete_in_exception_spec) << kind << Range)) + if (!T->isVoidType() && + RequireCompleteType(Range.getBegin(), T, + diag::err_incomplete_in_exception_spec, kind, Range)) return true; return false; |