Revert 250089 due to bot failure. It failed when building clang itself with PGO.
[oota-llvm.git] / include / llvm / CodeGen / ParallelCG.h
1 //===-- llvm/CodeGen/ParallelCG.h - Parallel code generation ----*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This header declares functions that can be used for parallel code generation.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_CODEGEN_PARALLELCG_H
15 #define LLVM_CODEGEN_PARALLELCG_H
16
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/Support/CodeGen.h"
19
20 namespace llvm {
21
22 class Module;
23 class TargetOptions;
24 class raw_pwrite_stream;
25
26 /// Split M into OSs.size() partitions, and generate code for each. Writes
27 /// OSs.size() object files to the output streams in OSs. The resulting object
28 /// files if linked together are intended to be equivalent to the single object
29 /// file that would have been code generated from M.
30 ///
31 /// \returns M if OSs.size() == 1, otherwise returns std::unique_ptr<Module>().
32 std::unique_ptr<Module>
33 splitCodeGen(std::unique_ptr<Module> M, ArrayRef<raw_pwrite_stream *> OSs,
34              StringRef CPU, StringRef Features, const TargetOptions &Options,
35              Reloc::Model RM = Reloc::Default,
36              CodeModel::Model CM = CodeModel::Default,
37              CodeGenOpt::Level OL = CodeGenOpt::Default);
38
39 } // namespace llvm
40
41 #endif