Skip to content

Commit 2cd98e2

Browse files
committed
Upgrade LLVM
This upgrade brings commit by @eddyb to help optimizations of virtual calls in a few places (llvm-mirror/llvm@6d2bd95) as well as a commit by @c-a to *greatly* improve the runtime of the optimization passes (rust-lang/llvm#3). Nice work to these guys!
1 parent d6d7812 commit 2cd98e2

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

src/llvm

Submodule llvm updated 1406 files

src/rustllvm/PassWrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ LLVMRustPrintModule(LLVMPassManagerRef PMR,
185185
std::string ErrorInfo;
186186
raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_Binary);
187187
formatted_raw_ostream FOS(OS);
188-
PM->add(createPrintModulePass(&FOS));
188+
PM->add(createPrintModulePass(FOS));
189189
PM->run(*unwrap(M));
190190
}
191191

src/rustllvm/RustWrapper.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -537,15 +537,15 @@ extern "C" bool
537537
LLVMRustLinkInExternalBitcode(LLVMModuleRef dst, char *bc, size_t len) {
538538
Module *Dst = unwrap(dst);
539539
MemoryBuffer* buf = MemoryBuffer::getMemBufferCopy(StringRef(bc, len));
540-
std::string Err;
541-
Module *Src = llvm::getLazyBitcodeModule(buf, Dst->getContext(), &Err);
542-
if (Src == NULL) {
543-
LLVMRustError = Err.c_str();
540+
ErrorOr<Module *> Src = llvm::getLazyBitcodeModule(buf, Dst->getContext());
541+
if (!Src) {
542+
LLVMRustError = Src.getError().message().c_str();
544543
delete buf;
545544
return false;
546545
}
547546

548-
if (Linker::LinkModules(Dst, Src, Linker::DestroySource, &Err)) {
547+
std::string Err;
548+
if (Linker::LinkModules(Dst, *Src, Linker::DestroySource, &Err)) {
549549
LLVMRustError = Err.c_str();
550550
return false;
551551
}
@@ -570,8 +570,8 @@ LLVMRustOpenArchive(char *path) {
570570

571571
extern "C" const char*
572572
LLVMRustArchiveReadSection(Archive *ar, char *name, size_t *size) {
573-
for (Archive::child_iterator child = ar->begin_children(),
574-
end = ar->end_children();
573+
for (Archive::child_iterator child = ar->child_begin(),
574+
end = ar->child_end();
575575
child != end; ++child) {
576576
StringRef sect_name;
577577
error_code err = child->getName(sect_name);

src/rustllvm/llvm-auto-clean-trigger

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
22
# The actual contents of this file do not matter, but to trigger a change on the
33
# build bots then the contents should be changed so git updates the mtime.
4-
2014-01-22
4+
2014-01-27

src/rustllvm/rustllvm.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616
#include "llvm/PassManager.h"
1717
#include "llvm/IR/InlineAsm.h"
1818
#include "llvm/IR/LLVMContext.h"
19-
#include "llvm/Analysis/Verifier.h"
19+
#include "llvm/IR/IRPrintingPasses.h"
2020
#include "llvm/Analysis/Passes.h"
2121
#include "llvm/Analysis/Lint.h"
2222
#include "llvm/ADT/ArrayRef.h"
2323
#include "llvm/ADT/Triple.h"
2424
#include "llvm/ADT/DenseSet.h"
25-
#include "llvm/Assembly/Parser.h"
26-
#include "llvm/Assembly/PrintModulePass.h"
2725
#include "llvm/Support/CommandLine.h"
2826
#include "llvm/Support/FormattedStream.h"
2927
#include "llvm/Support/Timer.h"

0 commit comments

Comments
 (0)