-
Notifications
You must be signed in to change notification settings - Fork 12
Handle intrinsic import #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When a subprogram is imported with the convention Intrinsic, the subprogram is built into the compiler and does not signify a multi-language program.
|
||
I : Integer := 1; | ||
begin | ||
I := -I; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It calls the intrinsic function "-"
@@ -4814,8 +4814,40 @@ package body Tree_Walk is | |||
-- be called from Ada, or a foreign-language variable to be | |||
-- accessed from Ada. This would (probably) require gnat2goto to | |||
-- understand the foreign code, which we do not at the moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW this bit isn't actually true anymore; Since we now support linking of symtab files we can actually do a multi language analysis just fine, we just have to make sure the name of the functions match.
gnat2goto/driver/tree_walk.adb
Outdated
-- can safely ignore the pragma. | ||
declare | ||
-- If the pragma is specified with positional parameter | ||
-- association, then the calling convetion is the first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small typo here "convention"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected
On Fri, 2019-05-31 at 09:11 -0700, hannes-steffenhagen-diffblue wrote:
@@ -4814,8 +4814,40 @@ package body Tree_Walk is
-- be called from Ada, or a foreign-language variable
to be
-- accessed from Ada. This would (probably) require
gnat2goto to
-- understand the foreign code, which we do not at the
moment.
FWIW this bit isn't actually true anymore; Since we now support
linking of symtab files we _can_ actually do a multi language
analysis just fine, we just have to make sure the name of the
functions match.
Hannes is right; it would not necessarily require gnat2goto
understanding the other language. However I also wouldn't say we can
yet do multi-language analysis as this will also require some work on
calling conventions and how variables and types are mapped between the
two.
We have a *route* to supporting multi-language analysis via separate
compilation and linking but we have not yet developed it.
|
I have rebased this to diffblue/master |
Supreceeded by #251 |
A pragma Import with the convention Intrinsic does not signify a multi language program. Intrinsic convention is used to indicate a subprogram built in to the Ada compiler. It can be safely ignored by gnat2goto but it will not necessarily have a body in the translated code.