Apply changes to sync with llvm upstream.
diff --git a/lib/ExecutionEngine/ContextManager.cpp b/lib/ExecutionEngine/ContextManager.cpp
index e007fe9..4d13275 100644
--- a/lib/ExecutionEngine/ContextManager.cpp
+++ b/lib/ExecutionEngine/ContextManager.cpp
@@ -18,7 +18,7 @@
 
 #include "DebugHelper.h"
 
-#include <llvm/System/Mutex.h>
+#include <llvm/Support/Mutex.h>
 #include <llvm/Support/MutexGuard.h>
 
 #include <errno.h>
diff --git a/lib/ExecutionEngine/ContextManager.h b/lib/ExecutionEngine/ContextManager.h
index 98cddfe..f23c4a1 100644
--- a/lib/ExecutionEngine/ContextManager.h
+++ b/lib/ExecutionEngine/ContextManager.h
@@ -19,7 +19,7 @@
 
 #include <Config.h>
 
-#include <llvm/System/Mutex.h>
+#include <llvm/Support/Mutex.h>
 
 #include <unistd.h>
 #include <stddef.h>
diff --git a/lib/ExecutionEngine/SourceInfo.cpp b/lib/ExecutionEngine/SourceInfo.cpp
index e4704c7..c8126a8 100644
--- a/lib/ExecutionEngine/SourceInfo.cpp
+++ b/lib/ExecutionEngine/SourceInfo.cpp
@@ -31,6 +31,7 @@
 #include <llvm/ADT/OwningPtr.h>
 #include <llvm/ADT/StringRef.h>
 #include <llvm/Support/MemoryBuffer.h>
+#include <llvm/Support/system_error.h>
 
 #include <stddef.h>
 #include <string.h>
@@ -146,10 +147,9 @@
 
   case SourceKind::File:
     {
-      llvm::OwningPtr<llvm::MemoryBuffer> MEM(
-        llvm::MemoryBuffer::getFile(file.path));
+      llvm::OwningPtr<llvm::MemoryBuffer> MEM;
 
-      if (!MEM.get()) {
+      if (llvm::error_code ec = llvm::MemoryBuffer::getFile(file.path, MEM)) {
         LOGE("Unable to MemoryBuffer::getFile(path=%s)\n", file.path);
         return 1;
       }