diff --git a/llvm/include/llvm/IR/DIBuilder.h b/llvm/include/llvm/IR/DIBuilder.h index aca3f4c298953..e58c783dd7698 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 b0700b769fd83..9b66b369ef00d 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) {