<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>This patch adds the OpenCL sampler type as a built in type. The sampler type is defined as follows:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 9.2px/normal 'Times New Roman'; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; ">The </span></font><span style="font: normal normal normal 9.2px/normal 'Courier New'; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; ">sampler_t </span></font></span><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; ">type is a 32-bit unsigned int constant and is interpreted as a bit-field that specifies the following properties:</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 9.2px/normal Times; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; ">Addressing Mode, Filter Mode, Normalized Coordinates. </span></font><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; ">These properties control how elements of an image object are read by read_image{f|i|ui}.</span></div></div><div><br></div><div>We made this a built in type because we needed a way to distinguish it from normal integers when checking for special properties of the sampler type (ie. global samplers are not required to be in the constant address space while global integers are).</div><div><br></div><div>A simple test case is included.</div><div><br></div><div>I was not sure what to do about these warnings since I'm not familiar with this code. If you have some suggestions, please let me know:</div><div><div><br></div><div>CIndexUSRs.cpp: In member function ‘void<unnamed>::USRGenerator::VisitType(clang::QualType)’:</div><div>CIndexUSRs.cpp:526: warning: enumeration value ‘Sampler’ not handled in switch</div><div><br></div><div>CIndex.cpp: In member function ‘bool<unnamed>::CursorVisitor::VisitBuiltinTypeLoc(clang::BuiltinTypeLoc)’:</div><div>CIndex.cpp:1356: warning: enumeration value ‘Sampler’ not handled in switch</div></div><div><br></div><div>For your review:</div><div><br></div><div></div></body></html>