Skip to content

Commit 8042f97

Browse files
committed
---
yaml --- r: 1877 b: refs/heads/master c: 027368b h: refs/heads/master i: 1875: 36b826b v: v3
1 parent d45b050 commit 8042f97

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: fb08ef44b4b9bd35f887876bf69e5fe944f7471b
2+
refs/heads/master: 027368b885848377a0025ced2734cabf5ff201e1

trunk/src/comp/front/creader.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import driver.session;
44
import front.ast;
55
import lib.llvm.False;
66
import lib.llvm.llvm;
7-
import lib.llvm.llvmext;
87
import lib.llvm.mk_object_file;
98
import lib.llvm.mk_section_iter;
109
import middle.fold;
@@ -331,23 +330,23 @@ fn load_crate(session.session sess,
331330
for (str library_search_path in library_search_paths) {
332331
auto path = fs.connect(library_search_path, filename);
333332
auto pbuf = _str.buf(path);
334-
auto mb = llvmext.LLVMRustCreateMemoryBufferWithContentsOfFile(pbuf);
333+
auto mb = llvm.LLVMRustCreateMemoryBufferWithContentsOfFile(pbuf);
335334
if (mb as int != 0) {
336335
auto of = mk_object_file(mb);
337336
auto si = mk_section_iter(of.llof);
338-
while (llvmext.LLVMIsSectionIteratorAtEnd(of.llof, si.llsi) ==
337+
while (llvm.LLVMIsSectionIteratorAtEnd(of.llof, si.llsi) ==
339338
False) {
340-
auto name_buf = llvmext.LLVMGetSectionName(si.llsi);
339+
auto name_buf = llvm.LLVMGetSectionName(si.llsi);
341340
auto name = _str.str_from_cstr(name_buf);
342341
if (_str.eq(name, x86.get_meta_sect_name())) {
343-
auto cbuf = llvmext.LLVMGetSectionContents(si.llsi);
344-
auto csz = llvmext.LLVMGetSectionSize(si.llsi);
342+
auto cbuf = llvm.LLVMGetSectionContents(si.llsi);
343+
auto csz = llvm.LLVMGetSectionSize(si.llsi);
345344
auto cvbuf = cbuf as _vec.vbuf;
346345
auto cvec = _vec.vec_from_vbuf[u8](cvbuf, csz);
347346
sess.set_external_crate(cnum, cvec);
348347
ret;
349348
}
350-
llvmext.LLVMMoveToNextSection(si.llsi);
349+
llvm.LLVMMoveToNextSection(si.llsi);
351350
}
352351
}
353352
}

trunk/src/comp/lib/llvm.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import llvm.CallConv;
2222
import llvm.IntPredicate;
2323
import llvm.RealPredicate;
2424
import llvm.Opcode;
25-
import llvmext.ObjectFileRef;
26-
import llvmext.SectionIteratorRef;
25+
import llvm.ObjectFileRef;
26+
import llvm.SectionIteratorRef;
2727

2828
type ULongLong = u64;
2929
type LongLong = i64;
@@ -740,9 +740,10 @@ native mod llvm = llvm_lib {
740740

741741
/** Destroys a memory buffer. */
742742
fn LLVMDisposeMemoryBuffer(MemoryBufferRef MemBuf);
743-
}
744743

745-
native mod llvmext = llvm_lib {
744+
745+
/* Stuff that's in rustllvm/ because it's not upstream yet. */
746+
746747
type ObjectFileRef;
747748
type SectionIteratorRef;
748749

@@ -777,6 +778,11 @@ native mod llvmext = llvm_lib {
777778
/** Returns a string describing the last error caused by an LLVMRust*
778779
call. */
779780
fn LLVMRustGetLastError() -> sbuf;
781+
782+
783+
}
784+
785+
native mod rustllvm = llvm_lib {
780786
}
781787

782788
/* Slightly more terse object-interface to LLVM's 'builder' functions. */
@@ -1384,26 +1390,26 @@ fn mk_pass_manager() -> pass_manager {
13841390
/* Memory-managed interface to object files. */
13851391

13861392
obj object_file_dtor(ObjectFileRef ObjectFile) {
1387-
drop { llvmext.LLVMDisposeObjectFile(ObjectFile); }
1393+
drop { llvm.LLVMDisposeObjectFile(ObjectFile); }
13881394
}
13891395

13901396
type object_file = rec(ObjectFileRef llof, object_file_dtor dtor);
13911397

13921398
fn mk_object_file(MemoryBufferRef llmb) -> object_file {
1393-
auto llof = llvmext.LLVMCreateObjectFile(llmb);
1399+
auto llof = llvm.LLVMCreateObjectFile(llmb);
13941400
ret rec(llof=llof, dtor=object_file_dtor(llof));
13951401
}
13961402

13971403
/* Memory-managed interface to section iterators. */
13981404

13991405
obj section_iter_dtor(SectionIteratorRef SI) {
1400-
drop { llvmext.LLVMDisposeSectionIterator(SI); }
1406+
drop { llvm.LLVMDisposeSectionIterator(SI); }
14011407
}
14021408

14031409
type section_iter = rec(SectionIteratorRef llsi, section_iter_dtor dtor);
14041410

14051411
fn mk_section_iter(ObjectFileRef llof) -> section_iter {
1406-
auto llsi = llvmext.LLVMGetSections(llof);
1412+
auto llsi = llvm.LLVMGetSections(llof);
14071413
ret rec(llsi=llsi, dtor=section_iter_dtor(llsi));
14081414
}
14091415

0 commit comments

Comments
 (0)