Skip to content

Commit

Permalink
s/comp/cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
marctrem committed Sep 10, 2024
1 parent a90abc6 commit c2222c9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions contrib/codegen/generate_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def eval_bit_and(filt, op1, op2, label_t, label_f):
if label_t and label_f:
filt.append(ReloCondJump("BPF_JMP | BPF_JEQ | BPF_K, 0", label_f, label_t))

def gen_comp(filt, op1, op2, label_t, label_f, cmp_instr):
def gen_cmp(filt, op1, op2, label_t, label_f, cmp_instr):
op1_type, op2_type = type(op1), type(op2)

if op1_type is edn_format.Symbol and op2_type is edn_format.Symbol:
Expand All @@ -279,19 +279,19 @@ def gen_comp(filt, op1, op2, label_t, label_f, cmp_instr):
raise("unsupported")

def eval_equal(filt, op1, op2, label_t, label_f):
gen_comp(filt, op1, op2, label_t, label_f, "BPF_JEQ")
gen_cmp(filt, op1, op2, label_t, label_f, "BPF_JEQ")

def eval_less(filt, op1, op2, label_t, label_f):
gen_comp(filt, op1, op2, label_t, label_f, "BPF_JLT")
gen_cmp(filt, op1, op2, label_t, label_f, "BPF_JLT")

def eval_less_or_equal(filt, op1, op2, label_t, label_f):
gen_comp(filt, op1, op2, label_t, label_f, "BPF_JLE")
gen_cmp(filt, op1, op2, label_t, label_f, "BPF_JLE")

def eval_greater(filt, op1, op2, label_t, label_f):
gen_comp(filt, op1, op2, label_t, label_f, "BPF_JGT")
gen_cmp(filt, op1, op2, label_t, label_f, "BPF_JGT")

def eval_greater_or_equal(filt, op1, op2, label_t, label_f):
gen_comp(filt, op1, op2, label_t, label_f, "BPF_JGE")
gen_cmp(filt, op1, op2, label_t, label_f, "BPF_JGE")

def resplit_lines(lines):
i = 0
Expand Down

0 comments on commit c2222c9

Please sign in to comment.