BlockExtractor.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- BlockExtractor.h - Extracts blocks into their own functions --------===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This pass extracts the specified basic blocks from the module into their
  15. // own functions.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_TRANSFORMS_IPO_BLOCKEXTRACTOR_H
  19. #define LLVM_TRANSFORMS_IPO_BLOCKEXTRACTOR_H
  20. #include <vector>
  21. #include "llvm/ADT/SmallVector.h"
  22. #include "llvm/IR/PassManager.h"
  23. namespace llvm {
  24. class BasicBlock;
  25. struct BlockExtractorPass : PassInfoMixin<BlockExtractorPass> {
  26. BlockExtractorPass(std::vector<std::vector<BasicBlock *>> &&GroupsOfBlocks,
  27. bool EraseFunctions);
  28. PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
  29. private:
  30. std::vector<std::vector<BasicBlock *>> GroupsOfBlocks;
  31. bool EraseFunctions;
  32. };
  33. } // namespace llvm
  34. #endif // LLVM_TRANSFORMS_IPO_BLOCKEXTRACTOR_H
  35. #ifdef __GNUC__
  36. #pragma GCC diagnostic pop
  37. #endif