ParallelCG.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- llvm/CodeGen/ParallelCG.h - Parallel code generation ----*- C++ -*-===//
  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 header declares functions that can be used for parallel code generation.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_CODEGEN_PARALLELCG_H
  18. #define LLVM_CODEGEN_PARALLELCG_H
  19. #include "llvm/Support/CodeGen.h"
  20. #include <functional>
  21. #include <memory>
  22. namespace llvm {
  23. template <typename T> class ArrayRef;
  24. class Module;
  25. class TargetMachine;
  26. class raw_pwrite_stream;
  27. /// Split M into OSs.size() partitions, and generate code for each. Takes a
  28. /// factory function for the TargetMachine TMFactory. Writes OSs.size() output
  29. /// files to the output streams in OSs. The resulting output files if linked
  30. /// together are intended to be equivalent to the single output file that would
  31. /// have been code generated from M.
  32. ///
  33. /// Writes bitcode for individual partitions into output streams in BCOSs, if
  34. /// BCOSs is not empty.
  35. void splitCodeGen(
  36. Module &M, ArrayRef<raw_pwrite_stream *> OSs,
  37. ArrayRef<llvm::raw_pwrite_stream *> BCOSs,
  38. const std::function<std::unique_ptr<TargetMachine>()> &TMFactory,
  39. CodeGenFileType FileType = CGFT_ObjectFile, bool PreserveLocals = false);
  40. } // namespace llvm
  41. #endif
  42. #ifdef __GNUC__
  43. #pragma GCC diagnostic pop
  44. #endif