about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorSimonas Kazlauskas <git@kazlauskas.me>2016-02-04 19:40:28 +0200
committerSimonas Kazlauskas <git@kazlauskas.me>2016-02-24 21:05:21 +0200
commitba26efb60c9e11ab058a1c31b9816147c55ab417 (patch)
tree37cfc6ce05c69908fe02a37515185c79a9248d1b /src/rustllvm/RustWrapper.cpp
parentbe7196a793a185355efb7ec8801102ddec95483d (diff)
downloadrust-ba26efb60c9e11ab058a1c31b9816147c55ab417.tar.gz
rust-ba26efb60c9e11ab058a1c31b9816147c55ab417.zip
Implement filling drop in MIR
Hopefully the author caught all the cases. For the mir_dynamic_drops_3 test case the ratio of
memsets to other instructions is 12%. On the other hand we actually do not double drop for at least
the test cases provided anymore in MIR.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 4ebe49512d7..91cf4aa1da9 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -1167,3 +1167,8 @@ LLVMRustBuildInvoke(LLVMBuilderRef B,
     return LLVMBuildInvoke(B, Fn, Args, NumArgs, Then, Catch, Name);
 }
 #endif
+
+extern "C" void LLVMRustPositionBuilderAtStart(LLVMBuilderRef B, LLVMBasicBlockRef BB) {
+    auto point = unwrap(BB)->getFirstInsertionPt();
+    unwrap(B)->SetInsertPoint(unwrap(BB), point);
+}