• Question about RiscVAsmPrinter When I check the RiscVAsmPrinter.cpp, i found the RiscVAsmPrinter is in an anouymous namespace and it does not have .h file. • This setup is different from the one for ARM. • And this setup literally disable an new class derive from the current RiscVAsmPrinter class. • Does anyone know why this setup was chosen? • Probably because it was only used within the one .cpp file and therefore did not need to be exposed in a header file? • ARM have it separate because of ARMMCInstLower.cpp.
Article Summaries:
- When I check the RiscVAsmPrinter.cpp, i found the RiscVAsmPrinter is in an anouymous namespace and it does not have .h file. This setup is different from the one for ARM. And this setup literally disable an new class derive from the current RiscVAsmPrinter class. Does anyone know why this setup was chosen? jrtc27 2 Probably because it was only used within the one .cpp file and therefore did not need to be exposed in a header file? topperc 3 ARM have it separate because of ARMMCInstLower.cpp. This separation didn’t make much sense and seemed to just be copied from other targets when a new targe
Sources:
- https://discourse.llvm.org/t/question-about-riscvasmprinter/89943 (Latest source article published: 2026-02-23 22:17 UTC)