X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Ffilter%2Ffilter-grammar-test.c;h=70656e1a84f42f87b1b0a35bb1579f2b15e908c9;hb=606757e482b9fb6282c5a63fb888942424f9d5c5;hp=b5e6616f5e871bdf01fe706cb3375f3418bdec18;hpb=bff988fac4f8d1ffab3f85f0eec9546c76e57706;p=lttng-tools.git diff --git a/src/lib/lttng-ctl/filter/filter-grammar-test.c b/src/lib/lttng-ctl/filter/filter-grammar-test.c index b5e6616f5..70656e1a8 100644 --- a/src/lib/lttng-ctl/filter/filter-grammar-test.c +++ b/src/lib/lttng-ctl/filter/filter-grammar-test.c @@ -3,20 +3,10 @@ * * LTTng filter grammar test * - * Copyright 2012 - Mathieu Desnoyers + * Copyright 2012 Mathieu Desnoyers * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License, version 2.1 only, - * as published by the Free Software Foundation. + * SPDX-License-Identifier: LGPL-2.1-only * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -51,6 +41,22 @@ int main(int argc, char **argv) print_bytecode = 1; } + /* + * Force generate the bytecode if the user asks to print the bytecode + * (can't print it without generating it first). + */ + if (print_bytecode) { + generate_bytecode = 1; + } + + /* + * Force generate the IR if the user asks to generate the bytecode + * (the bytecode is generated by visiting the IR). + */ + if (generate_bytecode) { + generate_ir = 1; + } + ctx = filter_parser_ctx_alloc(stdin); if (!ctx) { fprintf(stderr, "Error allocating parser\n");