Surelog
Surelog copied to clipboard
n2 function in ParseFile.cpp
The following function is n^2, it computes the line number in the original file from the expanded post-processor version of the file:
https://github.com/chipsalliance/Surelog/blob/57c7b7478003477e504b15b2fca14a9c9cbc5927/src/SourceCompile/ParseFile.cpp#L169
It is only called once per file, then the result is cached for further use by the parser cache generator. But if the file is generated by lots of macro expansions by the preprocessor, then runtime starts to show. There is one such a large file (> 350,000 lines post preprocessor) that exhibit this problem: https://github.com/chipsalliance/Surelog/blob/master/third_party/tests/wav-lpddr-hw/verif/sv/wddr_pkg.sv