aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2015-05-15 14:19:47 +0200
committerJosé Valim <jose.valim@plataformatec.com.br>2015-05-22 00:05:53 +0200
commitb5ee5c6749616dd715138ae7720df77a26341316 (patch)
tree4da51eae605948c4d362b3a4cc1bbfadf69ceb3c /bootstrap
parent9a81b28598fadc44bf506354c9227e41aac786f6 (diff)
downloadotp-b5ee5c6749616dd715138ae7720df77a26341316.tar.gz
otp-b5ee5c6749616dd715138ae7720df77a26341316.tar.bz2
otp-b5ee5c6749616dd715138ae7720df77a26341316.zip
Only annotate forms when linting in the compiler
A lot of time spent on linting is due to eval_file_attribute/2 function that recursively traverses all the AST, annotating the file name on the AST nodes. This traversal happens so it is easier to add errors and warnings later on by simply introspecting the node. This patch changes eval_file_attribute/2 to only annotate forms (i.e. attributes and functions) and rely on the #lint record to keep the proper file information (which it already did before this patch). To summarize, both pre scan and pos scan will use the annotated file attribute in forms, however form/2 already maintains the proper file in #lint, which we pass around when retrieving the location information. After this patch, linting of a regular erlang module with 500LOC became twice faster when measured with eprof.
Diffstat (limited to 'bootstrap')
0 files changed, 0 insertions, 0 deletions