bpf: Delayed the removal of the parser enum plugin handler.

Message ID 20231113223542.11562-1-cupertino.miranda@oracle.com
State Unresolved
Headers
Series bpf: Delayed the removal of the parser enum plugin handler. |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Cupertino Miranda Nov. 13, 2023, 10:35 p.m. UTC
  The parser plugin handler that is responsible for collecting enum values
information was being removed way too early.
bpf_resolve_overloaded_core_builtin is called by the parser.
It was moved to the function execute_lower_bpf_core.

gcc/ChangeLog:
	* config/bpf/core-builtins.cc
	(bpf_resolve_overloaded_core_builtin): Removed call.
	(execute_lower_bpf_core): Added all to remove_parser_plugin.
---
 gcc/config/bpf/core-builtins.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

David Faust Nov. 14, 2023, 4:49 p.m. UTC | #1
On 11/13/23 14:35, Cupertino Miranda wrote:
> The parser plugin handler that is responsible for collecting enum values
> information was being removed way too early.
> bpf_resolve_overloaded_core_builtin is called by the parser.
> It was moved to the function execute_lower_bpf_core.
> 

OK, thanks.

> gcc/ChangeLog:
> 	* config/bpf/core-builtins.cc
> 	(bpf_resolve_overloaded_core_builtin): Removed call.
> 	(execute_lower_bpf_core): Added all to remove_parser_plugin.
> ---
>  gcc/config/bpf/core-builtins.cc | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/gcc/config/bpf/core-builtins.cc b/gcc/config/bpf/core-builtins.cc
> index a224847d5d91..2ba78d7aed2e 100644
> --- a/gcc/config/bpf/core-builtins.cc
> +++ b/gcc/config/bpf/core-builtins.cc
> @@ -1473,8 +1473,6 @@ tree
>  bpf_resolve_overloaded_core_builtin (location_t loc, tree fndecl,
>  				     void *arglist)
>  {
> -  remove_parser_plugin ();
> -
>    if (!bpf_require_core_support ())
>      return error_mark_node;
>  
> @@ -1688,6 +1686,7 @@ make_gimple_core_safe_access_index (tree *tp,
>  static unsigned int
>  execute_lower_bpf_core (void)
>  {
> +  remove_parser_plugin ();
>    if (!TARGET_BPF_CORE)
>      return 0;
>
  
Cupertino Miranda Nov. 28, 2023, 12:40 p.m. UTC | #2
Thanks!! Commited !

David Faust writes:

> On 11/13/23 14:35, Cupertino Miranda wrote:
>> The parser plugin handler that is responsible for collecting enum values
>> information was being removed way too early.
>> bpf_resolve_overloaded_core_builtin is called by the parser.
>> It was moved to the function execute_lower_bpf_core.
>>
>
> OK, thanks.
>
>> gcc/ChangeLog:
>> 	* config/bpf/core-builtins.cc
>> 	(bpf_resolve_overloaded_core_builtin): Removed call.
>> 	(execute_lower_bpf_core): Added all to remove_parser_plugin.
>> ---
>>  gcc/config/bpf/core-builtins.cc | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/gcc/config/bpf/core-builtins.cc b/gcc/config/bpf/core-builtins.cc
>> index a224847d5d91..2ba78d7aed2e 100644
>> --- a/gcc/config/bpf/core-builtins.cc
>> +++ b/gcc/config/bpf/core-builtins.cc
>> @@ -1473,8 +1473,6 @@ tree
>>  bpf_resolve_overloaded_core_builtin (location_t loc, tree fndecl,
>>  				     void *arglist)
>>  {
>> -  remove_parser_plugin ();
>> -
>>    if (!bpf_require_core_support ())
>>      return error_mark_node;
>>
>> @@ -1688,6 +1686,7 @@ make_gimple_core_safe_access_index (tree *tp,
>>  static unsigned int
>>  execute_lower_bpf_core (void)
>>  {
>> +  remove_parser_plugin ();
>>    if (!TARGET_BPF_CORE)
>>      return 0;
>>
  

Patch

diff --git a/gcc/config/bpf/core-builtins.cc b/gcc/config/bpf/core-builtins.cc
index a224847d5d91..2ba78d7aed2e 100644
--- a/gcc/config/bpf/core-builtins.cc
+++ b/gcc/config/bpf/core-builtins.cc
@@ -1473,8 +1473,6 @@  tree
 bpf_resolve_overloaded_core_builtin (location_t loc, tree fndecl,
 				     void *arglist)
 {
-  remove_parser_plugin ();
-
   if (!bpf_require_core_support ())
     return error_mark_node;
 
@@ -1688,6 +1686,7 @@  make_gimple_core_safe_access_index (tree *tp,
 static unsigned int
 execute_lower_bpf_core (void)
 {
+  remove_parser_plugin ();
   if (!TARGET_BPF_CORE)
     return 0;