Refactor runtime support builder.
Also, add inline assembly for load offset from current thread.
Change-Id: I5c32c04a5ab9a8574acbaf8ee3e08761ebe33d4f
diff --git a/src/compiler_llvm/ir_builder.h b/src/compiler_llvm/ir_builder.h
index 46c37f1..f21cfaf 100644
--- a/src/compiler_llvm/ir_builder.h
+++ b/src/compiler_llvm/ir_builder.h
@@ -120,8 +120,8 @@
StoreToObjectOffset(object_addr, offset, new_value, tbaa_.GetMemoryJType(special_ty, j_ty));
}
- void SetTBAACall(llvm::CallInst* call_inst, TBAASpecialType special_ty) {
- call_inst->setMetadata(llvm::LLVMContext::MD_tbaa, tbaa_.GetSpecialType(special_ty));
+ void SetTBAA(llvm::Instruction* inst, TBAASpecialType special_ty) {
+ inst->setMetadata(llvm::LLVMContext::MD_tbaa, tbaa_.GetSpecialType(special_ty));
}
@@ -217,10 +217,16 @@
// Runtime Helper Function
//--------------------------------------------------------------------------
+ RuntimeSupportBuilder& Runtime() {
+ return *runtime_support_;
+ }
+
+ // TODO: Deprecate
llvm::Function* GetRuntime(runtime_support::RuntimeId rt) {
return runtime_support_->GetRuntimeSupportFunction(rt);
}
+ // TODO: Deprecate
void SetRuntimeSupport(RuntimeSupportBuilder* runtime_support) {
// Can only set once. We can't do this on constructor, because RuntimeSupportBuilder needs
// IRBuilder.