aboutsummaryrefslogtreecommitdiff
path: root/src/comp
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-05-05 11:34:15 -0700
committerPatrick Walton <[email protected]>2011-05-05 11:34:45 -0700
commit5fb6e6364b6b10e98430140554e644697f29eb06 (patch)
tree3332fcffda123b9c9d02f94d337597cef2b3a610 /src/comp
parentEnforce in typechecker that preds return a bool (diff)
downloadrust-5fb6e6364b6b10e98430140554e644697f29eb06.tar.xz
rust-5fb6e6364b6b10e98430140554e644697f29eb06.zip
rustc: Add a binding to LLVM's bitcode parser
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/back/Link.rs6
-rw-r--r--src/comp/lib/llvm.rs3
2 files changed, 9 insertions, 0 deletions
diff --git a/src/comp/back/Link.rs b/src/comp/back/Link.rs
index 5d9eb9d6..da165787 100644
--- a/src/comp/back/Link.rs
+++ b/src/comp/back/Link.rs
@@ -16,6 +16,10 @@ tag output_type {
output_type_object;
}
+fn link_intrinsics(session.session sess, ModuleRef llmod) {
+ // TODO
+}
+
mod Write {
fn is_object_or_assembly(output_type ot) -> bool {
if (ot == output_type_assembly) {
@@ -41,6 +45,8 @@ mod Write {
}
fn run_passes(session.session sess, ModuleRef llmod, str output) {
+ link_intrinsics(sess, llmod);
+
auto pm = mk_pass_manager();
auto opts = sess.get_opts();
diff --git a/src/comp/lib/llvm.rs b/src/comp/lib/llvm.rs
index 5e758bc6..cfa82b03 100644
--- a/src/comp/lib/llvm.rs
+++ b/src/comp/lib/llvm.rs
@@ -848,6 +848,9 @@ native mod llvm = llvm_lib {
call. */
fn LLVMRustGetLastError() -> sbuf;
+ /** Parses the bitcode in the given memory buffer. */
+ fn LLVMRustParseBitcode(MemoryBufferRef MemBuf) -> ModuleRef;
+
/** Links LLVM modules together. `Src` is destroyed by this call and
must never be referenced again. */
fn LLVMLinkModules(ModuleRef Dest, ModuleRef Src) -> Bool;