43 lines · c
1//===- DXILTranslateMetadata.h - Pass to emit DXIL metadata -----*- C++ -*-===//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#ifndef LLVM_TARGET_DIRECTX_DXILTRANSLATEMETADATA_H10#define LLVM_TARGET_DIRECTX_DXILTRANSLATEMETADATA_H11 12#include "llvm/IR/PassManager.h"13#include "llvm/Pass.h"14 15namespace llvm {16 17/// A pass that transforms LLVM Metadata in the module to it's DXIL equivalent,18/// then emits all recognized DXIL Metadata19class DXILTranslateMetadata : public PassInfoMixin<DXILTranslateMetadata> {20public:21 PreservedAnalyses run(Module &M, ModuleAnalysisManager &);22};23 24/// Wrapper pass for the legacy pass manager.25///26/// This is required because the passes that will depend on this are codegen27/// passes which run through the legacy pass manager.28class DXILTranslateMetadataLegacy : public ModulePass {29public:30 static char ID; // Pass identification, replacement for typeid31 explicit DXILTranslateMetadataLegacy() : ModulePass(ID) {}32 33 StringRef getPassName() const override { return "DXIL Translate Metadata"; }34 35 void getAnalysisUsage(AnalysisUsage &AU) const override;36 37 bool runOnModule(Module &M) override;38};39 40} // namespace llvm41 42#endif // LLVM_TARGET_DIRECTX_DXILTRANSLATEMETADATA_H43