mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:54:47 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user