[llvm] 93d1a62 - Reverting an entire stack of changes causing build failures
YASHASVI KHATAVKAR via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 10 14:58:50 PST 2022
Author: YASHASVI KHATAVKAR
Date: 2022-02-10T17:58:22-05:00
New Revision: 93d1a623cecb6f732db7900baf230a13e6ac6c6a
URL: https://github.com/llvm/llvm-project/commit/93d1a623cecb6f732db7900baf230a13e6ac6c6a
DIFF: https://github.com/llvm/llvm-project/commit/93d1a623cecb6f732db7900baf230a13e6ac6c6a.diff
LOG: Reverting an entire stack of changes causing build failures
Added:
Modified:
llvm/docs/SourceLevelDebugging.rst
llvm/include/llvm/IR/DIBuilder.h
llvm/lib/IR/DIBuilder.cpp
llvm/unittests/IR/DebugInfoTest.cpp
Removed:
################################################################################
diff --git a/llvm/docs/SourceLevelDebugging.rst b/llvm/docs/SourceLevelDebugging.rst
index bdc55e5bcfec1..e4a529d0e2424 100644
--- a/llvm/docs/SourceLevelDebugging.rst
+++ b/llvm/docs/SourceLevelDebugging.rst
@@ -1087,10 +1087,6 @@ a Fortran front-end would generate the following descriptors:
!DILocalVariable(name: "string", arg: 1, scope: !10, file: !3, line: 4, type: !15)
!DIStringType(name: "character(*)!2", stringLength: !16, stringLengthExpression: !DIExpression(), size: 32)
-A fortran deferred-length character can also contain the information of raw storage of the characters in addition to the length of the string. This information is encoded in the stringLocationExpression field. Based on this information, DW_AT_data_location attribute is emitted in a DW_TAG_string_type debug info.
-
- !DIStringType(name: "character(*)!2", stringLengthExpression: !DIExpression(), stringLocationExpression: !DIExpression(DW_OP_push_object_address, DW_OP_deref), size: 32)
-
and this will materialize in DWARF tags as:
.. code-block:: text
@@ -1101,7 +1097,6 @@ and this will materialize in DWARF tags as:
0x00000064: DW_TAG_variable
DW_AT_location (DW_OP_fbreg +16)
DW_AT_type (0x00000083 "integer*8")
- DW_AT_data_location (DW_OP_push_object_address, DW_OP_deref)
...
DW_AT_artificial (true)
diff --git a/llvm/include/llvm/IR/DIBuilder.h b/llvm/include/llvm/IR/DIBuilder.h
index c635659fd625b..d3aad3719900e 100644
--- a/llvm/include/llvm/IR/DIBuilder.h
+++ b/llvm/include/llvm/IR/DIBuilder.h
@@ -221,23 +221,6 @@ namespace llvm {
/// \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 as DIVariable *.
- /// \param StrLocationExp Optional memory location of the string.
- DIStringType *createStringType(StringRef Name, DIVariable *StringLength,
- DIExpression *StrLocationExp = nullptr);
-
- /// Create debugging information entry for Fortran
- /// assumed length string type.
- /// \param Name Type name.
- /// \param StringLengthExp String length expressed in DIExpression form.
- /// \param StrLocationExp Optional memory location of the string.
- DIStringType *createStringType(StringRef Name,
- DIExpression *StringLengthExp,
- DIExpression *StrLocationExp = nullptr);
-
/// Create debugging information entry for a qualified
/// type, e.g. 'const int'.
/// \param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index 16f7072d9d044..dc5768dd4f26a 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -293,22 +293,6 @@ DIStringType *DIBuilder::createStringType(StringRef Name, uint64_t SizeInBits) {
SizeInBits, 0);
}
-DIStringType *DIBuilder::createStringType(StringRef Name,
- DIVariable *StringLength,
- DIExpression *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::createStringType(StringRef Name,
- DIExpression *StringLengthExp,
- DIExpression *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);
-}
-
DIDerivedType *DIBuilder::createQualifiedType(unsigned Tag, DIType *FromTy) {
return DIDerivedType::get(VMContext, Tag, "", nullptr, 0, nullptr, FromTy, 0,
0, 0, None, DINode::FlagZero);
diff --git a/llvm/unittests/IR/DebugInfoTest.cpp b/llvm/unittests/IR/DebugInfoTest.cpp
index 524752168b091..8605fbbcbd401 100644
--- a/llvm/unittests/IR/DebugInfoTest.cpp
+++ b/llvm/unittests/IR/DebugInfoTest.cpp
@@ -247,45 +247,6 @@ TEST(DIBuilder, CreateSetType) {
EXPECT_TRUE(isa_and_nonnull<DIDerivedType>(SetType));
}
-TEST(DIBuilder, CreateStringType) {
- LLVMContext Ctx;
- std::unique_ptr<Module> M(new Module("MyModule", Ctx));
- DIBuilder DIB(*M);
- DIScope *Scope = DISubprogram::getDistinct(
- Ctx, nullptr, "", "", nullptr, 0, nullptr, 0, nullptr, 0, 0,
- DINode::FlagZero, DISubprogram::SPFlagZero, nullptr);
- DIFile *F = DIB.createFile("main.c", "/");
- StringRef StrName = "string";
- DIVariable *StringLen = DIB.createAutoVariable(Scope, StrName, F, 0, nullptr,
- false, DINode::FlagZero, 0);
- auto getDIExpression = [&DIB](int offset) {
- SmallVector<uint64_t, 4> ops;
- ops.push_back(llvm::dwarf::DW_OP_push_object_address);
- DIExpression::appendOffset(ops, offset);
- ops.push_back(llvm::dwarf::DW_OP_deref);
-
- return DIB.createExpression(ops);
- };
- DIExpression *StringLocationExp = getDIExpression(1);
- DIStringType *StringType =
- DIB.createStringType(StrName, StringLen, StringLocationExp);
-
- EXPECT_TRUE(isa_and_nonnull<DIStringType>(StringType));
- EXPECT_EQ(StringType->getName(), StrName);
- EXPECT_EQ(StringType->getStringLength(), StringLen);
- EXPECT_EQ(StringType->getStringLocationExp(), StringLocationExp);
-
- StringRef StrNameExp = "stringexp";
- DIExpression *StringLengthExp = getDIExpression(2);
- DIStringType *StringTypeExp =
- DIB.createStringType(StrNameExp, StringLengthExp, StringLocationExp);
-
- EXPECT_TRUE(isa_and_nonnull<DIStringType>(StringTypeExp));
- EXPECT_EQ(StringTypeExp->getName(), StrNameExp);
- EXPECT_EQ(StringTypeExp->getStringLocationExp(), StringLocationExp);
- EXPECT_EQ(StringTypeExp->getStringLengthExp(), StringLengthExp);
-}
-
TEST(DIBuilder, DIEnumerator) {
LLVMContext Ctx;
std::unique_ptr<Module> M(new Module("MyModule", Ctx));
More information about the llvm-commits
mailing list