replace LLVMRustAppendModuleInlineAsm with LLVMAppendModuleInlineAsm, LLVMRustMetadataTypeInContext with LLVMMetadataTypeInContext
This commit is contained in:
parent
c53a9faa6f
commit
076116bb4c
5 changed files with 6 additions and 15 deletions
|
@ -381,7 +381,7 @@ impl<'tcx> AsmMethods<'tcx> for CodegenCx<'_, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
llvm::LLVMRustAppendModuleInlineAsm(
|
llvm::LLVMAppendModuleInlineAsm(
|
||||||
self.llmod,
|
self.llmod,
|
||||||
template_str.as_ptr().cast(),
|
template_str.as_ptr().cast(),
|
||||||
template_str.len(),
|
template_str.len(),
|
||||||
|
|
|
@ -904,9 +904,9 @@ unsafe fn embed_bitcode(
|
||||||
// We need custom section flags, so emit module-level inline assembly.
|
// We need custom section flags, so emit module-level inline assembly.
|
||||||
let section_flags = if cgcx.is_pe_coff { "n" } else { "e" };
|
let section_flags = if cgcx.is_pe_coff { "n" } else { "e" };
|
||||||
let asm = create_section_with_flags_asm(".llvmbc", section_flags, bitcode);
|
let asm = create_section_with_flags_asm(".llvmbc", section_flags, bitcode);
|
||||||
llvm::LLVMRustAppendModuleInlineAsm(llmod, asm.as_ptr().cast(), asm.len());
|
llvm::LLVMAppendModuleInlineAsm(llmod, asm.as_ptr().cast(), asm.len());
|
||||||
let asm = create_section_with_flags_asm(".llvmcmd", section_flags, cmdline.as_bytes());
|
let asm = create_section_with_flags_asm(".llvmcmd", section_flags, cmdline.as_bytes());
|
||||||
llvm::LLVMRustAppendModuleInlineAsm(llmod, asm.as_ptr().cast(), asm.len());
|
llvm::LLVMAppendModuleInlineAsm(llmod, asm.as_ptr().cast(), asm.len());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1006,7 +1006,7 @@ extern "C" {
|
||||||
pub fn LLVMSetDataLayout(M: &Module, Triple: *const c_char);
|
pub fn LLVMSetDataLayout(M: &Module, Triple: *const c_char);
|
||||||
|
|
||||||
/// See Module::setModuleInlineAsm.
|
/// See Module::setModuleInlineAsm.
|
||||||
pub fn LLVMRustAppendModuleInlineAsm(M: &Module, Asm: *const c_char, AsmLen: size_t);
|
pub fn LLVMAppendModuleInlineAsm(M: &Module, Asm: *const c_char, Len: size_t);
|
||||||
|
|
||||||
/// See llvm::LLVMTypeKind::getTypeID.
|
/// See llvm::LLVMTypeKind::getTypeID.
|
||||||
pub fn LLVMRustGetTypeKind(Ty: &Type) -> TypeKind;
|
pub fn LLVMRustGetTypeKind(Ty: &Type) -> TypeKind;
|
||||||
|
@ -1053,7 +1053,7 @@ extern "C" {
|
||||||
|
|
||||||
// Operations on other types
|
// Operations on other types
|
||||||
pub fn LLVMVoidTypeInContext(C: &Context) -> &Type;
|
pub fn LLVMVoidTypeInContext(C: &Context) -> &Type;
|
||||||
pub fn LLVMRustMetadataTypeInContext(C: &Context) -> &Type;
|
pub fn LLVMMetadataTypeInContext(C: &Context) -> &Type;
|
||||||
|
|
||||||
// Operations on all values
|
// Operations on all values
|
||||||
pub fn LLVMTypeOf(Val: &Value) -> &Type;
|
pub fn LLVMTypeOf(Val: &Value) -> &Type;
|
||||||
|
|
|
@ -53,7 +53,7 @@ impl<'ll> CodegenCx<'ll, '_> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn type_metadata(&self) -> &'ll Type {
|
pub(crate) fn type_metadata(&self) -> &'ll Type {
|
||||||
unsafe { llvm::LLVMRustMetadataTypeInContext(self.llcx) }
|
unsafe { llvm::LLVMMetadataTypeInContext(self.llcx) }
|
||||||
}
|
}
|
||||||
|
|
||||||
///x Creates an integer type with the given number of bits, e.g., i24
|
///x Creates an integer type with the given number of bits, e.g., i24
|
||||||
|
|
|
@ -152,10 +152,6 @@ LLVMRustInsertPrivateGlobal(LLVMModuleRef M, LLVMTypeRef Ty) {
|
||||||
nullptr));
|
nullptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LLVMTypeRef LLVMRustMetadataTypeInContext(LLVMContextRef C) {
|
|
||||||
return wrap(Type::getMetadataTy(*unwrap(C)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) {
|
static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) {
|
||||||
switch (Kind) {
|
switch (Kind) {
|
||||||
case AlwaysInline:
|
case AlwaysInline:
|
||||||
|
@ -480,11 +476,6 @@ extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void LLVMRustAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm,
|
|
||||||
size_t AsmLen) {
|
|
||||||
unwrap(M)->appendModuleInlineAsm(StringRef(Asm, AsmLen));
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef DIBuilder *LLVMRustDIBuilderRef;
|
typedef DIBuilder *LLVMRustDIBuilderRef;
|
||||||
|
|
||||||
template <typename DIT> DIT *unwrapDIPtr(LLVMMetadataRef Ref) {
|
template <typename DIT> DIT *unwrapDIPtr(LLVMMetadataRef Ref) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue