Skip to content

Commit 8eced3b

Browse files
committed
Refine clang-format style
AttributeMacros: A vector of strings that should be interpreted as attributes/qualifiers instead of identifiers. StatementAttributeLikeMacros: Macros which are ignored in front of a statement, as if they were an attribute. StatementMacros: Typical macros are expressions, and require a semi-colon to be added; sometimes this is not the case, and this allows to make clang-format aware of such cases.
1 parent 821155f commit 8eced3b

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.clang-format

+10
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,13 @@ ForEachMacros:
1717
- list_for_each_entry
1818
- list_for_each_entry_safe
1919
- hlist_for_each_entry
20+
AttributeMacros:
21+
- UNUSED
22+
- __ALIGNED
23+
- PACKED
24+
- MUST_TAIL
25+
- FORCE_INLINE
26+
StatementAttributeLikeMacros:
27+
- IIF
28+
StatementMacros:
29+
- __UNREACHABLE

src/emulate.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,8 @@ FORCE_INLINE bool insn_is_branch(uint8_t opcode)
548548
{
549549
switch (opcode) {
550550
#define _(inst, can_branch, insn_len, translatable, reg_mask) \
551-
IIF(can_branch)(case rv_insn_##inst:, )
551+
IIF(can_branch) \
552+
(case rv_insn_##inst:, )
552553
RV_INSN_LIST
553554
#undef _
554555
return true;
@@ -561,7 +562,8 @@ FORCE_INLINE bool insn_is_translatable(uint8_t opcode)
561562
{
562563
switch (opcode) {
563564
#define _(inst, can_branch, insn_len, translatable, reg_mask) \
564-
IIF(translatable)(case rv_insn_##inst:, )
565+
IIF(translatable) \
566+
(case rv_insn_##inst:, )
565567
RV_INSN_LIST
566568
#undef _
567569
return true;

0 commit comments

Comments
 (0)