Skip to content

Commit 7ad6667

Browse files
committed
Revert 741978d and things that landed on top of it.
741978d made clang produce output that's 2x as large at least in sanitizer builds. https://reviews.llvm.org/D83892#2470185 has a standalone repro. This reverts the following commits: Revert "[clang][cli] Port CodeGenOpts simple string flags to new option parsing system" This reverts commit 95d3cc6. Revert "[clang][cli] Port LangOpts simple string based options to new option parsing system" This reverts commit aec2991. Revert "[clang][cli] Streamline MarshallingInfoFlag description" This reverts commit 27b7d64. Revert "[clang][cli] Port LangOpts option flags to new option parsing system" This reverts commit 383778e. Revert "[clang][cli] Port CodeGen option flags to new option parsing system" This reverts commit 741978d.
1 parent 631501b commit 7ad6667

File tree

7 files changed

+1295
-885
lines changed

7 files changed

+1295
-885
lines changed

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ namespace clang {
3030
/// Bitfields of CodeGenOptions, split out from CodeGenOptions to ensure
3131
/// that this large collection of bitfields is a trivial class type.
3232
class CodeGenOptionsBase {
33-
friend class CompilerInvocation;
34-
3533
public:
3634
#define CODEGENOPT(Name, Bits, Default) unsigned Name : Bits;
3735
#define ENUM_CODEGENOPT(Name, Type, Bits, Default)

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ def err_drv_invalid_thread_model_for_target : Error<
8686
"invalid thread model '%0' in '%1' for this target">;
8787
def err_drv_invalid_linker_name : Error<
8888
"invalid linker name in argument '%0'">;
89+
def err_drv_invalid_pgo_instrumentor : Error<
90+
"invalid PGO instrumentor in argument '%0'">;
8991
def err_drv_invalid_rtlib_name : Error<
9092
"invalid runtime library name in argument '%0'">;
9193
def err_drv_unsupported_rtlib_for_platform : Error<

clang/include/clang/Basic/DiagnosticFrontendKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ def err_fe_action_not_available : Error<
108108
"action %0 not compiled in">;
109109
def err_fe_invalid_alignment : Error<
110110
"invalid value '%1' in '%0'; alignment must be a power of 2">;
111+
def err_fe_invalid_wchar_type
112+
: Error<"invalid wchar_t type '%0'; must be one of 'char', 'short', 'int'">;
111113
def err_fe_invalid_exception_model
112114
: Error<"invalid exception model '%select{none|dwarf|sjlj|arm|seh|wasm|aix}0' for target '%1'">;
113115
def warn_fe_concepts_ts_flag : Warning<

clang/include/clang/Driver/Options.td

Lines changed: 522 additions & 835 deletions
Large diffs are not rendered by default.

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 765 additions & 41 deletions
Large diffs are not rendered by default.

clang/test/Profile/c-generate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88
// PROF-INSTR-NONE-NOT: __llvm_prf
99
//
10-
// PROF-INSTR-GARBAGE: invalid value 'garbage' in '-fprofile-instrument=garbage'
10+
// PROF-INSTR-GARBAGE: invalid PGO instrumentor in argument '-fprofile-instrument=garbage'
1111

1212
int main(void) {
1313
return 0;

llvm/include/llvm/Option/OptParser.td

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,6 @@ class MarshallingInfoFlag<code keypath, code defaultvalue = "false">
179179
code Denormalizer = "denormalizeSimpleFlag";
180180
}
181181

182-
class MarshallingInfoNegativeFlag<code keypath, code defaultvalue = "true">
183-
: MarshallingInfo<keypath, defaultvalue> {
184-
code Normalizer = "normalizeSimpleNegativeFlag";
185-
code Denormalizer = "denormalizeSimpleFlag";
186-
}
187-
188182
class MarshallingInfoBitfieldFlag<code keypath, code value>
189183
: MarshallingInfoFlag<keypath, "0u"> {
190184
code Normalizer = "makeFlagToValueNormalizer("#value#")";
@@ -202,6 +196,9 @@ class MarshallingInfoBooleanFlag<code keypath, code defaultvalue, code value, co
202196

203197
// Mixins for additional marshalling attributes.
204198

199+
class IsNegative {
200+
code Normalizer = "normalizeSimpleNegativeFlag";
201+
}
205202
class AlwaysEmit { bit ShouldAlwaysEmit = true; }
206203
class Normalizer<code normalizer> { code Normalizer = normalizer; }
207204
class Denormalizer<code denormalizer> { code Denormalizer = denormalizer; }

0 commit comments

Comments
 (0)