mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 11:11:05 +01:00
Add TemplateInst and drop CallCppTemplateAction (#7689)
`TemplateInst` wraps another inst. If that inst is symbolic, it is treated as a template by `OperandDependence`. Use this to replace `CallCppTemplateAction` with the more general `CallAction`.
This commit is contained in:
@@ -346,22 +346,10 @@ auto PerformCallToCppTemplateName(Context& context, SemIR::LocId loc_id,
|
||||
SemIR::ClangDeclId template_decl_id,
|
||||
llvm::ArrayRef<SemIR::InstId> arg_ids)
|
||||
-> SemIR::InstId {
|
||||
auto args_id = context.inst_blocks().Add(arg_ids);
|
||||
return HandleAction<SemIR::CallCppTemplateAction>(
|
||||
context, loc_id, SemIR::TypeInstId::None,
|
||||
{.type_id = SemIR::InstType::TypeId,
|
||||
.template_decl_id = template_decl_id,
|
||||
.args_id = args_id});
|
||||
}
|
||||
|
||||
auto PerformAction(Context& context, SemIR::LocId loc_id,
|
||||
SemIR::CallCppTemplateAction action) -> SemIR::InstId {
|
||||
auto* template_decl = dyn_cast<clang::TemplateDecl>(
|
||||
context.clang_decls().Get(action.template_decl_id).decl());
|
||||
context.clang_decls().Get(template_decl_id).decl());
|
||||
auto loc = GetCppLocation(context, loc_id);
|
||||
|
||||
auto arg_ids = context.inst_blocks().Get(action.args_id);
|
||||
|
||||
// Form a template argument list for this template.
|
||||
clang::TemplateArgumentListInfo arg_list(loc, loc);
|
||||
if (!ConvertArgsToTemplateArgs(context, template_decl, arg_ids, arg_list)) {
|
||||
|
||||
Reference in New Issue
Block a user