[P4-dev] extern function return in backend

hemant at mnkcg.com hemant at mnkcg.com
Fri Oct 20 12:08:59 EDT 2017


No.  Let me do that - thanks.  I was looking at the class for declarations
etc.  

 

Hemant

 

From: Mihai Budiu [mailto:mbudiu at vmware.com] 
Sent: Friday, October 20, 2017 12:05 PM
To: hemant at mnkcg.com; 'p4-dev' <p4-dev at lists.p4.org>
Subject: RE: [P4-dev] extern function return in backend

 

Did you try the combination of flags -v --topP4 pass?

It will dump the program representation including the IR as comments.

 

Mihai

 

From: P4-dev [mailto:p4-dev-bounces at lists.p4.org] On Behalf Of
hemant at mnkcg.com <mailto:hemant at mnkcg.com> 
Sent: Friday, October 20, 2017 8:58 AM
To: 'p4-dev' <p4-dev at lists.p4.org <mailto:p4-dev at lists.p4.org> >
Subject: [P4-dev] extern function return in backend

 

The extern below has a function returning bool.  The args of the function
are not relevant to my question and thus are replaced with ellipses.

 

extern myExtern {

       myExtern();

       bool compare(.);

};

 

I know args to an extern function are obtained by backend software as
follows, such as getting the first arg:

 

method->expr->arguments->at(0);

 

How does one get the bool returned from the function in backend to see if
the frontend P4 program used "!extvar.compare()" or "extvar.compare()"?

 

Hemant

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20171020/768f3137/attachment-0002.html>


More information about the P4-dev mailing list