From 876cc472b44c0cadc66b14e57319a15ae2f611b3 Mon Sep 17 00:00:00 2001 From: Mads Ager Date: Mon, 9 May 2022 15:08:29 +0200 Subject: [PATCH] Remove unused debug info functions. These functions return the underlying buffer for a std::string which you should never do as it is only valid while the std::string is in scope. --- kotlin-native/llvmDebugInfoC/src/main/cpp/DebugInfoC.cpp | 9 --------- .../llvmDebugInfoC/src/main/include/DebugInfoC.h | 2 -- 2 files changed, 11 deletions(-) diff --git a/kotlin-native/llvmDebugInfoC/src/main/cpp/DebugInfoC.cpp b/kotlin-native/llvmDebugInfoC/src/main/cpp/DebugInfoC.cpp index 1d1043c25b4..82d040f9656 100644 --- a/kotlin-native/llvmDebugInfoC/src/main/cpp/DebugInfoC.cpp +++ b/kotlin-native/llvmDebugInfoC/src/main/cpp/DebugInfoC.cpp @@ -281,15 +281,6 @@ LLVMValueRef LLVMBuilderGetCurrentFunction(LLVMBuilderRef builder) { return llvm::wrap(llvm::unwrap(builder)->GetInsertBlock()->getParent()); } -const char* LLVMBuilderGetCurrentBbName(LLVMBuilderRef builder) { - return llvm::unwrap(builder)->GetInsertBlock()->getName().str().c_str(); -} - - -const char *DIGetSubprogramLinkName(DISubprogramRef sp) { - return llvm::unwrap(sp)->getLinkageName().str().c_str(); -} - int DISubprogramDescribesFunction(DISubprogramRef sp, LLVMValueRef fn) { return llvm::unwrap(sp)->describes(llvm::cast(llvm::unwrap(fn))); } diff --git a/kotlin-native/llvmDebugInfoC/src/main/include/DebugInfoC.h b/kotlin-native/llvmDebugInfoC/src/main/include/DebugInfoC.h index 0ef7ea747f3..6d17d6aeb42 100644 --- a/kotlin-native/llvmDebugInfoC/src/main/include/DebugInfoC.h +++ b/kotlin-native/llvmDebugInfoC/src/main/include/DebugInfoC.h @@ -106,8 +106,6 @@ DILocationRef LLVMCreateLocation(LLVMContextRef contextRef, unsigned line, unsig DILocationRef LLVMCreateLocationInlinedAt(LLVMContextRef contextRef, unsigned line, unsigned col, DIScopeOpaqueRef scope, DILocationRef refLocation); void LLVMBuilderSetDebugLocation(LLVMBuilderRef builder, DILocationRef refLocation); void LLVMBuilderResetDebugLocation(LLVMBuilderRef builder); -const char* LLVMBuilderGetCurrentBbName(LLVMBuilderRef builder); -const char *DIGetSubprogramLinkName(DISubprogramRef sp); LLVMValueRef LLVMBuilderGetCurrentFunction(LLVMBuilderRef builder); int DISubprogramDescribesFunction(DISubprogramRef sp, LLVMValueRef fn); # ifdef __cplusplus