From 4e16a8bc29ffccff3ae85c0f2728929bd75aa329 Mon Sep 17 00:00:00 2001 From: Hugo Guerrier Date: Thu, 21 Mar 2024 09:37:19 +0100 Subject: [PATCH] Adapt LKQL JIT to the new node wrapping procedure --- .../adacore/lkql_jit/utils/LKQLTypesHelper.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/lkql_jit/language/src/main/java/com/adacore/lkql_jit/utils/LKQLTypesHelper.java b/lkql_jit/language/src/main/java/com/adacore/lkql_jit/utils/LKQLTypesHelper.java index aa79c8034..dc7b312be 100644 --- a/lkql_jit/language/src/main/java/com/adacore/lkql_jit/utils/LKQLTypesHelper.java +++ b/lkql_jit/language/src/main/java/com/adacore/lkql_jit/utils/LKQLTypesHelper.java @@ -277,12 +277,8 @@ else if (javaValue instanceof Libadalang.Aspect aspect) { Object[] values = { aspect.exists, aspect.inherited, - aspect.node.node.isNull() - ? LKQLNull.INSTANCE - : Libadalang.AdaNode.fromEntity(aspect.node), - aspect.value.node.isNull() - ? LKQLNull.INSTANCE - : Libadalang.AdaNode.fromEntity(aspect.value) + aspect.node.isNone() ? LKQLNull.INSTANCE : aspect.node, + aspect.value.isNone() ? LKQLNull.INSTANCE : aspect.value }; return LKQLObject.createUncached(keys, values); } @@ -292,9 +288,7 @@ else if (javaValue instanceof Libadalang.RefResult refResultStruct) { String[] keys = {"kind", "ref"}; Object[] values = { toLKQLValue(refResultStruct.kind), - refResultStruct.ref.node.isNull() - ? LKQLNull.INSTANCE - : Libadalang.AdaNode.fromEntity(refResultStruct.ref) + refResultStruct.ref.isNone() ? LKQLNull.INSTANCE : refResultStruct.ref }; return LKQLObject.createUncached(keys, values); } @@ -302,10 +296,7 @@ else if (javaValue instanceof Libadalang.RefResult refResultStruct) { // If the source is a parameter-actual structure else if (javaValue instanceof Libadalang.ParamActual paramActual) { String[] keys = {"actual", "param"}; - Object[] values = { - Libadalang.AdaNode.fromEntity(paramActual.actual), - Libadalang.AdaNode.fromEntity(paramActual.param) - }; + Object[] values = {paramActual.actual, paramActual.param}; return LKQLObject.createUncached(keys, values); }