Move to kernel style SPDX license identifiers
[lttng-ust.git] / liblttng-ust / lttng-bytecode-specialize.c
index 55b2ebf221687be36d8c4f306b8e85b8a2cbd70c..7a7c1e864f57507a8b90745c92a87c622f98be3a 100644 (file)
@@ -1,27 +1,9 @@
 /*
- * lttng-bytecode-specialize.c
- *
- * LTTng UST bytecode specializer.
+ * SPDX-License-Identifier: MIT
  *
  * Copyright (C) 2010-2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * LTTng UST bytecode specializer.
  */
 
 #define _LGPL_SOURCE
@@ -155,6 +137,10 @@ static int specialize_load_field(struct vstack_entry *stack_top,
                if (!stack_top->load.rev_bo)
                        insn->op = BYTECODE_OP_LOAD_FIELD_S64;
                break;
+       case OBJECT_TYPE_SIGNED_ENUM:
+               dbg_printf("op load field signed enumeration\n");
+               stack_top->type = REG_PTR;
+               break;
        case OBJECT_TYPE_U8:
                dbg_printf("op load field u8\n");
                stack_top->type = REG_U64;
@@ -178,6 +164,10 @@ static int specialize_load_field(struct vstack_entry *stack_top,
                if (!stack_top->load.rev_bo)
                        insn->op = BYTECODE_OP_LOAD_FIELD_U64;
                break;
+       case OBJECT_TYPE_UNSIGNED_ENUM:
+               dbg_printf("op load field unsigned enumeration\n");
+               stack_top->type = REG_PTR;
+               break;
        case OBJECT_TYPE_DOUBLE:
                stack_top->type = REG_DOUBLE;
                insn->op = BYTECODE_OP_LOAD_FIELD_DOUBLE;
@@ -416,9 +406,9 @@ static int specialize_load_object(const struct lttng_event_field *field,
                        itype = &field->type.u.enum_nestable.container_type->u.integer;
                }
                if (itype->signedness)
-                       load->object_type = OBJECT_TYPE_S64;
+                       load->object_type = OBJECT_TYPE_SIGNED_ENUM;
                else
-                       load->object_type = OBJECT_TYPE_U64;
+                       load->object_type = OBJECT_TYPE_UNSIGNED_ENUM;
                load->rev_bo = false;
                break;
        }
This page took 0.024143 seconds and 4 git commands to generate.