[llvm] 2c5dfee - Addressed review comments

YASHASVI KHATAVKAR via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 10 12:25:25 PST 2022


Author: YASHASVI KHATAVKAR
Date: 2022-02-10T15:24:50-05:00
New Revision: 2c5dfeed2f7713c17ce457b4f82dce052fee1363

URL: https://github.com/llvm/llvm-project/commit/2c5dfeed2f7713c17ce457b4f82dce052fee1363
DIFF: https://github.com/llvm/llvm-project/commit/2c5dfeed2f7713c17ce457b4f82dce052fee1363.diff

LOG: Addressed review comments

Added: 
    

Modified: 
    llvm/include/llvm/IR/DIBuilder.h
    llvm/lib/IR/DIBuilder.cpp

Removed: 
    


################################################################################
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,  PointerUnion<Metadata *, DIVariable *>StringLength, 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) {
+                                          PointerUnion<Metadata *, DIVariable *>StringLength, 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) {


        


More information about the llvm-commits mailing list