Index: llvm/include/llvm/IR/DIBuilder.h =================================================================== --- llvm/include/llvm/IR/DIBuilder.h +++ llvm/include/llvm/IR/DIBuilder.h @@ -220,21 +220,23 @@ /// \param Name Type name. /// \param SizeInBits Size of the type. DIStringType *createStringType(StringRef Name, uint64_t SizeInBits); - + /// Create debugging information entry for Fortran /// assumed length string type. /// \param Name Type name. - /// \param StringLength String length expressed either as Metadata * or DIVariable *. + /// \param StringLength String length expressed as Metadata *. /// \param StrLocationExp Optional memory location of the string. - DIStringType *createStringType(StringRef Name, PointerUnionStringLength, Metadata *StrLocationExp=nullptr); - + DIStringType *createStringType(StringRef Name, Metadata *StringLength, + Metadata *StrLocationExp = nullptr); + /// Create debugging information entry for Fortran /// assumed length string type. - /// \param Name Type name. + /// \param Name Type name. /// \param StringLengthExp String length expressed in DIExpression form. - /// \param StrLocationExp Optional memory location of the string. + /// \param StrLocationExp Optional memory location of the string. DIStringType *createStringTypeExp(StringRef Name, - DIExpression *StringLengthExp, Metadata *StrLocationExp=nullptr); + DIExpression *StringLengthExp, + Metadata *StrLocationExp = nullptr); /// Create debugging information entry for a qualified /// type, e.g. 'const int'. Index: llvm/lib/IR/DIBuilder.cpp =================================================================== --- llvm/lib/IR/DIBuilder.cpp +++ llvm/lib/IR/DIBuilder.cpp @@ -296,17 +296,19 @@ } DIStringType *DIBuilder::createStringType(StringRef Name, - PointerUnionStringLength, Metadata *StrLocationExp) { + Metadata *StringLength, + Metadata *StrLocationExp) { assert(!Name.empty() && "Unable to create type without name"); return DIStringType::get(VMContext, dwarf::DW_TAG_string_type, Name, StringLength, nullptr, StrLocationExp, 0, 0, 0); } DIStringType *DIBuilder::createStringTypeExp(StringRef Name, - DIExpression *StringLengthExp, Metadata *StrLocationExp) { + 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,StrLocationExp, 0, 0, 0); + StringLengthExp, StrLocationExp, 0, 0, 0); } DIDerivedType *DIBuilder::createQualifiedType(unsigned Tag, DIType *FromTy) { Index: llvm/unittests/IR/DebugInfoTest.cpp =================================================================== --- llvm/unittests/IR/DebugInfoTest.cpp +++ llvm/unittests/IR/DebugInfoTest.cpp @@ -252,11 +252,11 @@ std::unique_ptr M(new Module("MyModule", Ctx)); DIBuilder DIB(*M); StringRef StrName = "string"; - DIStringType *StringType = DIB.createStringType(StrName,nullptr); + DIStringType *StringType = DIB.createStringType(StrName, nullptr); EXPECT_TRUE(isa_and_nonnull(StringType)); - EXPECT_EQ(StringType->getName(),"string"); - EXPECT_EQ(StringType->getStringLength(),nullptr); + EXPECT_EQ(StringType->getName(), "string"); + EXPECT_EQ(StringType->getStringLength(), nullptr); } TEST(DIBuilder, DIEnumerator) {