[PATCH] D154630: [LLVM-C] Use unwrapDI in LLVMDITypeGetName

Tamir Duberstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 10:58:22 PDT 2023


tamird created this revision.
tamird added a reviewer: whitequark.
Herald added a subscriber: hiraditya.
Herald added a project: All.
tamird requested review of this revision.
Herald added a project: LLVM.

This function otherwise crashes. This behavior has been incorrect since
its introduction in 260b581498bed0b847e7e086852e0082d266711d (D46627 <https://reviews.llvm.org/D46627>).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154630

Files:
  llvm/lib/IR/DebugInfo.cpp


Index: llvm/lib/IR/DebugInfo.cpp
===================================================================
--- llvm/lib/IR/DebugInfo.cpp
+++ llvm/lib/IR/DebugInfo.cpp
@@ -1487,7 +1487,7 @@
 }
 
 const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length) {
-  StringRef Str = unwrap<DIType>(DType)->getName();
+  StringRef Str = unwrapDI<DIType>(DType)->getName();
   *Length = Str.size();
   return Str.data();
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154630.537797.patch
Type: text/x-patch
Size: 418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230706/a95dc1b8/attachment.bin>


More information about the llvm-commits mailing list