Skip to content

[lldb] Remove references to llvm-gcc #120225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,15 +736,9 @@ bool DWARFUnit::LinkToSkeletonUnit(DWARFUnit &skeleton_unit) {
return false; // Already linked to a different unit.
}

bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type() {
return GetProducer() != eProducerLLVMGCC;
}
bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type() { return true; }

bool DWARFUnit::DW_AT_decl_file_attributes_are_invalid() {
// llvm-gcc makes completely invalid decl file attributes and won't ever be
// fixed, so we need to know to ignore these.
return GetProducer() == eProducerLLVMGCC;
}
bool DWARFUnit::DW_AT_decl_file_attributes_are_invalid() { return false; }

bool DWARFUnit::Supports_unnamed_objc_bitfields() {
if (GetProducer() == eProducerClang)
Expand All @@ -768,10 +762,6 @@ void DWARFUnit::ParseProducerInfo() {
llvm::StringRef(R"(swiftlang-([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?))"));
static const RegularExpression g_clang_version_regex(
llvm::StringRef(R"(clang-([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?))"));
static const RegularExpression g_llvm_gcc_regex(
llvm::StringRef(R"(4\.[012]\.[01] )"
R"(\(Based on Apple Inc\. build [0-9]+\) )"
R"(\(LLVM build [\.0-9]+\)$)"));

llvm::SmallVector<llvm::StringRef, 3> matches;
if (g_swiftlang_version_regex.Execute(producer, &matches)) {
Expand All @@ -783,8 +773,6 @@ void DWARFUnit::ParseProducerInfo() {
m_producer = eProducerClang;
} else if (producer.contains("GNU")) {
m_producer = eProducerGCC;
} else if (g_llvm_gcc_regex.Execute(producer)) {
m_producer = eProducerLLVMGCC;
}
}

Expand Down
1 change: 0 additions & 1 deletion lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ enum DWARFProducer {
eProducerInvalid = 0,
eProducerClang,
eProducerGCC,
eProducerLLVMGCC,
eProducerSwift,
eProducerOther
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# rdar://problem/8532131
# lldb not able to digest the clang-generated debug info correctly with respect to function name
#
# This class currently fails for clang as well as llvm-gcc.
# This class currently fails for clang.


class ConditionalBreakTestCase(TestBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def cleanup():
)

# gcc4.2 on Mac OS X skips typedef chains in the DWARF output
if self.getCompiler() in ["clang", "llvm-gcc"]:
if self.getCompiler() in ["clang"]
self.expect(
"frame variable",
patterns=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,27 +157,6 @@ def cleanup():
],
)

# Bad debugging info on SnowLeopard gcc (Apple Inc. build 5666).
# Skip the following tests if the condition is met.
if self.getCompiler().endswith("gcc") and not self.getCompiler().endswith(
"llvm-gcc"
):
import re

gcc_version_output = system([[lldbutil.which(self.getCompiler()), "-v"]])
self.trace("my output:", gcc_version_output)
for line in gcc_version_output.split(os.linesep):
m = re.search("\(Apple Inc\. build ([0-9]+)\)", line)
self.trace("line:", line)
if m:
gcc_build = int(m.group(1))
self.trace("gcc build:", gcc_build)
if gcc_build >= 5666:
# rdar://problem/9804600"
self.skipTest(
"rdar://problem/9804600 wrong namespace for std::string in debug info"
)

# Expand same expression, skipping 3 layers of summaries
self.expect(
"frame variable data1.m_child1->m_child2 --show-types --no-summary-depth=3",
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/API/lang/cpp/namespace/TestNamespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_with_run_command(self):
# On Mac OS X, gcc 4.2 emits the wrong debug info with respect to
# types.
slist = ["(int) a = 12", "anon_uint", "a_uint", "b_uint", "y_uint"]
if self.platformIsDarwin() and self.getCompiler() in ["clang", "llvm-gcc"]:
if self.platformIsDarwin() and self.getCompiler() in ["clang"]:
slist = [
"(int) a = 12",
"::my_uint_t",
Expand Down
35 changes: 0 additions & 35 deletions lldb/unittests/SymbolFile/DWARF/DWARFUnitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,41 +122,6 @@ TEST(DWARFUnitTest, ClangProducer) {
EXPECT_EQ(unit->GetProducerVersion(), llvm::VersionTuple(1300, 0, 29, 3));
}

TEST(DWARFUnitTest, LLVMGCCProducer) {
const char *yamldata = R"(
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_386
DWARF:
debug_str:
- 'i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)'
debug_abbrev:
- Table:
- Code: 0x00000001
Tag: DW_TAG_compile_unit
Children: DW_CHILDREN_yes
Attributes:
- Attribute: DW_AT_producer
Form: DW_FORM_strp
debug_info:
- Version: 4
AddrSize: 8
Entries:
- AbbrCode: 0x1
Values:
- Value: 0x0
- AbbrCode: 0x0
)";

YAMLModuleTester t(yamldata);
DWARFUnit *unit = t.GetDwarfUnit();
ASSERT_TRUE((bool)unit);
EXPECT_EQ(unit->GetProducer(), eProducerLLVMGCC);
}

TEST(DWARFUnitTest, SwiftProducer) {
const char *yamldata = R"(
--- !ELF
Expand Down
Loading