aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorPekka Enberg <penberg@kernel.org>2011-11-22 19:54:16 +0200
committerPekka Enberg <penberg@kernel.org>2011-11-22 22:06:29 +0200
commit58f7c712b643db22fe46ecfb9fa39a93a57ddfa9 (patch)
treec8c6503e260b801aaebb0822705425749c0c4381 /validation
parentb08efe9f3e4513b3418dce040340e9fffa42bc15 (diff)
downloadsparse-dev-58f7c712b643db22fe46ecfb9fa39a93a57ddfa9.tar.gz
sparse, llvm: Simplify comparison op code generation
Linus writes: On Tue, Nov 22, 2011 at 9:40 AM, Pekka Enberg <penberg@kernel.org> wrote: > This patch implements LLVM code generation for OP_SET_LE, OP_SET_GE, OP_SET_BE, > and OP_SET_AE. Ugh. Can't you just do it with a single statement like target = LLVMBuildICmp(fn->builder, translate_op(op), lhs, rhs, target_name); instead of having that case-statement where every case does the same thing? The translate_op() thing should be trivial too, just something like static int translate_op(int sparse_op) { static const int trans_tbl[] = { .[OP_SET_LE] = LLVMIntSLE, ... }; return trans_tbl[sparse_op]; } or whatever. No? Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Christopher Li <sparse@chrisli.org> Cc: Jeff Garzik <jgarzik@redhat.com> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'validation')
0 files changed, 0 insertions, 0 deletions