Skip to content

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

Closed
wants to merge 4 commits into from

Conversation

tjj2017
Copy link
Collaborator

@tjj2017 tjj2017 commented May 30, 2019

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.

tjj2017 added 2 commits May 30, 2019 11:25
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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Collaborator Author

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.

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.

-- can safely ignore the pragma.
declare
-- If the pragma is specified with positional parameter
-- association, then the calling convetion is the first
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small typo here "convention"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected

@martin-cs
Copy link
Collaborator

martin-cs commented Jun 4, 2019 via email

@tjj2017
Copy link
Collaborator Author

tjj2017 commented Jun 4, 2019

I have rebased this to diffblue/master

@tjj2017 tjj2017 mentioned this pull request Jun 4, 2019
@chrisr-diffblue
Copy link
Contributor

Supreceeded by #251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants