aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorDavid <davidgmbb@gmail.com>2025-06-24 07:42:06 -0600
committerGitHub <noreply@github.com>2025-06-24 14:42:06 +0100
commit8fec6d11777ad29c55f8104fc11504cadba3fc22 (patch)
treefe4137bfe83bee49572ed54d878ba49397172ca8 /llvm/lib/IR/DebugInfo.cpp
parent68f09370f99f1c079827f1d1e2e5774d8d2c90e3 (diff)
downloadllvm-8fec6d11777ad29c55f8104fc11504cadba3fc22.zip
llvm-8fec6d11777ad29c55f8104fc11504cadba3fc22.tar.gz
llvm-8fec6d11777ad29c55f8104fc11504cadba3fc22.tar.bz2
llvm-c: Introduce 'LLVMDISubprogramReplaceType' (#143461)
The C API does not provide a way to replace the subroutine type after creating a subprogram. This functionality is useful for creating a subroutine type composed of types which have the subprogram as scope
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 196fe294..5c645ff 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -1813,6 +1813,12 @@ unsigned LLVMDISubprogramGetLine(LLVMMetadataRef Subprogram) {
return unwrapDI<DISubprogram>(Subprogram)->getLine();
}
+void LLVMDISubprogramReplaceType(LLVMMetadataRef Subprogram,
+ LLVMMetadataRef SubroutineType) {
+ unwrapDI<DISubprogram>(Subprogram)
+ ->replaceType(unwrapDI<DISubroutineType>(SubroutineType));
+}
+
LLVMMetadataRef LLVMInstructionGetDebugLoc(LLVMValueRef Inst) {
return wrap(unwrap<Instruction>(Inst)->getDebugLoc().getAsMDNode());
}