diff mbox

[6/8] tcg: Add INDEX_op_invalid

Message ID 20170817230114.3655-7-richard.henderson@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Richard Henderson Aug. 17, 2017, 11:01 p.m. UTC
Add with value 0 so that structure zero initialization can
indicate that the field is not present.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/tcg-opc.h | 2 ++
 tcg/tcg.c     | 3 +++
 2 files changed, 5 insertions(+)

Comments

Philippe Mathieu-Daudé Aug. 17, 2017, 11:45 p.m. UTC | #1
On 08/17/2017 08:01 PM, Richard Henderson wrote:
> Add with value 0 so that structure zero initialization can
> indicate that the field is not present.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>   tcg/tcg-opc.h | 2 ++
>   tcg/tcg.c     | 3 +++
>   2 files changed, 5 insertions(+)
> 
> diff --git a/tcg/tcg-opc.h b/tcg/tcg-opc.h
> index 9162125fac..b1445a4c24 100644
> --- a/tcg/tcg-opc.h
> +++ b/tcg/tcg-opc.h
> @@ -26,6 +26,8 @@
>    * DEF(name, oargs, iargs, cargs, flags)
>    */
>   
> +DEF(invalid, 0, 0, 0, TCG_OPF_NOT_PRESENT)
> +
>   /* predefined ops */
>   DEF(discard, 1, 0, 0, TCG_OPF_NOT_PRESENT)
>   DEF(set_label, 0, 0, 1, TCG_OPF_BB_END | TCG_OPF_NOT_PRESENT)
> diff --git a/tcg/tcg.c b/tcg/tcg.c
> index 3c3cdda938..879b29e81f 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -756,6 +756,9 @@ int tcg_check_temp_count(void)
>   bool tcg_op_supported(TCGOpcode op)
>   {
>       switch (op) {
> +    case INDEX_op_invalid:
> +        return false;
> +
>       case INDEX_op_discard:
>       case INDEX_op_set_label:
>       case INDEX_op_call:
>
Alex Bennée Sept. 8, 2017, 9:30 a.m. UTC | #2
Richard Henderson <richard.henderson@linaro.org> writes:

> Add with value 0 so that structure zero initialization can
> indicate that the field is not present.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  tcg/tcg-opc.h | 2 ++
>  tcg/tcg.c     | 3 +++
>  2 files changed, 5 insertions(+)
>
> diff --git a/tcg/tcg-opc.h b/tcg/tcg-opc.h
> index 9162125fac..b1445a4c24 100644
> --- a/tcg/tcg-opc.h
> +++ b/tcg/tcg-opc.h
> @@ -26,6 +26,8 @@
>   * DEF(name, oargs, iargs, cargs, flags)
>   */
>
> +DEF(invalid, 0, 0, 0, TCG_OPF_NOT_PRESENT)
> +
>  /* predefined ops */
>  DEF(discard, 1, 0, 0, TCG_OPF_NOT_PRESENT)
>  DEF(set_label, 0, 0, 1, TCG_OPF_BB_END | TCG_OPF_NOT_PRESENT)
> diff --git a/tcg/tcg.c b/tcg/tcg.c
> index 3c3cdda938..879b29e81f 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -756,6 +756,9 @@ int tcg_check_temp_count(void)
>  bool tcg_op_supported(TCGOpcode op)
>  {
>      switch (op) {
> +    case INDEX_op_invalid:
> +        return false;
> +
>      case INDEX_op_discard:
>      case INDEX_op_set_label:
>      case INDEX_op_call:


--
Alex Bennée
diff mbox

Patch

diff --git a/tcg/tcg-opc.h b/tcg/tcg-opc.h
index 9162125fac..b1445a4c24 100644
--- a/tcg/tcg-opc.h
+++ b/tcg/tcg-opc.h
@@ -26,6 +26,8 @@ 
  * DEF(name, oargs, iargs, cargs, flags)
  */
 
+DEF(invalid, 0, 0, 0, TCG_OPF_NOT_PRESENT)
+
 /* predefined ops */
 DEF(discard, 1, 0, 0, TCG_OPF_NOT_PRESENT)
 DEF(set_label, 0, 0, 1, TCG_OPF_BB_END | TCG_OPF_NOT_PRESENT)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 3c3cdda938..879b29e81f 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -756,6 +756,9 @@  int tcg_check_temp_count(void)
 bool tcg_op_supported(TCGOpcode op)
 {
     switch (op) {
+    case INDEX_op_invalid:
+        return false;
+
     case INDEX_op_discard:
     case INDEX_op_set_label:
     case INDEX_op_call: