forked from microsoft/llvm-mctoll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EmitRaisedOutputPass.h
48 lines (41 loc) · 1.73 KB
/
EmitRaisedOutputPass.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//===----------- EmitRaisedOutputPass.h -------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the declaration of EmitRaisedOutputPass for use by
// llvm-mctoll. This class is provided to inhibit printing of target line
// and keep the resulting output architecture-neutral.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TOOLS_LLVM_MCTOLL_EMITRAISEDOUTPUTPASS_H
#define LLVM_TOOLS_LLVM_MCTOLL_EMITRAISEDOUTPUTPASS_H
#include "llvm/Bitcode/BitcodeWriterPass.h"
#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
class EmitRaisedOutputPass : public ModulePass {
TargetMachine::CodeGenFileType OutFileType;
PrintModulePass PrintAsmPass;
BitcodeWriterPass PrintBitCodePass;
public:
static char ID;
EmitRaisedOutputPass()
: ModulePass(ID), OutFileType(TargetMachine::CGFT_Null),
PrintBitCodePass(dbgs()) {}
EmitRaisedOutputPass(raw_ostream &OS, TargetMachine::CodeGenFileType CGFT,
const std::string &Banner = "",
bool ShouldPreserveUseListOrder = false)
: ModulePass(ID), OutFileType(CGFT),
PrintAsmPass(OS, Banner, ShouldPreserveUseListOrder),
PrintBitCodePass(OS, ShouldPreserveUseListOrder) {}
bool runOnModule(Module &M) override;
void getAnalysisUsage(AnalysisUsage &AU) const override;
};
#endif // LLVM_TOOLS_LLVM_MCTOLL_EMITRAISEDOUTPUTPASS_H