Commit c476a4a
authored
[Clang][OpenCL] Fix Missing
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.-fdeclare-opencl-builtins When Using --save-temps (#131017)1 parent c8047c6 commit c476a4a
File tree
2 files changed
+15
-1
lines changed- clang
- lib/Driver
- test/Driver
2 files changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
230 | 240 | | |
231 | 241 | | |
232 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments