forked from OSchip/llvm-project
[MIR] Speedup parsing of function with large number of basic blocks
Patch eliminates string length calculation when lexing a token. Speedup can be up to 1000x. Differential revision: https://reviews.llvm.org/D83389
This commit is contained in:
parent
470bf7b5a2
commit
a074984250
|
@ -563,7 +563,7 @@ MIParser::MIParser(PerFunctionMIParsingState &PFS, SMDiagnostic &Error,
|
|||
|
||||
void MIParser::lex(unsigned SkipChar) {
|
||||
CurrentSource = lexMIToken(
|
||||
CurrentSource.data() + SkipChar, Token,
|
||||
CurrentSource.slice(SkipChar, StringRef::npos), Token,
|
||||
[this](StringRef::iterator Loc, const Twine &Msg) { error(Loc, Msg); });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue