Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:48:20

0001 //===------ DumpModulePass.h ------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // Write a module to a file.
0010 //
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef POLLY_SUPPORT_DUMPMODULEPASS_H
0014 #define POLLY_SUPPORT_DUMPMODULEPASS_H
0015 
0016 #include "llvm/IR/PassManager.h"
0017 #include <string>
0018 
0019 namespace llvm {
0020 class ModulePass;
0021 } // namespace llvm
0022 
0023 namespace polly {
0024 /// Create a pass that prints the module into a file.
0025 ///
0026 /// The meaning of @p Filename depends on @p IsSuffix. If IsSuffix==false, then
0027 /// the module is written to the @p Filename. If it is true, the filename is
0028 /// generated from the module's name, @p Filename with an '.ll' extension.
0029 ///
0030 /// The intent of IsSuffix is to avoid the file being overwritten when
0031 /// processing multiple modules and/or with multiple dump passes in the
0032 /// pipeline.
0033 llvm::ModulePass *createDumpModuleWrapperPass(std::string Filename,
0034                                               bool IsSuffix);
0035 
0036 /// A pass that prints the module into a file.
0037 struct DumpModulePass final : llvm::PassInfoMixin<DumpModulePass> {
0038   std::string Filename;
0039   bool IsSuffix;
0040 
0041   DumpModulePass(std::string Filename, bool IsSuffix)
0042       : Filename(std::move(Filename)), IsSuffix(IsSuffix) {}
0043 
0044   llvm::PreservedAnalyses run(llvm::Module &M, llvm::ModuleAnalysisManager &AM);
0045 };
0046 
0047 } // namespace polly
0048 
0049 namespace llvm {
0050 class PassRegistry;
0051 void initializeDumpModuleWrapperPassPass(llvm::PassRegistry &);
0052 } // namespace llvm
0053 
0054 #endif /* POLLY_SUPPORT_DUMPMODULEPASS_H */