-
Notifications
You must be signed in to change notification settings - Fork 343
Add support for generic expression evaluation in variadic generic con… #6505
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
Add support for generic expression evaluation in variadic generic con… #6505
Conversation
@swift-ci test |
@@ -864,7 +868,9 @@ swift::FuncDecl *SwiftASTManipulator::GetFunctionToInjectVariableInto( | |||
// When not binding generic type parameters, we want to inject the metadata | |||
// pointers in the wrapper, so we can pass them as opaque pointers in the | |||
// trampoline function later on. | |||
if (m_bind_generic_types == lldb::eDontBind && variable.IsMetadataPointer()) | |||
if (m_bind_generic_types == lldb::eDontBind && |
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.
Are we relying in the same --bind-generic-types
mechanism to enable this behavior? It seems to me this would never work in the "bind" mode.
return {}; | ||
return swift::Type(it->second); | ||
} | ||
//swift_ast_ctx->GetBuiltinRawPointerType()); |
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.
Stray commented out line.
@@ -930,16 +950,20 @@ swift::VarDecl *SwiftASTManipulator::GetVarDeclForVariableInFunction( | |||
const swift::Identifier name = variable.GetName(); | |||
// We may need to mutate the self variable later, so hardcode it to a var | |||
// in that case. | |||
const auto introducer = variable.IsSelf() ? swift::VarDecl::Introducer::Var | |||
: variable.GetVarIntroducer(); | |||
const auto introducer = (variable.IsSelf() || variable.IsUnboundPack()) |
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.
I'm curious, why does the unbound pack need to be mutated?
subs) { | ||
auto tss = type.GetTypeSystem().dyn_cast_or_null<TypeSystemSwift>(); | ||
if (!tss) | ||
return "<unexpected typesystem>"; |
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.
Maybe this function should return an llvm::Expected
?
@@ -64,58 +130,126 @@ struct CallsAndArgs { | |||
/// - And a matching call to the sink function: | |||
/// | |||
/// lldb_sink($__lldb_arg, $__lldb_injected_self, $τ_0_0, $τ_0_1, ..., $τ_0_n) | |||
static CallsAndArgs MakeGenericSignaturesAndCalls( | |||
llvm::ArrayRef<SwiftASTManipulator::VariableInfo> local_variables) { | |||
static llvm::Expected<CallsAndArgs> MakeGenericSignaturesAndCalls( |
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.
Update the doxygen comment explaining the new functionality and the new parameters?
@@ -64,58 +130,126 @@ struct CallsAndArgs { | |||
/// - And a matching call to the sink function: | |||
/// | |||
/// lldb_sink($__lldb_arg, $__lldb_injected_self, $τ_0_0, $τ_0_1, ..., $τ_0_n) | |||
static CallsAndArgs MakeGenericSignaturesAndCalls( | |||
llvm::ArrayRef<SwiftASTManipulator::VariableInfo> local_variables) { | |||
static llvm::Expected<CallsAndArgs> MakeGenericSignaturesAndCalls( |
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.
This functions seems to be doing quite a lot now, and a lot of the new behavior depends on whether generic_sig
exists and if needs_object_ptr
is true/false, I wonder if it'd be possible to split it up in maybe 2,3 functions
…texts.