[PATCH] D159162: [llvm] Add assembly syntax highlighting
Sergei Barannikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 30 00:14:09 PDT 2023
barannikov88 added inline comments.
================
Comment at: llvm/include/llvm/MC/MCInstPrinter.h:40-42
+namespace HighlightStyle {
+
+enum Style {
----------------
Could be `enum class` instead of namespace.
================
Comment at: llvm/lib/MC/MCInstPrinter.cpp:199
+ }
+}
+
----------------
Some targets may want to highlight other operand types [that are unique to the target] and / or using different color set. Consider Hexagon: one might want to hightlight braces and other punctuators like '++', for example. Can this method be made AArch64-specific?
================
Comment at: llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp:65
OS << markup("<reg:") << getRegisterName(Reg) << markup(">");
+ highlight(OS, HighlightStyle::None);
}
----------------
It might make sense to use RAII object instead of resetting the style to None every time.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D159162/new/
https://reviews.llvm.org/D159162
More information about the llvm-commits
mailing list