Added support for freeing variables in the ASR symbolic pass#2268
Merged
certik merged 3 commits intolcompilers:mainfrom Aug 13, 2023
Merged
Added support for freeing variables in the ASR symbolic pass#2268certik merged 3 commits intolcompilers:mainfrom
certik merged 3 commits intolcompilers:mainfrom
Conversation
Collaborator
Author
|
I have a doubt . I'm seeing some cases work, for example Through the pass I can see this block But when I have I get the following error cc @Thirumalai-Shaktivel , I did some debugging but not exactly sure where I might be going wrong . |
Collaborator
|
Here is the issue for the ASR verify failure: ASRsymbol_set:
(Function
(SymbolTable
8
{
s:
(Variable
8
s
[]
In
()
()
Default
(Character 1 -2 ())
()
BindC
Public
Required
.true.
),
x:
(Variable
8
x
[]
In
()
()
Default
(CPtr)
()
BindC
Public
Required
.true.
)
})
symbol_set
(FunctionType
[(CPtr)
(Character 1 -2 ())]
()
BindC
Interface
"symbol_set"
.false.
.false.
.false.
.false.
.false.
[]
.false.
)
[]
[(Var 8 x)
(Var 8 s)]
[(SubroutineCall <---------------------
2 basic_free_stack
2 basic_free_stack
[((Var 3 x))]
()
)]
()
Public
.false.
.false.
"symengine/cwrapper.h"
) |
Thirumalai-Shaktivel
approved these changes
Aug 12, 2023
Collaborator
Thirumalai-Shaktivel
left a comment
There was a problem hiding this comment.
I left one suggestion, otherwise this LGTM!
Collaborator
Author
|
I've addressed the suggested change , should be ready now. |
certik
approved these changes
Aug 13, 2023
Contributor
|
Thanks! I think it looks good. I rebased it to make sure it still works and I set it to merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The framework here is simple
basic_new_stackwould be required to allocate memory , that's enough information to confirm that the corresponding variable would also have to be freed at the end of the program. Hence I've declaredbasic_free_stackaccordingly.symbolic_varswhich has all CPtr symbols that have been added to the function's symbol table.main0()