aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-05-04 16:32:21 +0000
committerDouglas Gregor <dgregor@apple.com>2012-05-04 16:32:21 +0000
commitd10099e5c8238fa0327f03921cf2e3c8975c881e (patch)
tree5a13e7a0ddc7b1c7866bbf826401161188218b45 /lib/Sema/SemaStmt.cpp
parentbbba25fa8e388e82e04f66784c2fc9f89b901abe (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/SemaStmt.cpp')
-rw-r--r--lib/Sema/SemaStmt.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 2d03ab99ef..407323d5fa 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -1350,9 +1350,9 @@ Sema::ActOnObjCForCollectionOperand(SourceLocation forLoc, Expr *collection) {
if (iface &&
RequireCompleteType(forLoc, QualType(objectType, 0),
getLangOpts().ObjCAutoRefCount
- ? PDiag(diag::err_arc_collection_forward)
- << collection->getSourceRange()
- : PDiag(0))) {
+ ? diag::err_arc_collection_forward
+ : 0,
+ collection)) {
// Otherwise, if we have any useful type information, check that
// the type declares the appropriate method.
} else if (iface || !objectType->qual_empty()) {
@@ -1659,7 +1659,7 @@ Sema::BuildCXXForRangeStmt(SourceLocation ForLoc, SourceLocation ColonLoc,
QualType RangeType = Range->getType();
if (RequireCompleteType(RangeLoc, RangeType,
- PDiag(diag::err_for_range_incomplete_type)))
+ diag::err_for_range_incomplete_type))
return StmtError();
// Build auto __begin = begin-expr, __end = end-expr.