summaryrefslogtreecommitdiff
path: root/source/opt
diff options
context:
space:
mode:
Diffstat (limited to 'source/opt')
-rw-r--r--source/opt/inline_pass.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/opt/inline_pass.cpp b/source/opt/inline_pass.cpp
index 6226a966..b713852b 100644
--- a/source/opt/inline_pass.cpp
+++ b/source/opt/inline_pass.cpp
@@ -150,9 +150,8 @@ uint32_t InlinePass::CreateReturnVar(
std::vector<std::unique_ptr<ir::Instruction>>* new_vars) {
uint32_t returnVarId = 0;
const uint32_t calleeTypeId = calleeFn->type_id();
- const ir::Instruction* calleeType =
- get_def_use_mgr()->id_to_defs().find(calleeTypeId)->second;
- if (calleeType->opcode() != SpvOpTypeVoid) {
+ analysis::Type* calleeType = context()->get_type_mgr()->GetType(calleeTypeId);
+ if (calleeType->AsVoid() == nullptr) {
// Find or create ptr to callee return type.
uint32_t returnVarTypeId = context()->get_type_mgr()->FindPointerToType(
calleeTypeId, SpvStorageClassFunction);