-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[flang][DRAFT] Copy-in/Copy-out determination #151408
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
base: main
Are you sure you want to change the base?
Conversation
Plumbing/API for copy-in/copy-out
} | ||
// TODO: at this point have dummy arguments as procInfo->dummyArguments | ||
// and have actual arguments via arguments_ | ||
} |
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.
Here go through the actual args and dummy args and determine copy-in and copy-out needs.
You can test this locally with the following command:git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- flang/include/flang/Evaluate/call.h flang/lib/Evaluate/call.cpp View the diff from clang-format here.diff --git a/flang/lib/Evaluate/call.cpp b/flang/lib/Evaluate/call.cpp
index c558335c1..5a94071d9 100644
--- a/flang/lib/Evaluate/call.cpp
+++ b/flang/lib/Evaluate/call.cpp
@@ -254,8 +254,8 @@ void ProcedureRef::DetermineCopyInOut() {
}
// Get folding context of the call site owner
FoldingContext &fc{proc_.GetSymbol()->owner().context().foldingContext()};
- auto procInfo{characteristics::Procedure::Characterize(
- proc_, fc, /*emitError=*/true)};
+ auto procInfo{
+ characteristics::Procedure::Characterize(proc_, fc, /*emitError=*/true)};
if (!procInfo) {
return;
}
|
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 might be cleaner to do the analysis at the time that the ProcedureRef
is created by expression semantics rather than patching the IR later in lowering. It could then be used in Semantics/check-call.cpp for all of the errors and warnings that depend on copy-in/copy-out instead of the ad-hoc analysis currently done that relies on contiguity &c.
Plumbing/API for copy-in/copy-out work