Working on AMDGPU project I need to support assembler identifiers started with '&'. Looking into AsmLexer.cpp I found similar need to optionally support '@' inside identifiers and decided this is time to add generic support for identifier charset. I added configurable bitvector set for prefix and body identifier's characters.
Details
Diff Detail
- Build Status
Buildable 1408 Build 1408: arc lint + arc unit
Event Timeline
include/llvm/MC/MCParser/MCAsmLexer.h | ||
---|---|---|
238 | Well not making it virtual would require bitvector sets to be part of this class. I'm not objecting though as it already done with SkipSpace and AllowAtInIdentifier. | |
243 | What would be a better name here? | |
lib/MC/MCParser/AsmLexer.cpp | ||
33 | Well it based on my previuos experience on Windows where we had lexer using these routines eating up to 10% of scan time. Probably not so "generally" as I stated though. I'm not insisting on this particular change and can remove it. |
After a loooong time I would like to reanimate this review requiest.
Previously I incorrectly measured performance impact for this patch and obtained 30% performance gain - this result was incorrect. Current measurement on a large .s file shows no affect on parsing performance.
include/llvm/MC/MCParser/MCAsmLexer.h | ||
---|---|---|
238 | With the generalization, these can go away entirely, yes? Replace the callsites w/ the new API. | |
246 | This should start with "is" not "Is" according the the coding guidelines. | |
251 | Ditto. | |
258 | This feels really weird. Wouldn't any callsites want to be using one of the other two? They'll know their context. I don't see any invocations of this method in the patch. Why is it needed at all? | |
lib/MC/MCParser/AsmLexer.cpp | ||
576 | Can you elaborate on this bit? Not sure I follow why this is so much more logic than previously. | |
lib/MC/MCParser/MCAsmLexer.cpp | ||
37 | Given the bimodal behaviour based on Value, this should probably just be two functions. |
Why do you need to make these virtual?