[PATCH] D26465: [Diag] Optimize DiagnosticIDs::getDiagnosticSeverity

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 29 07:22:24 PST 2016


arphaman added a comment.

Is there any way to test this change?

> This saves more than 5% of the parsing time according to perf.

That sounds great. What did you test the parsing on? Will this patch get similar improvements for code that compiles without errors and warnings?



================
Comment at: lib/Basic/DiagnosticIDs.cpp:423
+    Mapping = &Pos->State->getOrAddMapping((diag::kind)DiagID);
+  }
 
----------------
I think it would be better if you wrap this piece of code in a static function that returns `DiagnosticMapping &`, as it should allow you to get rid of all these `.` to `->` changes below.


https://reviews.llvm.org/D26465





More information about the cfe-commits mailing list