about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLuqman Aden <laden@csclub.uwaterloo.ca>2014-09-30 17:20:22 -0400
committerLuqman Aden <laden@csclub.uwaterloo.ca>2014-10-04 13:28:57 -0400
commit4b22178d325704d81522c15570498b7467b3152d (patch)
tree277fbb7ca36b075541c3df33928e8f48147f05d2
parent20f4c45bade89f0a8df5297811af3d9f8b91d075 (diff)
downloadrust-4b22178d325704d81522c15570498b7467b3152d.tar.gz
rust-4b22178d325704d81522c15570498b7467b3152d.zip
Update LLVM.
-rw-r--r--mk/main.mk2
-rw-r--r--src/librustc/middle/trans/debuginfo.rs6
-rw-r--r--src/librustc_llvm/lib.rs5
m---------src/llvm0
-rw-r--r--src/rustllvm/PassWrapper.cpp18
-rw-r--r--src/rustllvm/RustWrapper.cpp45
-rw-r--r--src/rustllvm/llvm-auto-clean-trigger2
-rw-r--r--src/rustllvm/rustllvm.h2
8 files changed, 60 insertions, 20 deletions
diff --git a/mk/main.mk b/mk/main.mk
index a4bac74aace..a12198b771b 100644
--- a/mk/main.mk
+++ b/mk/main.mk
@@ -246,7 +246,7 @@ endif
 ######################################################################
 
 # FIXME: x86-ism
-LLVM_COMPONENTS=x86 arm mips ipo bitreader bitwriter linker asmparser jit mcjit \
+LLVM_COMPONENTS=x86 arm mips ipo bitreader bitwriter linker asmparser mcjit \
                 interpreter instrumentation
 
 # Only build these LLVM tools
diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs
index 55e34ad48cd..b24b9e0a4e7 100644
--- a/src/librustc/middle/trans/debuginfo.rs
+++ b/src/librustc/middle/trans/debuginfo.rs
@@ -3164,8 +3164,7 @@ fn populate_scope_map(cx: &CrateContext,
                 parent_scope,
                 file_metadata,
                 loc.line as c_uint,
-                loc.col.to_uint() as c_uint,
-                0)
+                loc.col.to_uint() as c_uint)
         };
 
         scope_stack.push(ScopeStackEntry { scope_metadata: scope_metadata,
@@ -3290,8 +3289,7 @@ fn populate_scope_map(cx: &CrateContext,
                                 parent_scope,
                                 file_metadata,
                                 loc.line as c_uint,
-                                loc.col.to_uint() as c_uint,
-                                0)
+                                loc.col.to_uint() as c_uint)
                         };
 
                         scope_stack.push(ScopeStackEntry {
diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs
index 401933d7058..ad2b6891dc9 100644
--- a/src/librustc_llvm/lib.rs
+++ b/src/librustc_llvm/lib.rs
@@ -1747,8 +1747,7 @@ extern {
                                            Scope: DIDescriptor,
                                            File: DIFile,
                                            Line: c_uint,
-                                           Col: c_uint,
-                                           Discriminator: c_uint)
+                                           Col: c_uint)
                                            -> DILexicalBlock;
 
     pub fn LLVMDIBuilderCreateStaticVariable(Builder: DIBuilderRef,
@@ -2179,12 +2178,10 @@ pub unsafe fn static_link_hack_this_sucks() {
 
     LLVMRustLinkInExternalBitcode(0 as *mut _, 0 as *const _, 0 as size_t);
 
-    LLVMLinkInJIT();
     LLVMLinkInMCJIT();
     LLVMLinkInInterpreter();
 
     extern {
-        fn LLVMLinkInJIT();
         fn LLVMLinkInMCJIT();
         fn LLVMLinkInInterpreter();
     }
diff --git a/src/llvm b/src/llvm
-Subproject e9d037419441d51ccb0f41aacbc64080b0c6e81
+Subproject c9b823739d1357a058e7437c00bec6d2d0b00ed
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index 195b044ccdc..eb074001d58 100644
--- a/src/rustllvm/PassWrapper.cpp
+++ b/src/rustllvm/PassWrapper.cpp
@@ -118,7 +118,9 @@ LLVMRustAddAnalysisPasses(LLVMTargetMachineRef TM,
                           LLVMPassManagerRef PMR,
                           LLVMModuleRef M) {
     PassManagerBase *PM = unwrap(PMR);
-#if LLVM_VERSION_MINOR >= 5
+#if LLVM_VERSION_MINOR >= 6
+    PM->add(new DataLayoutPass());
+#elif LLVM_VERSION_MINOR == 5
     PM->add(new DataLayoutPass(unwrap(M)));
 #else
     PM->add(new DataLayout(unwrap(M)));
@@ -187,7 +189,12 @@ LLVMRustWriteOutputFile(LLVMTargetMachineRef Target,
   PassManager *PM = unwrap<PassManager>(PMR);
 
   std::string ErrorInfo;
-#if LLVM_VERSION_MINOR >= 4
+#if LLVM_VERSION_MINOR >= 6
+  std::error_code EC;
+  raw_fd_ostream OS(path, EC, sys::fs::F_None);
+  if (EC)
+    ErrorInfo = EC.message();
+#elif LLVM_VERSION_MINOR >= 4
   raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_None);
 #else
   raw_fd_ostream OS(path, ErrorInfo, raw_fd_ostream::F_Binary);
@@ -210,7 +217,12 @@ LLVMRustPrintModule(LLVMPassManagerRef PMR,
   PassManager *PM = unwrap<PassManager>(PMR);
   std::string ErrorInfo;
 
-#if LLVM_VERSION_MINOR >= 4
+#if LLVM_VERSION_MINOR >= 6
+  std::error_code EC;
+  raw_fd_ostream OS(path, EC, sys::fs::F_None);
+  if (EC)
+    ErrorInfo = EC.message();
+#elif LLVM_VERSION_MINOR >= 4
   raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_None);
 #else
   raw_fd_ostream OS(path, ErrorInfo, raw_fd_ostream::F_Binary);
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 1fdaa548ebe..9fda05431db 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -393,13 +393,12 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateLexicalBlock(
     LLVMValueRef Scope,
     LLVMValueRef File,
     unsigned Line,
-    unsigned Col,
-    unsigned Discriminator) {
+    unsigned Col) {
     return wrap(Builder->createLexicalBlock(
         unwrapDI<DIDescriptor>(Scope),
         unwrapDI<DIFile>(File), Line, Col
-#if LLVM_VERSION_MINOR >= 5
-        , Discriminator
+#if LLVM_VERSION_MINOR == 5
+        , 0
 #endif
         ));
 }
@@ -415,7 +414,11 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateStaticVariable(
     bool isLocalToUnit,
     LLVMValueRef Val,
     LLVMValueRef Decl = NULL) {
+#if LLVM_VERSION_MINOR == 6
+    return wrap(Builder->createGlobalVariable(unwrapDI<DIDescriptor>(Context),
+#else
     return wrap(Builder->createStaticVariable(unwrapDI<DIDescriptor>(Context),
+#endif
         Name,
         LinkageName,
         unwrapDI<DIFile>(File),
@@ -665,11 +668,18 @@ extern "C" void LLVMWriteValueToString(LLVMValueRef Value, RustStringRef str) {
 extern "C" bool
 LLVMRustLinkInExternalBitcode(LLVMModuleRef dst, char *bc, size_t len) {
     Module *Dst = unwrap(dst);
+#if LLVM_VERSION_MINOR == 5
     MemoryBuffer* buf = MemoryBuffer::getMemBufferCopy(StringRef(bc, len));
     ErrorOr<Module *> Src = llvm::getLazyBitcodeModule(buf, Dst->getContext());
+#else
+    std::unique_ptr<MemoryBuffer> buf = MemoryBuffer::getMemBufferCopy(StringRef(bc, len));
+    ErrorOr<Module *> Src = llvm::getLazyBitcodeModule(std::move(buf), Dst->getContext());
+#endif
     if (!Src) {
         LLVMRustSetLastError(Src.getError().message().c_str());
+#if LLVM_VERSION_MINOR == 5
         delete buf;
+#endif
         return false;
     }
 
@@ -712,12 +722,26 @@ LLVMRustOpenArchive(char *path) {
         return nullptr;
     }
 
+#if LLVM_VERSION_MINOR >= 6
+    ErrorOr<std::unique_ptr<Archive>> archive_or =
+        Archive::create(buf_or.get()->getMemBufferRef());
+
+    if (!archive_or) {
+        LLVMRustSetLastError(archive_or.getError().message().c_str());
+        return nullptr;
+    }
+
+    OwningBinary<Archive> *ret = new OwningBinary<Archive>(
+            std::move(archive_or.get()), std::move(buf_or.get()));
+#else
     std::error_code err;
     Archive *ret = new Archive(std::move(buf_or.get()), err);
     if (err) {
         LLVMRustSetLastError(err.message().c_str());
-        return NULL;
+        return nullptr;
     }
+#endif
+
     return ret;
 }
 #else
@@ -739,7 +763,14 @@ LLVMRustOpenArchive(char *path) {
 #endif
 
 extern "C" const char*
+#if LLVM_VERSION_MINOR >= 6
+LLVMRustArchiveReadSection(OwningBinary<Archive> *ob, char *name, size_t *size) {
+
+    std::unique_ptr<Archive> &ar = ob->getBinary();
+#else
 LLVMRustArchiveReadSection(Archive *ar, char *name, size_t *size) {
+#endif
+
 #if LLVM_VERSION_MINOR >= 5
     Archive::child_iterator child = ar->child_begin(),
                               end = ar->child_end();
@@ -765,7 +796,11 @@ LLVMRustArchiveReadSection(Archive *ar, char *name, size_t *size) {
 }
 
 extern "C" void
+#if LLVM_VERSION_MINOR >= 6
+LLVMRustDestroyArchive(OwningBinary<Archive> *ar) {
+#else
 LLVMRustDestroyArchive(Archive *ar) {
+#endif
     delete ar;
 }
 
diff --git a/src/rustllvm/llvm-auto-clean-trigger b/src/rustllvm/llvm-auto-clean-trigger
index 936a5fad895..40beb564f7c 100644
--- a/src/rustllvm/llvm-auto-clean-trigger
+++ b/src/rustllvm/llvm-auto-clean-trigger
@@ -1,4 +1,4 @@
 # If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
 # The actual contents of this file do not matter, but to trigger a change on the
 # build bots then the contents should be changed so git updates the mtime.
-2014-09-08
+2014-10-04
diff --git a/src/rustllvm/rustllvm.h b/src/rustllvm/rustllvm.h
index 5469531c541..2b324a37865 100644
--- a/src/rustllvm/rustllvm.h
+++ b/src/rustllvm/rustllvm.h
@@ -32,8 +32,6 @@
 #include "llvm/Support/DynamicLibrary.h"
 #include "llvm/Support/Memory.h"
 #include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/ExecutionEngine/JITMemoryManager.h"
 #include "llvm/ExecutionEngine/MCJIT.h"
 #include "llvm/ExecutionEngine/Interpreter.h"
 #include "llvm/Target/TargetMachine.h"