diff options
author | Alex Lorenz <arphaman@gmail.com> | 2015-06-15 20:30:22 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2015-06-15 20:30:22 +0000 |
commit | 735c47ec3e9a5d64343e764b72c4e35f171b06bb (patch) | |
tree | 9f5819d9580cf59726a54c04159ad1b1a35319bd /llvm/lib/Target/CppBackend | |
parent | 49e9010ca339099d23c56e768d0b0fcf40929719 (diff) | |
download | bcm5719-llvm-735c47ec3e9a5d64343e764b72c4e35f171b06bb.tar.gz bcm5719-llvm-735c47ec3e9a5d64343e764b72c4e35f171b06bb.zip |
MIR Serialization: Connect the machine function analysis pass to the MIR parser.
This commit connects the machine function analysis pass (which creates machine
functions) to the MIR parser, which will initialize the machine functions
with the state from the MIR file and reconstruct the machine IR.
This commit introduces a new interface called 'MachineFunctionInitializer',
which can be used to provide custom initialization for the machine functions.
This commit also introduces a new diagnostic class called
'DiagnosticInfoMIRParser' which is used for MIR parsing errors.
This commit modifies the default diagnostic handling in LLVMContext - now the
the diagnostics are printed directly into llvm::errs() so that the MIR parsing
errors can be printed with colours.
Reviewers: Justin Bogner
Differential Revision: http://reviews.llvm.org/D9928
llvm-svn: 239753
Diffstat (limited to 'llvm/lib/Target/CppBackend')
-rw-r--r-- | llvm/lib/Target/CppBackend/CPPBackend.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Target/CppBackend/CPPTargetMachine.h | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/CppBackend/CPPBackend.cpp b/llvm/lib/Target/CppBackend/CPPBackend.cpp index b8377986ecc..36c421e2b14 100644 --- a/llvm/lib/Target/CppBackend/CPPBackend.cpp +++ b/llvm/lib/Target/CppBackend/CPPBackend.cpp @@ -2148,7 +2148,8 @@ char CppWriter::ID = 0; bool CPPTargetMachine::addPassesToEmitFile( PassManagerBase &PM, raw_pwrite_stream &o, CodeGenFileType FileType, - bool DisableVerify, AnalysisID StartAfter, AnalysisID StopAfter) { + bool DisableVerify, AnalysisID StartAfter, AnalysisID StopAfter, + MachineFunctionInitializer *MFInitializer) { if (FileType != TargetMachine::CGFT_AssemblyFile) return true; auto FOut = llvm::make_unique<formatted_raw_ostream>(o); diff --git a/llvm/lib/Target/CppBackend/CPPTargetMachine.h b/llvm/lib/Target/CppBackend/CPPTargetMachine.h index f7d0e18a0c4..ebf0635b12e 100644 --- a/llvm/lib/Target/CppBackend/CPPTargetMachine.h +++ b/llvm/lib/Target/CppBackend/CPPTargetMachine.h @@ -31,8 +31,8 @@ struct CPPTargetMachine : public TargetMachine { public: bool addPassesToEmitFile(PassManagerBase &PM, raw_pwrite_stream &Out, CodeGenFileType FileType, bool DisableVerify, - AnalysisID StartAfter, - AnalysisID StopAfter) override; + AnalysisID StartAfter, AnalysisID StopAfter, + MachineFunctionInitializer *MFInitializer) override; }; extern Target TheCppBackendTarget; |