Modify CodeEmitter due to upstream API changes.

Upstream changed the API of mpTarget->createMCInstPritner.
Apply changes of csmon to migrate to llvm upstream r129128. More CLs coming next.

Change-Id: I1d8f840f6564431374fde7be9e09cd0ddac88e8e
diff --git a/lib/CodeGen/CodeEmitter.cpp b/lib/CodeGen/CodeEmitter.cpp
index 7acedb5..0029909 100644
--- a/lib/CodeGen/CodeEmitter.cpp
+++ b/lib/CodeGen/CodeEmitter.cpp
@@ -1195,7 +1195,8 @@
   if (mpDisassmbler == NULL)
     mpDisassmbler = mpTarget->createMCDisassembler();
   if (mpIP == NULL)
-    mpIP = mpTarget->createMCInstPrinter(mpAsmInfo->getAssemblerDialect(),
+    mpIP = mpTarget->createMCInstPrinter(*mpTargetMachine,
+                                         mpAsmInfo->getAssemblerDialect(),
                                          *mpAsmInfo);
 
   const BufferMemoryObject *BufferMObj = new BufferMemoryObject(Start,
@@ -1235,6 +1236,8 @@
 
 
 void CodeEmitter::setTargetMachine(llvm::TargetMachine &TM) {
+  mpTargetMachine = &TM;
+
   // Set Target
   mpTarget = &TM.getTarget();
   // Set TargetJITInfo
diff --git a/lib/CodeGen/CodeEmitter.h b/lib/CodeGen/CodeEmitter.h
index 8d34159..c4e0d78 100644
--- a/lib/CodeGen/CodeEmitter.h
+++ b/lib/CodeGen/CodeEmitter.h
@@ -82,6 +82,8 @@
 
     CodeMemoryManager *mpMemMgr;
 
+    llvm::TargetMachine *mpTargetMachine;
+
     // The JITInfo for the target we are compiling to
     const llvm::Target *mpTarget;