[all-commits] [llvm/llvm-project] c476a4: [Clang][OpenCL] Fix Missing `-fdeclare-opencl-buil...

Shilei Tian via All-commits all-commits at lists.llvm.org
Wed Mar 12 14:00:40 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c476a4a907a51371f051fd83987aaeb2c4a011af
      https://github.com/llvm/llvm-project/commit/c476a4a907a51371f051fd83987aaeb2c4a011af
  Author: Shilei Tian <i at tianshilei.me>
  Date:   2025-03-12 (Wed, 12 Mar 2025)

  Changed paths:
    M clang/lib/Driver/Types.cpp
    A clang/test/Driver/opencl-aot-compilation.cl

  Log Message:
  -----------
  [Clang][OpenCL] Fix Missing `-fdeclare-opencl-builtins` When Using `--save-temps` (#131017)

When compiling an OpenCL program directly with `clang` using
`--save-temps`, an
error may occur if the program contains OpenCL builtins:

```
test.cl:3:21: error: use of undeclared identifier 'get_global_id'
    3 |   unsigned int id = get_global_id(0);
      |                     ^
```

This happens because the driver does not add `-fdeclare-opencl-builtins`
when
the input type is `TY_PP_CL`. This PR fixes the issue.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list