Fix MCLinker to work with LLVM 3.5.

Change-Id: I2c9124af20ca0cee0a29a687bf04c308ca402486
diff --git a/lib/CodeGen/MCLDTargetMachine.cpp b/lib/CodeGen/MCLDTargetMachine.cpp
index 272e775..9f71390 100644
--- a/lib/CodeGen/MCLDTargetMachine.cpp
+++ b/lib/CodeGen/MCLDTargetMachine.cpp
@@ -17,14 +17,14 @@
 
 #include <llvm/ADT/OwningPtr.h>
 #include <llvm/Analysis/Passes.h>
-#include <llvm/Analysis/Verifier.h>
-#include <llvm/Assembly/PrintModulePass.h>
 #include <llvm/CodeGen/AsmPrinter.h>
 #include <llvm/CodeGen/MachineFunctionAnalysis.h>
 #include <llvm/CodeGen/MachineModuleInfo.h>
 #include <llvm/CodeGen/GCStrategy.h>
 #include <llvm/CodeGen/Passes.h>
 #include <llvm/IR/DataLayout.h>
+#include <llvm/IR/IRPrintingPasses.h>
+#include <llvm/IR/Verifier.h>
 #include <llvm/MC/MCAsmInfo.h>
 #include <llvm/MC/MCStreamer.h>
 #include <llvm/MC/MCInstrInfo.h>
@@ -131,7 +131,7 @@
     PM.add(createDwarfEHPass(TM));
     break;
   case llvm::ExceptionHandling::None:
-    PM.add(createLowerInvokePass(TM));
+    PM.add(createLowerInvokePass());
 
     // The lower invoke pass may create unreachable code. Remove it.
     PM.add(createUnreachableBlockEliminationPass());
@@ -303,7 +303,6 @@
   OwningPtr<MCStreamer> AsmStreamer(
     m_pLLVMTarget->createAsmStreamer(*Context, pOutput,
                                      getVerboseAsm(),
-                                     getTM().hasMCUseLoc(),
                                      getTM().hasMCUseCFI(),
                                      getTM().hasMCUseDwarfDirectory(),
                                      InstPrinter,
@@ -341,7 +340,7 @@
 
   // now, we have MCCodeEmitter and MCAsmBackend, we can create AsmStreamer.
   OwningPtr<MCStreamer> AsmStreamer(m_pLLVMTarget->createMCObjectStreamer(
-    m_Triple, *Context, *MAB, pOutput, MCE, getTM().hasMCRelaxAll(),
+    m_Triple, *Context, *MAB, pOutput, MCE, STI, getTM().hasMCRelaxAll(),
     getTM().hasMCNoExecStack()));
 
   AsmStreamer.get()->InitSections();
diff --git a/lib/Script/Android.mk b/lib/Script/Android.mk
index e24fa35..16df891 100644
--- a/lib/Script/Android.mk
+++ b/lib/Script/Android.mk
@@ -39,6 +39,7 @@
 LOCAL_SRC_FILES := $(mcld_script_SRC_FILES)
 LOCAL_MODULE:= libmcldScript
 LOCAL_C_INCLUDES := $(MCLD_ROOT_PATH)/include/mcld/Script
+LOCAL_CFLAGS := -Wno-deprecated-register
 
 LOCAL_MODULE_TAGS := optional
 
@@ -52,6 +53,7 @@
 LOCAL_SRC_FILES := $(mcld_script_SRC_FILES)
 LOCAL_MODULE:= libmcldScript
 LOCAL_C_INCLUDES := $(MCLD_ROOT_PATH)/include/mcld/Script
+LOCAL_CFLAGS := -Wno-deprecated-register
 
 LOCAL_MODULE_TAGS := optional
 
diff --git a/lib/Support/ToolOutputFile.cpp b/lib/Support/ToolOutputFile.cpp
index a1c94f4..92a3fab 100644
--- a/lib/Support/ToolOutputFile.cpp
+++ b/lib/Support/ToolOutputFile.cpp
@@ -37,7 +37,7 @@
   // FIXME: In Windows, some path in CJK characters can not be removed by LLVM
   // llvm::sys::Path
   if (!Keep && "_" != m_Path.native()) {
-    bool Existed;
+    bool Existed = false;
     llvm::sys::fs::remove(m_Path.native(), Existed);
   }
 
diff --git a/lib/Target/ELFAttribute.cpp b/lib/Target/ELFAttribute.cpp
index 76882d3..ccffab7 100644
--- a/lib/Target/ELFAttribute.cpp
+++ b/lib/Target/ELFAttribute.cpp
@@ -241,7 +241,7 @@
           ELFAttributeValue *out_attr;
           bool is_newly_created;
 
-          llvm::tie(out_attr, is_newly_created) =
+          std::tie(out_attr, is_newly_created) =
               m_AttrData.getOrCreateAttributeValue(tag);
 
           assert(out_attr != NULL);
diff --git a/lib/Target/Mips/MipsRelocator.cpp b/lib/Target/Mips/MipsRelocator.cpp
index 8f1c5e2..7da4dfd 100644
--- a/lib/Target/Mips/MipsRelocator.cpp
+++ b/lib/Target/Mips/MipsRelocator.cpp
@@ -27,7 +27,6 @@
   R_MIPS_LA25_LUI = 200,
   R_MIPS_LA25_J   = 201,
   R_MIPS_LA25_ADD = 202,
-  R_MIPS_PC32     = 248,
 };
 
 } // end namespace ELF