[cfe-commits] [PATCH] Speed up parsing of global declarations.

Manuel Klimek klimek at google.com
Tue Dec 11 02:59:51 PST 2012

Comment at: lib/Sema/SemaDecl.cpp:7242
@@ -7241,2 +7241,3 @@
-    if (!prev)
+      if (!prev && getDiagnostics().getDiagnosticLevel(
+                       diag::warn_missing_variable_declarations,
Joey Gouly wrote:
> I'm just wondering if we couldn't make this check on all diagnostics. 
On IRC Chandler proposed yesterday that a long-term solution to this problem would be to change diagnostics to a pattern like:
if (DiagStream *DS = Diag(var-getLocation(), diag::warn...) {
  *DS << var;

I personally think that's a good plan, but orthogonal to us fixing where we're missing checks in the hot path right now.


More information about the cfe-commits mailing list