Skip to content

Commit e0a79ee

Browse files
authored
[lldb] Remove references to llvm-gcc (#120225)
The `llvm-gcc` front-end has been EOL'd at least since 2011 (based on some `git` archeology). And Clang/LLVM has been removing references to it ever since. This patch removes the remaining references to it from LLDB. One benefit of this is that it will allow us to remove the code checking for `DW_AT_decl_file_attributes_are_invalid` and `Supports_DW_AT_APPLE_objc_complete_type`.
1 parent 1157187 commit e0a79ee

File tree

7 files changed

+5
-74
lines changed

7 files changed

+5
-74
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -736,15 +736,9 @@ bool DWARFUnit::LinkToSkeletonUnit(DWARFUnit &skeleton_unit) {
736736
return false; // Already linked to a different unit.
737737
}
738738

739-
bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type() {
740-
return GetProducer() != eProducerLLVMGCC;
741-
}
739+
bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type() { return true; }
742740

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

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

776766
llvm::SmallVector<llvm::StringRef, 3> matches;
777767
if (g_swiftlang_version_regex.Execute(producer, &matches)) {
@@ -783,8 +773,6 @@ void DWARFUnit::ParseProducerInfo() {
783773
m_producer = eProducerClang;
784774
} else if (producer.contains("GNU")) {
785775
m_producer = eProducerGCC;
786-
} else if (g_llvm_gcc_regex.Execute(producer)) {
787-
m_producer = eProducerLLVMGCC;
788776
}
789777
}
790778

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ enum DWARFProducer {
3434
eProducerInvalid = 0,
3535
eProducerClang,
3636
eProducerGCC,
37-
eProducerLLVMGCC,
3837
eProducerSwift,
3938
eProducerOther
4039
};

lldb/test/API/functionalities/conditional_break/TestConditionalBreak.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# rdar://problem/8532131
1111
# lldb not able to digest the clang-generated debug info correctly with respect to function name
1212
#
13-
# This class currently fails for clang as well as llvm-gcc.
13+
# This class currently fails for clang.
1414

1515

1616
class ConditionalBreakTestCase(TestBase):

lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def cleanup():
6767
)
6868

6969
# gcc4.2 on Mac OS X skips typedef chains in the DWARF output
70-
if self.getCompiler() in ["clang", "llvm-gcc"]:
70+
if self.getCompiler() in ["clang"]:
7171
self.expect(
7272
"frame variable",
7373
patterns=[

lldb/test/API/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -157,27 +157,6 @@ def cleanup():
157157
],
158158
)
159159

160-
# Bad debugging info on SnowLeopard gcc (Apple Inc. build 5666).
161-
# Skip the following tests if the condition is met.
162-
if self.getCompiler().endswith("gcc") and not self.getCompiler().endswith(
163-
"llvm-gcc"
164-
):
165-
import re
166-
167-
gcc_version_output = system([[lldbutil.which(self.getCompiler()), "-v"]])
168-
self.trace("my output:", gcc_version_output)
169-
for line in gcc_version_output.split(os.linesep):
170-
m = re.search("\(Apple Inc\. build ([0-9]+)\)", line)
171-
self.trace("line:", line)
172-
if m:
173-
gcc_build = int(m.group(1))
174-
self.trace("gcc build:", gcc_build)
175-
if gcc_build >= 5666:
176-
# rdar://problem/9804600"
177-
self.skipTest(
178-
"rdar://problem/9804600 wrong namespace for std::string in debug info"
179-
)
180-
181160
# Expand same expression, skipping 3 layers of summaries
182161
self.expect(
183162
"frame variable data1.m_child1->m_child2 --show-types --no-summary-depth=3",

lldb/test/API/lang/cpp/namespace/TestNamespace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def test_with_run_command(self):
161161
# On Mac OS X, gcc 4.2 emits the wrong debug info with respect to
162162
# types.
163163
slist = ["(int) a = 12", "anon_uint", "a_uint", "b_uint", "y_uint"]
164-
if self.platformIsDarwin() and self.getCompiler() in ["clang", "llvm-gcc"]:
164+
if self.platformIsDarwin() and self.getCompiler() in ["clang"]:
165165
slist = [
166166
"(int) a = 12",
167167
"::my_uint_t",

lldb/unittests/SymbolFile/DWARF/DWARFUnitTest.cpp

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -122,41 +122,6 @@ TEST(DWARFUnitTest, ClangProducer) {
122122
EXPECT_EQ(unit->GetProducerVersion(), llvm::VersionTuple(1300, 0, 29, 3));
123123
}
124124

125-
TEST(DWARFUnitTest, LLVMGCCProducer) {
126-
const char *yamldata = R"(
127-
--- !ELF
128-
FileHeader:
129-
Class: ELFCLASS64
130-
Data: ELFDATA2LSB
131-
Type: ET_EXEC
132-
Machine: EM_386
133-
DWARF:
134-
debug_str:
135-
- 'i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)'
136-
debug_abbrev:
137-
- Table:
138-
- Code: 0x00000001
139-
Tag: DW_TAG_compile_unit
140-
Children: DW_CHILDREN_yes
141-
Attributes:
142-
- Attribute: DW_AT_producer
143-
Form: DW_FORM_strp
144-
debug_info:
145-
- Version: 4
146-
AddrSize: 8
147-
Entries:
148-
- AbbrCode: 0x1
149-
Values:
150-
- Value: 0x0
151-
- AbbrCode: 0x0
152-
)";
153-
154-
YAMLModuleTester t(yamldata);
155-
DWARFUnit *unit = t.GetDwarfUnit();
156-
ASSERT_TRUE((bool)unit);
157-
EXPECT_EQ(unit->GetProducer(), eProducerLLVMGCC);
158-
}
159-
160125
TEST(DWARFUnitTest, SwiftProducer) {
161126
const char *yamldata = R"(
162127
--- !ELF

0 commit comments

Comments
 (0)