I suspect that this is dead code. There is no test coverage for this special case, and the struct type names this checks against don't seem to match what OpenCL actually generates (which would be %opencl.sampler_t rather than %struct._sampler_t for example).
Motivation for this change is that this code is incompatible with opaque pointers -- simply deleting it is the simplest way of making it compatible :)