| 1 | //===- DXILFinalizeLinkage.h - Finalize linkage of functions --------------===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | /// |
| 9 | /// DXILFinalizeLinkage pass updates the linkage of functions to make sure only |
| 10 | /// shader entry points and exported functions are visible from the module (have |
| 11 | /// program linkage). All other functions will be updated to have internal |
| 12 | /// linkage. |
| 13 | /// |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #ifndef LLVM_TARGET_DIRECTX_DXILFINALIZELINKAGE_H |
| 17 | #define LLVM_TARGET_DIRECTX_DXILFINALIZELINKAGE_H |
| 18 | |
| 19 | #include "llvm/IR/PassManager.h" |
| 20 | #include "llvm/Pass.h" |
| 21 | |
| 22 | namespace llvm { |
| 23 | |
| 24 | class DXILFinalizeLinkage : public RequiredPassInfoMixin<DXILFinalizeLinkage> { |
| 25 | public: |
| 26 | PreservedAnalyses run(Module &M, ModuleAnalysisManager &); |
| 27 | }; |
| 28 | |
| 29 | class DXILFinalizeLinkageLegacy : public ModulePass { |
| 30 | public: |
| 31 | DXILFinalizeLinkageLegacy() : ModulePass(ID) {} |
| 32 | bool runOnModule(Module &M) override; |
| 33 | |
| 34 | static char ID; // Pass identification. |
| 35 | }; |
| 36 | } // namespace llvm |
| 37 | |
| 38 | #endif // LLVM_TARGET_DIRECTX_DXILFINALIZELINKAGE_H |
| 39 | |