From 2c5dfeed2f7713c17ce457b4f82dce052fee1363 Mon Sep 17 00:00:00 2001 From: YASHASVI KHATAVKAR Date: Thu, 27 Jan 2022 09:50:52 -0500 Subject: [PATCH] Addressed review comments --- llvm/include/llvm/IR/DIBuilder.h | 12 +++++++----- llvm/lib/IR/DIBuilder.cpp | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/llvm/include/llvm/IR/DIBuilder.h b/llvm/include/llvm/IR/DIBuilder.h index aca3f4c29895..e58c783dd769 100644 --- a/llvm/include/llvm/IR/DIBuilder.h +++ b/llvm/include/llvm/IR/DIBuilder.h @@ -223,16 +223,18 @@ namespace llvm { /// Create debugging information entry for Fortran /// assumed length string type. - /// \param Name Type name. - /// \param stringLength Metadata refrencing string length. - DIStringType *createStringType(StringRef Name, Metadata *stringLength); + /// \param Name Type name. + /// \param StringLength String length expressed either as Metadata * or DIVariable *. + /// \param StrLocationExp Optional memory location of the string. + DIStringType *createStringType(StringRef Name, PointerUnionStringLength, Metadata *StrLocationExp=nullptr); /// Create debugging information entry for Fortran /// assumed length string type. /// \param Name Type name. - /// \param stringLength String length expressed in DIExpression form + /// \param StringLengthExp String length expressed in DIExpression form. + /// \param StrLocationExp Optional memory location of the string. DIStringType *createStringTypeExp(StringRef Name, - DIExpression *stringLengthExp); + DIExpression *StringLengthExp, Metadata *StrLocationExp=nullptr); /// Create debugging information entry for a qualified /// type, e.g. 'const int'. diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index b0700b769fd8..9b66b369ef00 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -294,17 +294,17 @@ DIStringType *DIBuilder::createStringType(StringRef Name, uint64_t SizeInBits) { } DIStringType *DIBuilder::createStringType(StringRef Name, - Metadata *stringLength) { + PointerUnionStringLength, Metadata *StrLocationExp) { assert(!Name.empty() && "Unable to create type without name"); return DIStringType::get(VMContext, dwarf::DW_TAG_string_type, Name, - stringLength, nullptr, 0, 0, 0); + StringLength, nullptr, StrLocationExp, 0, 0, 0); } DIStringType *DIBuilder::createStringTypeExp(StringRef Name, - DIExpression *stringLengthExp) { + DIExpression *StringLengthExp, Metadata *StrLocationExp) { assert(!Name.empty() && "Unable to create type without name"); return DIStringType::get(VMContext, dwarf::DW_TAG_string_type, Name, nullptr, - stringLengthExp, 0, 0, 0); + StringLengthExp,StrLocationExp, 0, 0, 0); } DIDerivedType *DIBuilder::createQualifiedType(unsigned Tag, DIType *FromTy) {