Skip to content

Commit 02c6845

Browse files
authored
Revert "[DebugInfo] Add flag to only emit referenced member functions" (#93767)
Reverts #87018 MacOS and Windows bots are broken.
1 parent 32f1f5e commit 02c6845

File tree

6 files changed

+1
-42
lines changed

6 files changed

+1
-42
lines changed

clang/include/clang/Basic/DebugOptions.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ BENIGN_DEBUGOPT(NoInlineLineTables, 1, 0) ///< Whether debug info should contain
6868
///< inline line tables.
6969

7070
DEBUGOPT(DebugStrictDwarf, 1, 1) ///< Whether or not to use strict DWARF info.
71-
DEBUGOPT(DebugOmitUnreferencedMethods, 1, 0) ///< Omit unreferenced member
72-
///< functions in type debug info.
7371

7472
/// Control the Assignment Tracking debug info feature.
7573
BENIGN_ENUM_DEBUGOPT(AssignmentTrackingMode, AssignmentTrackingOpts, 2,

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4345,10 +4345,6 @@ defm strict_dwarf : BoolOption<"g", "strict-dwarf",
43454345
"the specified version, avoiding features from later versions.">,
43464346
NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>,
43474347
Group<g_flags_Group>;
4348-
defm omit_unreferenced_methods : BoolGOption<"omit-unreferenced-methods",
4349-
CodeGenOpts<"DebugOmitUnreferencedMethods">, DefaultFalse,
4350-
NegFlag<SetFalse>,
4351-
PosFlag<SetTrue, [], [CC1Option]>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
43524348
defm column_info : BoolOption<"g", "column-info",
43534349
CodeGenOpts<"DebugColumnInfo">, DefaultTrue,
43544350
NegFlag<SetFalse, [], [ClangOption, CC1Option]>,

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2836,7 +2836,7 @@ CGDebugInfo::CreateTypeDefinition(const RecordType *Ty) {
28362836

28372837
// Collect data fields (including static variables and any initializers).
28382838
CollectRecordFields(RD, DefUnit, EltTys, FwdDecl);
2839-
if (CXXDecl && !CGM.getCodeGenOpts().DebugOmitUnreferencedMethods)
2839+
if (CXXDecl)
28402840
CollectCXXMemberFunctions(CXXDecl, DefUnit, EltTys, FwdDecl);
28412841

28422842
LexicalBlockStack.pop_back();

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#include "llvm/ADT/StringExtras.h"
4646
#include "llvm/BinaryFormat/Magic.h"
4747
#include "llvm/Config/llvm-config.h"
48-
#include "llvm/Frontend/Debug/Options.h"
4948
#include "llvm/Object/ObjectFile.h"
5049
#include "llvm/Option/ArgList.h"
5150
#include "llvm/Support/CodeGen.h"
@@ -4643,7 +4642,6 @@ renderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T,
46434642
Args.addOptInFlag(CmdArgs, options::OPT_fforce_dwarf_frame,
46444643
options::OPT_fno_force_dwarf_frame);
46454644

4646-
bool EnableTypeUnits = false;
46474645
if (Args.hasFlag(options::OPT_fdebug_types_section,
46484646
options::OPT_fno_debug_types_section, false)) {
46494647
if (!(T.isOSBinFormatELF() || T.isOSBinFormatWasm())) {
@@ -4654,24 +4652,11 @@ renderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T,
46544652
} else if (checkDebugInfoOption(
46554653
Args.getLastArg(options::OPT_fdebug_types_section), Args, D,
46564654
TC)) {
4657-
EnableTypeUnits = true;
46584655
CmdArgs.push_back("-mllvm");
46594656
CmdArgs.push_back("-generate-type-units");
46604657
}
46614658
}
46624659

4663-
if (const Arg *A =
4664-
Args.getLastArg(options::OPT_gomit_unreferenced_methods,
4665-
options::OPT_gno_omit_unreferenced_methods))
4666-
(void)checkDebugInfoOption(A, Args, D, TC);
4667-
if (Args.hasFlag(options::OPT_gomit_unreferenced_methods,
4668-
options::OPT_gno_omit_unreferenced_methods, false) &&
4669-
(DebugInfoKind == llvm::codegenoptions::DebugInfoConstructor ||
4670-
DebugInfoKind == llvm::codegenoptions::LimitedDebugInfo) &&
4671-
!EnableTypeUnits) {
4672-
CmdArgs.push_back("-gomit-unreferenced-methods");
4673-
}
4674-
46754660
// To avoid join/split of directory+filename, the integrated assembler prefers
46764661
// the directory form of .file on all DWARF versions. GNU as doesn't allow the
46774662
// form before DWARF v5.

clang/test/CodeGenCXX/debug-info-incomplete-types.cpp

Lines changed: 0 additions & 12 deletions
This file was deleted.

clang/test/Driver/debug-options.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,6 @@
242242
// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s
243243
// RUN: %clang -### -c -fdebug-ranges-base-address -fno-debug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s
244244
//
245-
// RUN: %clang -### -c -gomit-unreferenced-methods %s 2>&1 | FileCheck -check-prefix=INCTYPES %s
246-
// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NOINCTYPES %s
247-
// RUN: %clang -### -c -gomit-unreferenced-methods -fdebug-types-section %s 2>&1 | FileCheck -check-prefix=NOINCTYPES %s
248-
// RUN: %clang -### -c -gomit-unreferenced-methods -fstandalone-debug %s 2>&1 | FileCheck -check-prefix=NOINCTYPES %s
249-
//
250245
// RUN: %clang -### -c -glldb %s 2>&1 | FileCheck -check-prefix=NOPUB %s
251246
// RUN: %clang -### -c -glldb -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s
252247
//
@@ -386,9 +381,6 @@
386381
// RNGBSE: -fdebug-ranges-base-address
387382
// NORNGBSE-NOT: -fdebug-ranges-base-address
388383
//
389-
// INCTYPES: -gomit-unreferenced-methods
390-
// NOINCTYPES-NOT: -gomit-unreferenced-methods
391-
//
392384
// GARANGE-DAG: -generate-arange-section
393385
//
394386
// FDTS: "-mllvm" "-generate-type-units"

0 commit comments

Comments
 (0)