diff options
author | Matthew Dempsky <mdempsky@chromium.org> | 2014-09-05 18:14:57 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@chromium.org> | 2014-09-06 01:17:57 +0000 |
commit | 279b9aad9824c840e10382c2f6e4356d4c632774 (patch) | |
tree | 3d2c6213f62f165b86a2e2a46a636f5123249fd3 /athena/content | |
parent | 9d972ceb0c410b92dccc5cbf3f8118b0ac6ec3c6 (diff) | |
download | chromium_src-279b9aad9824c840e10382c2f6e4356d4c632774.zip chromium_src-279b9aad9824c840e10382c2f6e4356d4c632774.tar.gz chromium_src-279b9aad9824c840e10382c2f6e4356d4c632774.tar.bz2 |
bpf_dsl: support Switch/Case expressions
This adds support for expressions like
Switch(arg)
.Case(1, result1)
.CASES((2, 3), result2)
.Default(result3)
Currently these expressions are compiled simply as short-hand for
If(arg == 1, result1)
.ElseIf(arg == 2 || arg == 3, result2)
.Else(result3)
but in the future we should be able to optimize it better.
The CASES macro ugliness is unfortunately necessary until we're
allowed to use C++11. Later we'll be able to change it to
real C++ code like "Cases({2, 3}, result2)" (which clang-format
will then format a bit more nicely too).
BUG=408845
R=jln@chromium.org, jorgelo@chromium.org
Review URL: https://codereview.chromium.org/438683004
Cr-Commit-Position: refs/heads/master@{#293599}
Diffstat (limited to 'athena/content')
0 files changed, 0 insertions, 0 deletions