mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Fix t_dist_cppstyle Perl performance issue (#4085).
This commit is contained in:
parent
10fbe74cef
commit
891cc0f9b6
3
Changes
3
Changes
@ -24,8 +24,9 @@ Verilator 5.015 devel
|
||||
* Support 'let'.
|
||||
* Optimize Verilator executable size by refactoring error reporting routines (#4446). [Anthony Donlon]
|
||||
* Optimize Verilation runtime pointers and graphs (#4396) (#4397) (#4398). [Krzysztof Bieganski, Antmicro Ltd]
|
||||
* Optimize preparations towards multithreading Verilation (#4463) (#4476) (#4477) (#4479). [Kamil Rakoczy, Antmicro Ltd]
|
||||
* Optimize preparations towards multithreaded Verilation (#4291) (#4463) (#4476) (#4477) (#4479). [Kamil Rakoczy, Antmicro Ltd]
|
||||
* Fix Windows filename format, etc (#3873) (#4421). [Anthony Donlon].
|
||||
* Fix t_dist_cppstyle Perl performance issue (#4085). [Srinivasan Venkataramanan]
|
||||
* Fix using type in parameterized classes without #() (#4281) (#4440). [Anthony Donlon]
|
||||
* Fix false INFINITELOOP on forever..mailbox.get() (#4323). [Srinivasan Venkataramanan]
|
||||
* Fix data type of condition operation on class objects (#4345) (#4352). [Ryszard Rozak, Antmicro Ltd]
|
||||
|
@ -63,18 +63,19 @@ sub checkPattern {
|
||||
my $pattern = shift;
|
||||
my $message = shift;
|
||||
|
||||
my $offset = 0;
|
||||
my $buffer = $contents;
|
||||
while ($buffer =~ s/.*?^($pattern)//sm) {
|
||||
my $lineno = offset_to_lineno($contents, $offset + $-[-1]);
|
||||
$offset += $+[1];
|
||||
error("$filename:$lineno: $message");
|
||||
my $lineno = 0;
|
||||
my $buffer;
|
||||
foreach my $line (split(/\n/, $contents . "\n\n")) {
|
||||
++$lineno;
|
||||
if ($line ne "") {
|
||||
# Don't do whole file at once - see issue #4085
|
||||
# Build a buffer until a newline so we check a block at a time.
|
||||
$buffer .= $line . "\n";
|
||||
next;
|
||||
}
|
||||
if ($buffer =~ s/.*?^($pattern)//sm) {
|
||||
error("$filename:$lineno: $message");
|
||||
}
|
||||
$buffer = "";
|
||||
}
|
||||
}
|
||||
|
||||
sub offset_to_lineno {
|
||||
my $contents = shift;
|
||||
my $offset = shift;
|
||||
my $count = (substr $contents, 0, $offset) =~ tr/\n//;
|
||||
return $count + 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user