about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-08-11 14:37:21 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-08-11 20:46:41 +1000
commit4f8a1702bab38730bf2386e2e3df57b63a768077 (patch)
tree1b9e5b2dc974f040a13314f783fb4c9dd6bd7f5a /src
parent85c749266d1e9a38a9fd9c45ef417d0d464ef634 (diff)
Add a second level to the AST size reporting.
This tells you which variants of the enums are most common, which is
very useful. I've only done it for the AST for now, HIR can be done
later.
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/stats/hir-stats.rs4
-rw-r--r--src/test/ui/stats/hir-stats.stderr60
2 files changed, 62 insertions, 2 deletions
diff --git a/src/test/ui/stats/hir-stats.rs b/src/test/ui/stats/hir-stats.rs
index 3c59ee22f24..a24b3ada57e 100644
--- a/src/test/ui/stats/hir-stats.rs
+++ b/src/test/ui/stats/hir-stats.rs
@@ -2,8 +2,8 @@
 // compile-flags: -Zhir-stats
 // only-x86_64
 
-// The aim here is to include at least one of every different type of AST/HIR
-// node reported by `-Zhir-stats`.
+// The aim here is to include at least one of every different type of top-level
+// AST/HIR node reported by `-Zhir-stats`.
 
 #![allow(dead_code)]
 
diff --git a/src/test/ui/stats/hir-stats.stderr b/src/test/ui/stats/hir-stats.stderr
index 132fff1972f..f4874408c90 100644
--- a/src/test/ui/stats/hir-stats.stderr
+++ b/src/test/ui/stats/hir-stats.stderr
@@ -5,26 +5,55 @@ Name                Accumulated Size         Count     Item Size
 ----------------------------------------------------------------
 ExprField                 48 ( 0.5%)             1            48
 GenericArgs               64 ( 0.7%)             1            64
+- AngleBracketed            64 ( 0.7%)             1
 Local                     72 ( 0.8%)             1            72
 WherePredicate            72 ( 0.8%)             1            72
+- BoundPredicate            72 ( 0.8%)             1
 Crate                     72 ( 0.8%)             1            72
 Arm                       96 ( 1.0%)             2            48
 FieldDef                 160 ( 1.7%)             2            80
 ForeignItem              160 ( 1.7%)             1           160
+- Fn                       160 ( 1.7%)             1
 Stmt                     160 ( 1.7%)             5            32
+- Local                     32 ( 0.3%)             1
+- MacCall                   32 ( 0.3%)             1
+- Expr                      96 ( 1.0%)             3
 Param                    160 ( 1.7%)             4            40
 FnDecl                   200 ( 2.2%)             5            40
 Variant                  240 ( 2.6%)             2           120
 Block                    288 ( 3.1%)             6            48
 Attribute                304 ( 3.3%)             2           152
+- Normal                   152 ( 1.7%)             1
+- DocComment               152 ( 1.7%)             1
 GenericBound             352 ( 3.8%)             4            88
+- Trait                    352 ( 3.8%)             4
 GenericParam             520 ( 5.7%)             5           104
 AssocItem                640 ( 7.0%)             4           160
+- TyAlias                  320 ( 3.5%)             2
+- Fn                       320 ( 3.5%)             2
 PathSegment              720 ( 7.9%)            30            24
 Expr                     832 ( 9.1%)             8           104
+- Path                     104 ( 1.1%)             1
+- Match                    104 ( 1.1%)             1
+- Struct                   104 ( 1.1%)             1
+- Lit                      208 ( 2.3%)             2
+- Block                    312 ( 3.4%)             3
 Pat                      840 ( 9.2%)             7           120
+- Struct                   120 ( 1.3%)             1
+- Wild                     120 ( 1.3%)             1
+- Ident                    600 ( 6.6%)             5
 Ty                     1_344 (14.7%)            14            96
+- Rptr                      96 ( 1.0%)             1
+- Ptr                       96 ( 1.0%)             1
+- ImplicitSelf             192 ( 2.1%)             2
+- Path                     960 (10.5%)            10
 Item                   1_800 (19.7%)             9           200
+- Trait                    200 ( 2.2%)             1
+- Enum                     200 ( 2.2%)             1
+- ForeignMod               200 ( 2.2%)             1
+- Impl                     200 ( 2.2%)             1
+- Fn                       400 ( 4.4%)             2
+- Use                      600 ( 6.6%)             3
 ----------------------------------------------------------------
 Total                  9_144
 
@@ -35,27 +64,58 @@ Name                Accumulated Size         Count     Item Size
 ----------------------------------------------------------------
 ExprField                 48 ( 0.5%)             1            48
 GenericArgs               64 ( 0.6%)             1            64
+- AngleBracketed            64 ( 0.6%)             1
 Local                     72 ( 0.7%)             1            72
 WherePredicate            72 ( 0.7%)             1            72
+- BoundPredicate            72 ( 0.7%)             1
 Crate                     72 ( 0.7%)             1            72
 Arm                       96 ( 0.9%)             2            48
 InlineAsm                120 ( 1.2%)             1           120
 FieldDef                 160 ( 1.6%)             2            80
 ForeignItem              160 ( 1.6%)             1           160
+- Fn                       160 ( 1.6%)             1
 Stmt                     160 ( 1.6%)             5            32
+- Local                     32 ( 0.3%)             1
+- Semi                      32 ( 0.3%)             1
+- Expr                      96 ( 0.9%)             3
 Param                    160 ( 1.6%)             4            40
 FnDecl                   200 ( 2.0%)             5            40
 Variant                  240 ( 2.4%)             2           120
 Block                    288 ( 2.8%)             6            48
 GenericBound             352 ( 3.5%)             4            88
+- Trait                    352 ( 3.5%)             4
 GenericParam             520 ( 5.1%)             5           104
 Attribute                608 ( 6.0%)             4           152
+- DocComment               152 ( 1.5%)             1
+- Normal                   456 ( 4.5%)             3
 AssocItem                640 ( 6.3%)             4           160
+- TyAlias                  320 ( 3.2%)             2
+- Fn                       320 ( 3.2%)             2
 PathSegment              792 ( 7.8%)            33            24
 Pat                      840 ( 8.3%)             7           120
+- Struct                   120 ( 1.2%)             1
+- Wild                     120 ( 1.2%)             1
+- Ident                    600 ( 5.9%)             5
 Expr                     936 ( 9.2%)             9           104
+- Path                     104 ( 1.0%)             1
+- Match                    104 ( 1.0%)             1
+- Struct                   104 ( 1.0%)             1
+- InlineAsm                104 ( 1.0%)             1
+- Lit                      208 ( 2.1%)             2
+- Block                    312 ( 3.1%)             3
 Ty                     1_344 (13.2%)            14            96
+- Rptr                      96 ( 0.9%)             1
+- Ptr                       96 ( 0.9%)             1
+- ImplicitSelf             192 ( 1.9%)             2
+- Path                     960 ( 9.5%)            10
 Item                   2_200 (21.7%)            11           200
+- Trait                    200 ( 2.0%)             1
+- Enum                     200 ( 2.0%)             1
+- ExternCrate              200 ( 2.0%)             1
+- ForeignMod               200 ( 2.0%)             1
+- Impl                     200 ( 2.0%)             1
+- Fn                       400 ( 3.9%)             2
+- Use                      800 ( 7.9%)             4
 ----------------------------------------------------------------
 Total                 10_144