40 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8///9/// DXILFinalizeLinkage pass updates the linkage of functions to make sure only10/// shader entry points and exported functions are visible from the module (have11/// program linkage). All other functions will be updated to have internal12/// linkage.13///14//===----------------------------------------------------------------------===//15 16#ifndef LLVM_TARGET_DIRECTX_DXILFINALIZELINKAGE_H17#define LLVM_TARGET_DIRECTX_DXILFINALIZELINKAGE_H18 19#include "llvm/IR/PassManager.h"20#include "llvm/Pass.h"21 22namespace llvm {23 24class DXILFinalizeLinkage : public PassInfoMixin<DXILFinalizeLinkage> {25public:26 PreservedAnalyses run(Module &M, ModuleAnalysisManager &);27 static bool isRequired() { return true; }28};29 30class DXILFinalizeLinkageLegacy : public ModulePass {31public:32 DXILFinalizeLinkageLegacy() : ModulePass(ID) {}33 bool runOnModule(Module &M) override;34 35 static char ID; // Pass identification.36};37} // namespace llvm38 39#endif // LLVM_TARGET_DIRECTX_DXILFINALIZELINKAGE_H40