Add CallAction to allow deferring calls (#7682)

Calls with template callee or args can now be deferred via an
InstAction. This allows code like this to check:

```carbon
import Cpp inline '''
template<typename T>
struct C {};
''';

fn F(generic T: type) {
  let unused c: Cpp.C(T) = Cpp.C(T).C();
}
```
This commit is contained in:
Nicholas Bishop
2026-08-28 18:00:58 +00:00
committed by GitHub
parent 0ea8fb2e74
commit f519cccaf2
16 changed files with 742 additions and 537 deletions
+8 -1
View File
@@ -71,7 +71,8 @@ template <typename IdT>
requires SemIR::Internal::IsIdKindType<IdT> &&
SameAsOneOf<IdT, SemIR::IdAndKind::NoneType, SemIR::AbsoluteInstId,
SemIR::CallParamIndex, SemIR::NameId,
SemIR::ElementIndex, SemIR::ClangDeclId>
SemIR::ElementIndex, SemIR::ClangDeclId,
SemIR::BoolValue>
static auto OperandDependence(Context& /*context*/, IdT /*id*/)
-> SemIR::ConstantDependence {
return SemIR::ConstantDependence::None;
@@ -98,6 +99,12 @@ static auto OperandDependence(Context& context,
return result;
}
static auto OperandDependence(Context& context,
SemIR::MetaInstBlockId inst_block_id)
-> SemIR::ConstantDependence {
return OperandDependence(context, SemIR::InstBlockId{inst_block_id});
}
static auto OperandDependence(Context& context, SemIR::SpecificId specific_id)
-> SemIR::ConstantDependence {
auto specific = context.specifics().Get(specific_id);