|
33 | 33 | //===----------------------------------------------------------------------===//
|
34 | 34 | //
|
35 | 35 | // SPIR-V specification doesn't allow function pointers, so SPIR-V translator
|
36 |
| -// is designed to fail if a value with function type (except calls) is occured. |
| 36 | +// is designed to fail if a value with function type (except calls) occurs. |
37 | 37 | // Currently there is only two cases, when function pointers are generating in
|
38 | 38 | // LLVM IR in OpenCL - block calls and device side enqueue built-in calls.
|
39 | 39 | //
|
|
44 | 44 | // structure:
|
45 | 45 | // %struct.__opencl_block_literal_generic = type { i32, i32, i8 addrspace(4)* }
|
46 | 46 | // Pointers to block invoke functions are stored in the third field. Clang
|
47 |
| -// replaces inderect function calls in all cases except if block is passed as a |
| 47 | +// replaces indirect function calls in all cases except if block is passed as a |
48 | 48 | // function argument. Note that it is somewhat unclear if the OpenCL C spec
|
49 |
| -// should allow passing blocks as function argumernts. This pass is not supposed |
| 49 | +// should allow passing blocks as function arguments. This pass is not supposed |
50 | 50 | // to work correctly with such functions.
|
51 | 51 | // Clang though has to store function pointers to this structure. Purpose of
|
52 | 52 | // this pass is to replace store of function pointers(not allowed in SPIR-V)
|
@@ -124,10 +124,9 @@ char SPIRVLowerOCLBlocksLegacy::ID = 0;
|
124 | 124 |
|
125 | 125 | } // namespace
|
126 | 126 |
|
127 |
| -INITIALIZE_PASS( |
128 |
| - SPIRVLowerOCLBlocksLegacy, "spv-lower-ocl-blocks", |
129 |
| - "Remove function pointers occured in case of using OpenCL blocks", false, |
130 |
| - false) |
| 127 | +INITIALIZE_PASS(SPIRVLowerOCLBlocksLegacy, "spv-lower-ocl-blocks", |
| 128 | + "Remove function pointers originating from OpenCL blocks", |
| 129 | + false, false) |
131 | 130 |
|
132 | 131 | llvm::ModulePass *llvm::createSPIRVLowerOCLBlocksLegacy() {
|
133 | 132 | return new SPIRVLowerOCLBlocksLegacy();
|
|
0 commit comments