mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-24 22:16:05 +00:00

2b11c7de4ae182496438e166cb6758d41b6e1740 introduced `llvm/include/llvm/MC/MCAsmLexer.h` and made `AsmLexer` inherit from `MCAsmLexer`, likely to allow target-specific parsers to depend solely on `MCAsmLexer`. However, this separation now seems unnecessary and confusing. `MCAsmLexer` defines virtual functions with `AsmLexer` as its only implementation, and `AsmLexer` itself has few extra public methods. To simplify the codebase, this change merges MCAsmLexer.{h,cpp} into AsmLexer.{h,cpp}. MCAsmLexer.h is temporarily kept as a forwarder. Note: I doubt that a downstream lexer handling an assembly syntax significantly different from the standard GNU Assembler syntax would want to inherit from `MCAsmLexer`. Instead, it's more likely they'd extend `AsmLexer` by adding new states and modifying its internal logic, as seen with variables for MASM, M68k, and HLASM.