diff options
author | Haojian Wu <hokein.wu@gmail.com> | 2022-08-16 21:23:11 +0200 |
---|---|---|
committer | Haojian Wu <hokein.wu@gmail.com> | 2022-08-17 14:30:53 +0200 |
commit | 6a9f79e1020db9f581d00791f1f644b64facfebe (patch) | |
tree | 45cfe7ce4c9905c96fa39cb7c24ad82d991919b7 /clang/lib/Frontend/TestModuleFileExtension.cpp | |
parent | d7e06d5675b62b5d3d89e6d6210c34b74a1a8356 (diff) | |
download | llvm-6a9f79e1020db9f581d00791f1f644b64facfebe.zip llvm-6a9f79e1020db9f581d00791f1f644b64facfebe.tar.gz llvm-6a9f79e1020db9f581d00791f1f644b64facfebe.tar.bz2 |
[pseudo] Eliminate the type-name identifier ambiguities in the grammar.
See https://reviews.llvm.org/D130626 for motivation.
Identifier in the grammar has different categories (type-name, template-name,
namespace-name), they requires semantic information to resolve. This patch is
to eliminate the "local" ambiguities in type-name, and namespace-name, which
gives us a performance boost of the parser:
- eliminate all different type rules (class-name, enum-name, typedef-name), and
fold them into a unified type-name, this removes the #1 type-name ambiguity, and
gives us a big performance boost;
- remove the namespace-alis rules, as they're hard and uninteresting;
Note that we could eliminate more and gain more performance (like fold template-name,
type-name, namespace together), but at current stage, we'd like keep all existing
categories of the identifier (as they might assist in correlated disambiguation &
keep the representation of important concepts uniform).
| file |ambiguous nodes | forest size | glrParse performance |
|SemaCodeComplete.cpp| 11k -> 5.7K | 10.4MB -> 7.9MB | 7.1MB/s -> 9.98MB/s |
| AST.cpp | 1.3k -> 0.73K | 0.99MB -> 0.77MB | 6.7MB/s -> 8.4MB/s |
Differential Revision: https://reviews.llvm.org/D130747
Diffstat (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions