Skip to content

Commit a47054e

Browse files
committed
[lldb] Remove references to llvm-gcc (llvm#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`. (cherry picked from commit e0a79ee)
1 parent f6bbbcc commit a47054e

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
@@ -734,15 +734,9 @@ bool DWARFUnit::LinkToSkeletonUnit(DWARFUnit &skeleton_unit) {
734734
return false; // Already linked to a different unit.
735735
}
736736

737-
bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type() {
738-
return GetProducer() != eProducerLLVMGCC;
739-
}
737+
bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type() { return true; }
740738

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

747741
bool DWARFUnit::Supports_unnamed_objc_bitfields() {
748742
if (GetProducer() == eProducerClang)
@@ -766,10 +760,6 @@ void DWARFUnit::ParseProducerInfo() {
766760
llvm::StringRef(R"(swiftlang-([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?))"));
767761
static const RegularExpression g_clang_version_regex(
768762
llvm::StringRef(R"(clang-([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?))"));
769-
static const RegularExpression g_llvm_gcc_regex(
770-
llvm::StringRef(R"(4\.[012]\.[01] )"
771-
R"(\(Based on Apple Inc\. build [0-9]+\) )"
772-
R"(\(LLVM build [\.0-9]+\)$)"));
773763

774764
llvm::SmallVector<llvm::StringRef, 3> matches;
775765
if (g_swiftlang_version_regex.Execute(producer, &matches)) {
@@ -781,8 +771,6 @@ void DWARFUnit::ParseProducerInfo() {
781771
m_producer = eProducerClang;
782772
} else if (producer.contains("GNU")) {
783773
m_producer = eProducerGCC;
784-
} else if (g_llvm_gcc_regex.Execute(producer)) {
785-
m_producer = eProducerLLVMGCC;
786774
}
787775
}
788776

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

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

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)