From ebc85077df1ebc603e24495151ba5db1159a42d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinbrink?= Date: Fri, 5 Jan 2018 15:22:35 +0100 Subject: [PATCH] Remove dead function rustc_llvm::debug_loc_to_string() Refs #46437 as it also removes LLVMRustWriteDebugLocToString() --- src/librustc_llvm/ffi.rs | 2 -- src/librustc_llvm/lib.rs | 5 ----- src/rustllvm/RustWrapper.cpp | 8 -------- src/rustllvm/rustllvm.h | 1 - 4 files changed, 16 deletions(-) diff --git a/src/librustc_llvm/ffi.rs b/src/librustc_llvm/ffi.rs index 8ed3953b814..2cfb151ae85 100644 --- a/src/librustc_llvm/ffi.rs +++ b/src/librustc_llvm/ffi.rs @@ -1642,8 +1642,6 @@ extern "C" { pub fn LLVMRustWriteDiagnosticInfoToString(DI: DiagnosticInfoRef, s: RustStringRef); pub fn LLVMRustGetDiagInfoKind(DI: DiagnosticInfoRef) -> DiagnosticKind; - pub fn LLVMRustWriteDebugLocToString(C: ContextRef, DL: DebugLocRef, s: RustStringRef); - pub fn LLVMRustSetInlineAsmDiagnosticHandler(C: ContextRef, H: InlineAsmDiagHandler, CX: *mut c_void); diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 592bd620564..c75a026a0f8 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -296,11 +296,6 @@ pub unsafe fn twine_to_string(tr: TwineRef) -> String { build_string(|s| LLVMRustWriteTwineToString(tr, s)).expect("got a non-UTF8 Twine from LLVM") } -pub unsafe fn debug_loc_to_string(c: ContextRef, tr: DebugLocRef) -> String { - build_string(|s| LLVMRustWriteDebugLocToString(c, tr, s)) - .expect("got a non-UTF8 DebugLoc from LLVM") -} - pub fn initialize_available_targets() { macro_rules! init_target( ($cfg:meta, $($method:ident),*) => { { diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index 8030a545ec3..95130d596e1 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -958,7 +958,6 @@ extern "C" LLVMTypeRef LLVMRustArrayType(LLVMTypeRef ElementTy, } DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Twine, LLVMTwineRef) -DEFINE_SIMPLE_CONVERSION_FUNCTIONS(DebugLoc, LLVMDebugLocRef) extern "C" void LLVMRustWriteTwineToString(LLVMTwineRef T, RustStringRef Str) { RawRustStringOstream OS(Str); @@ -1107,13 +1106,6 @@ extern "C" LLVMTypeKind LLVMRustGetTypeKind(LLVMTypeRef Ty) { report_fatal_error("Unhandled TypeID."); } -extern "C" void LLVMRustWriteDebugLocToString(LLVMContextRef C, - LLVMDebugLocRef DL, - RustStringRef Str) { - RawRustStringOstream OS(Str); - unwrap(DL)->print(OS); -} - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(SMDiagnostic, LLVMSMDiagnosticRef) extern "C" void LLVMRustSetInlineAsmDiagnosticHandler( diff --git a/src/rustllvm/rustllvm.h b/src/rustllvm/rustllvm.h index 714173f8602..b92834bc940 100644 --- a/src/rustllvm/rustllvm.h +++ b/src/rustllvm/rustllvm.h @@ -103,7 +103,6 @@ enum LLVMRustAttribute { typedef struct OpaqueRustString *RustStringRef; typedef struct LLVMOpaqueTwine *LLVMTwineRef; -typedef struct LLVMOpaqueDebugLoc *LLVMDebugLocRef; typedef struct LLVMOpaqueSMDiagnostic *LLVMSMDiagnosticRef; typedef struct LLVMOpaqueRustJITMemoryManager *LLVMRustJITMemoryManagerRef;