[PATCH] D53995: [analyzer] Drastically simplify the tblgen files used for checkers
Umann Kristóf via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 1 13:56:01 PDT 2018
Szelethus created this revision.
Szelethus added reviewers: NoQ, george.karpenkov, xazax.hun, MTC.
Herald added subscribers: cfe-commits, dkrupp, donat.nagy, jfb, mikhail.ramalho, a.sidorin, rnkovacs, szepet, whisperity.
TL;DR: Interestingly, only about the quarter of the emitter file is used, the `DescFile` entry hasn't ever been touched [1], and the entire concept of groups is a mystery, so I removed them.
Details:
Now that I've spent quite a lot of time digging through how the analyzer is invoked, specifically analyzer configurations, I wanted to make sense out of the (in my opinion) somewhat outdated checker option issue, and more generally, checker registration.
@NoQ mentioned on the mailing list [2] that maybe it'd be worth converting the tblgen solution to a .def file, which makes a lot of sense:
- As far as I know, tblgen is mainly used by actual LLVM backend developers, and folks on the Static Analyzer may not be that familiar with the language.
- We wouldn't need to run tblgen to see what the file actually will turn into, that is a feature I'd really appreciate.
- Somewhat related to the earlier point, but unless you spend 10-20 minutes figuring out where checkers come from, it would seem they are created out of thin air. Changing to a .def format removes an unnecessary complication.
There are some cons though:
- tblgen files look awesome. I get that this isn't a very strong point, but it's a pretty sight compared to a .def file.
- It would probably imply very invasive changes in a lot of files doing the checker registration, because there's a lot of work the emitter does, that would ideally need to be handled inside the analyzer.
I did this change, so that I had less complications to deal with, should we agree that a change to .def is a good idea.
[1] http://lists.llvm.org/pipermail/cfe-dev/2018-October/059664.html
[2] http://lists.llvm.org/pipermail/cfe-dev/2018-October/059976.html
Repository:
rC Clang
https://reviews.llvm.org/D53995
Files:
include/clang/Driver/CC1Options.td
include/clang/StaticAnalyzer/Checkers/CheckerBase.td
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.cpp
lib/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h
lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
utils/TableGen/ClangSACheckersEmitter.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53995.172215.patch
Type: text/x-patch
Size: 51564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181101/d44b7f4d/attachment-0001.bin>
More information about the cfe-commits
mailing list