[llvm] r340691 - [C-API][DIBuilder] Use NameLen in LLVMDIBuilderCreateParameterVariable

Robert Widmann via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 25 12:54:39 PDT 2018


Author: codafi
Date: Sat Aug 25 12:54:39 2018
New Revision: 340691

URL: http://llvm.org/viewvc/llvm-project?rev=340691&view=rev
Log:
[C-API][DIBuilder] Use NameLen in LLVMDIBuilderCreateParameterVariable

Summary: NameLen wasn't being used and caused the parameters in gdb to very long, in my case, crashes in others. Please also perform the correct magical incarnations to have this be applied to the LLVM 7 branch.

Reviewers: whitequark, CodaFi

Reviewed By: CodaFi

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D51141

Modified:
    llvm/trunk/lib/IR/DebugInfo.cpp

Modified: llvm/trunk/lib/IR/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=340691&r1=340690&r2=340691&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DebugInfo.cpp (original)
+++ llvm/trunk/lib/IR/DebugInfo.cpp Sat Aug 25 12:54:39 2018
@@ -1330,7 +1330,7 @@ LLVMMetadataRef LLVMDIBuilderCreateParam
     size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo,
     LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags) {
   return wrap(unwrap(Builder)->createParameterVariable(
-                  unwrap<DIScope>(Scope), Name, ArgNo, unwrap<DIFile>(File),
+                  unwrap<DIScope>(Scope), {Name, NameLen}, ArgNo, unwrap<DIFile>(File),
                   LineNo, unwrap<DIType>(Ty), AlwaysPreserve,
                   map_from_llvmDIFlags(Flags)));
 }




More information about the llvm-commits mailing list