]> granicus.if.org Git - clang/commit
[OpenCL] Declare builtin functions using TableGen
authorSven van Haastregt <sven.vanhaastregt@arm.com>
Mon, 3 Jun 2019 09:39:11 +0000 (09:39 +0000)
committerSven van Haastregt <sven.vanhaastregt@arm.com>
Mon, 3 Jun 2019 09:39:11 +0000 (09:39 +0000)
commit6767591efeeb1b46faa558f0707bb4efc4315cb9
tree38eff24f4f786cd4ec99e37eeb3bd28d178817c5
parent1d201d005b01f73da728675feb1926fe6ac0e5dd
[OpenCL] Declare builtin functions using TableGen

This patch adds a `-fdeclare-opencl-builtins` command line option to
the clang frontend.  This enables clang to verify OpenCL C builtin
function declarations using a fast StringMatcher lookup, instead of
including the opencl-c.h file with the `-finclude-default-header`
option.  This avoids the large parse time penalty of the header file.

This commit only adds the basic infrastructure and some of the OpenCL
builtins.  It does not cover all builtins defined by the various OpenCL
specifications.  As such, it is not a replacement for
`-finclude-default-header` yet.

RFC: http://lists.llvm.org/pipermail/cfe-dev/2018-November/060041.html

Co-authored-by: Pierre Gondois
Co-authored-by: Joey Gouly
Co-authored-by: Sven van Haastregt
Differential Revision: https://reviews.llvm.org/D60763

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362371 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/CMakeLists.txt
include/clang/Basic/LangOptions.def
include/clang/Basic/OpenCLBuiltins.td [new file with mode: 0644]
include/clang/Driver/CC1Options.td
lib/Frontend/CompilerInvocation.cpp
lib/Sema/SemaLookup.cpp
test/SemaOpenCL/fdeclare-opencl-builtins.cl [new file with mode: 0644]
utils/TableGen/CMakeLists.txt
utils/TableGen/ClangOpenCLBuiltinEmitter.cpp [new file with mode: 0644]
utils/TableGen/TableGen.cpp
utils/TableGen/TableGenBackends.h