Skip to content

Commit

Permalink
Remove unreachable code. (KhronosGroup#3304)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-perron authored Apr 15, 2020
1 parent ed96301 commit 61b7de3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions source/opt/graphics_robust_access_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,11 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer(
opt::Instruction* image_texel_pointer) {
// TODO(dneto): Write tests for this code.
// TODO(dneto): Use signed-clamp
(void)(image_texel_pointer);
return SPV_SUCCESS;

// Do not compile this code until it is ready to be used.
#if 0
// Example:
// %texel_ptr = OpImageTexelPointer %texel_ptr_type %image_ptr %coord
// %sample
Expand Down Expand Up @@ -1035,6 +1038,7 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer(
def_use_mgr->AnalyzeInstUse(image_texel_pointer);

return SPV_SUCCESS;
#endif
}

opt::Instruction* GraphicsRobustAccessPass::InsertInst(
Expand Down
3 changes: 2 additions & 1 deletion source/opt/ir_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ bool IRContext::ReplaceAllUsesWithPredicate(
bool IRContext::IsConsistent() {
#ifndef SPIRV_CHECK_CONTEXT
return true;
#endif
#else
if (AreAnalysesValid(kAnalysisDefUse)) {
analysis::DefUseManager new_def_use(module());
if (*get_def_use_mgr() != new_def_use) {
Expand Down Expand Up @@ -324,6 +324,7 @@ bool IRContext::IsConsistent() {
}
}
return true;
#endif
}

void IRContext::ForgetUses(Instruction* inst) {
Expand Down

0 comments on commit 61b7de3

Please sign in to comment.