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

Olivier Goffart via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 22 03:33:00 PST 2016


ogoffart marked an inline comment as done.
ogoffart added a comment.

In https://reviews.llvm.org/D26465#607860, @arphaman wrote:

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


It was benchamerked with https://github.com/woboq/woboq_codebrowser generating itself.  
The code does not contain warnings.  (unless you really consider the warn_cxx98_compat_* to be warnings)



================
Comment at: lib/Basic/DiagnosticIDs.cpp:423
+    Mapping = &Pos->State->getOrAddMapping((diag::kind)DiagID);
+  }
 
----------------
arphaman wrote:
> 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.
The problem is that most things are private in DiagnosticsEngine, so i made it a privte member of DiagnosticIds (which is a friend)


https://reviews.llvm.org/D26465





More information about the cfe-commits mailing list