summaryrefslogtreecommitdiff
path: root/source/opt
diff options
context:
space:
mode:
authorSteven Perron <stevenperron@google.com>2018-02-09 20:33:06 -0500
committerSteven Perron <31666470+s-perron@users.noreply.github.com>2018-02-12 09:47:55 -0500
commit06b437dedc86e0ac47ad34e3cd3e2e6ae174617a (patch)
treef1ec1a36123006e0c3ba8782d2fdef0a59e5e422 /source/opt
parent70bf3514e8316e5bb96a6f90492f9cfb475dfe0c (diff)
downloadSPIRV-Tools-06b437dedc86e0ac47ad34e3cd3e2e6ae174617a.tar.gz
SPIRV-Tools-06b437dedc86e0ac47ad34e3cd3e2e6ae174617a.tar.bz2
SPIRV-Tools-06b437dedc86e0ac47ad34e3cd3e2e6ae174617a.zip
Avoid using the def-use manager during inlining.
There seems to only be a single location where the def-use manager is used. It is to get information about a type. We can do that with the type manager instead. Fixes #1285
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);