MIR Serialization: Connect the machine function analysis pass to the MIR parser.
authorAlex Lorenz <arphaman@gmail.com>
Mon, 15 Jun 2015 20:30:22 +0000 (20:30 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Mon, 15 Jun 2015 20:30:22 +0000 (20:30 +0000)
commita15d888abf962a3b10d74a2a3a2cc73d83018da6
tree8cbf79d8d28a9b7be3fdf93921515d6b15c7a712
parente99f30c57bca5e24ab3fd38b0a6bf164a36e6201
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239753 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
include/llvm/CodeGen/MIRParser/MIRParser.h
include/llvm/CodeGen/MachineFunctionAnalysis.h
include/llvm/CodeGen/MachineFunctionInitializer.h [new file with mode: 0644]
include/llvm/IR/DiagnosticInfo.h
include/llvm/IR/DiagnosticPrinter.h
include/llvm/Support/SourceMgr.h
include/llvm/Target/TargetMachine.h
lib/CodeGen/LLVMTargetMachine.cpp
lib/CodeGen/MIRParser/MIRParser.cpp
lib/CodeGen/MachineFunction.cpp
lib/CodeGen/MachineFunctionAnalysis.cpp
lib/IR/DiagnosticInfo.cpp
lib/IR/DiagnosticPrinter.cpp
lib/IR/LLVMContext.cpp
lib/Support/SourceMgr.cpp
lib/Target/CppBackend/CPPBackend.cpp
lib/Target/CppBackend/CPPTargetMachine.h
test/CodeGen/MIR/function-missing-machine-function.mir [new file with mode: 0644]
test/CodeGen/MIR/llvm-ir-error-reported.mir
test/CodeGen/MIR/llvmIR.mir
test/CodeGen/MIR/machine-function-missing-name.mir
tools/llc/llc.cpp