Skip to content

Commit d4eae27

Browse files
committed
---
yaml --- r: 153749 b: refs/heads/try2 c: b29d106 h: refs/heads/master i: 153747: 5dcdd3a v: v3
1 parent 41449dc commit d4eae27

File tree

4 files changed

+34
-49
lines changed

4 files changed

+34
-49
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: c05bb4ec7d640b45ca87ead7b6090aaeb2acf060
8+
refs/heads/try2: b29d106b7ca57214f30bef0ab49bb7c3399230fe
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/etc/licenseck.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"test/bench/shootout-meteor.rs", # BSD
4949
"test/bench/shootout-pidigits.rs", # BSD
5050
"test/bench/shootout-regex-dna.rs", # BSD
51-
"test/bench/shootout-threadring.rs", # BSD
5251
]
5352

5453
def check_license(name, contents):

branches/try2/src/rustllvm/RustWrapper.cpp

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,30 @@ using namespace llvm::object;
3131

3232
static char *LastError;
3333

34+
#if LLVM_VERSION_MINOR >= 5
35+
extern "C" LLVMMemoryBufferRef
36+
LLVMRustCreateMemoryBufferWithContentsOfFile(const char *Path) {
37+
ErrorOr<std::unique_ptr<MemoryBuffer>> buf_or = MemoryBuffer::getFile(Path,
38+
-1,
39+
false);
40+
if (!buf_or) {
41+
LLVMRustSetLastError(buf_or.getError().message().c_str());
42+
return nullptr;
43+
}
44+
return wrap(buf_or.get().release());
45+
}
46+
#else
3447
extern "C" LLVMMemoryBufferRef
3548
LLVMRustCreateMemoryBufferWithContentsOfFile(const char *Path) {
36-
LLVMMemoryBufferRef MemBuf = NULL;
37-
char *err = NULL;
38-
LLVMCreateMemoryBufferWithContentsOfFile(Path, &MemBuf, &err);
39-
if (err != NULL) {
40-
LLVMRustSetLastError(err);
49+
OwningPtr<MemoryBuffer> buf;
50+
error_code err = MemoryBuffer::getFile(Path, buf, -1, false);
51+
if (err) {
52+
LLVMRustSetLastError(err.message().c_str());
53+
return NULL;
4154
}
42-
return MemBuf;
55+
return wrap(buf.take());
4356
}
57+
#endif
4458

4559
extern "C" char *LLVMRustGetLastError(void) {
4660
char *ret = LastError;
@@ -658,10 +672,12 @@ LLVMRustLinkInExternalBitcode(LLVMModuleRef dst, char *bc, size_t len) {
658672
#if LLVM_VERSION_MINOR >= 5
659673
extern "C" void*
660674
LLVMRustOpenArchive(char *path) {
661-
ErrorOr<std::unique_ptr<MemoryBuffer>> buf_or = MemoryBuffer::getFile(path);
675+
ErrorOr<std::unique_ptr<MemoryBuffer>> buf_or = MemoryBuffer::getFile(path,
676+
-1,
677+
false);
662678
if (!buf_or) {
663679
LLVMRustSetLastError(buf_or.getError().message().c_str());
664-
return NULL;
680+
return nullptr;
665681
}
666682

667683
std::error_code err;
@@ -676,7 +692,7 @@ LLVMRustOpenArchive(char *path) {
676692
extern "C" void*
677693
LLVMRustOpenArchive(char *path) {
678694
OwningPtr<MemoryBuffer> buf;
679-
error_code err = MemoryBuffer::getFile(path, buf);
695+
error_code err = MemoryBuffer::getFile(path, buf, -1, false);
680696
if (err) {
681697
LLVMRustSetLastError(err.message().c_str());
682698
return NULL;

branches/try2/src/test/bench/shootout-threadring.rs

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,12 @@
1-
// The Computer Language Benchmarks Game
2-
// http://benchmarksgame.alioth.debian.org/
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
34
//
4-
// contributed by the Rust Project Developers
5-
6-
// Copyright (c) 2012-2014 The Rust Project Developers
7-
//
8-
// All rights reserved.
9-
//
10-
// Redistribution and use in source and binary forms, with or without
11-
// modification, are permitted provided that the following conditions
12-
// are met:
13-
//
14-
// - Redistributions of source code must retain the above copyright
15-
// notice, this list of conditions and the following disclaimer.
16-
//
17-
// - Redistributions in binary form must reproduce the above copyright
18-
// notice, this list of conditions and the following disclaimer in
19-
// the documentation and/or other materials provided with the
20-
// distribution.
21-
//
22-
// - Neither the name of "The Computer Language Benchmarks Game" nor
23-
// the name of "The Computer Language Shootout Benchmarks" nor the
24-
// names of its contributors may be used to endorse or promote
25-
// products derived from this software without specific prior
26-
// written permission.
27-
//
28-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31-
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32-
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33-
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34-
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35-
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36-
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
37-
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38-
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
39-
// OF THE POSSIBILITY OF SUCH DAMAGE.
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
4010

4111
#![feature(phase)]
4212
#[phase(plugin)] extern crate green;

0 commit comments

Comments
 (0)