[OpenCL] Add builtin declarations by default.
authorAnastasia Stulova <anastasia.stulova@arm.com>
Mon, 22 Feb 2021 11:05:52 +0000 (11:05 +0000)
committerAnastasia Stulova <anastasia.stulova@arm.com>
Mon, 22 Feb 2021 12:24:16 +0000 (12:24 +0000)
commitcf3ef15a6ec5e5b45c6c54e8fbe3769255e815ce
tree509e6fda5f800f06077dfbf905a2e9de694ed043
parent19084887d9222dab71c86ed848b09f9ca8e61fff
[OpenCL] Add builtin declarations by default.

This change enables the builtin function declarations
in clang driver by default using the Tablegen solution
along with the implicit include of 'opencl-c-base.h'
header.

A new flag '-cl-no-stdinc' disabling all default
declarations and header includes is added. If any other
mechanisms were used to include the declarations (e.g.
with -Xclang -finclude-default-header) and the new default
approach is not sufficient the, `-cl-no-stdinc` flag has
to be used with clang to activate the old behavior.

Tags: #clang

Differential Revision: https://reviews.llvm.org/D96515
clang/include/clang/Driver/Options.td
clang/include/clang/Driver/Types.h
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/Types.cpp
clang/test/Driver/default-includes.cl [new file with mode: 0644]
clang/unittests/AST/MatchVerifier.h