This patch makes the changes requested by thakis in the patch https://reviews.llvm.org/D60763 :
• thakis.
From what I can tell, the only client of OpenCLBuiltins.td is currently lib/Sema. Do you expect that to change? If not, does it make more sense to move the .td file to there?
Do you expect OpenCLBuiltins.td to include other files in the future? At the moment, the -I ${CMAKE_CURRENT_SOURCE_DIR}/../../ bit in the cmake file isn't needed for anything.
This makes clangSema dependent on the tablegen invocation, but actually SemaLookup.cpp which includes the generated .inc file should be made dependent on ClangOpenCLBuiltinsImpl to ensure tablegen runs before compiling SemaLookup.cpp.