[all-commits] [llvm/llvm-project] 319313: [OpenCL] Do not include default header for preproc...

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Fri Jun 25 07:29:21 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3193133add7eeeaa3872c78aa959bacdc08e59d9
      https://github.com/llvm/llvm-project/commit/3193133add7eeeaa3872c78aa959bacdc08e59d9
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2021-06-25 (Fri, 25 Jun 2021)

  Changed paths:
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/test/Driver/amdgpu-toolchain-opencl.cl

  Log Message:
  -----------
  [OpenCL] Do not include default header for preprocessor output as input

When clang driver is used with -save-temps to compile OpenCL program,
clang driver first launches clang -cc1 -E to generate preprocessor expansion output,
then launches clang -cc1 with the generated preprocessor expansion output as input
to generate LLVM IR.

Currently clang by default passes "-finclude-default-header" "-fdeclare-opencl-builtins"
in both steps, which causes default header included again in the second step, which
causes error.

This patch let clang not to include default header when input type is preprocessor expansion
output, which fixes the issue.

Reviewed by: Anastasia Stulova

Differential Revision: https://reviews.llvm.org/D104800


  Commit: 4921ecfc8194c11ec7c659ad1de11da6e8307361
      https://github.com/llvm/llvm-project/commit/4921ecfc8194c11ec7c659ad1de11da6e8307361
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2021-06-25 (Fri, 25 Jun 2021)

  Changed paths:
    M clang/include/clang/Sema/Sema.h

  Log Message:
  -----------
  [clang] Fix build failure due to _S

_S is a reserved identifier in <ctype.h> on Solaris.


Compare: https://github.com/llvm/llvm-project/compare/91053e327ccd...4921ecfc8194


More information about the All-commits mailing list