After this change, clang spends ~200ms parsing Attrs.inc instead of
~560ms. A large part of the cost was from the StringSwitch
instantiations, but this is a good way to avoid similar problems in the
future.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Are there any classes of methods which are worth continuing to generate inline? Surely some of the accessors are trivial.
Comment Actions
The main things going out of line are:
- Create* factory methods
- Constructors
- Enum/string converters (use StringSwitch -> slow to instantiate)
Here's two examples from before & after:
https://reviews.llvm.org/P8203
https://reviews.llvm.org/P8204
The constructors and factory methods *could* be trivial, but some of them are quite complex.
clang/utils/TableGen/ClangAttrEmitter.cpp | ||
---|---|---|
269 | Most trivial accessors are still defined inline, like here. I think there's only one override of writeAccesorDefinitions. |
Comment Actions
LGTM as well, though please run clang-format over the patch (some of the formatting looks to have gone weird in places).
Comment Actions
Thanks, done. I undid some of its more questionable reformattings in writeCtorBody where the original formatting more clearly shows the generated code.
Most trivial accessors are still defined inline, like here. I think there's only one override of writeAccesorDefinitions.