Skip to content

Commit 0e378b1

Browse files
committed
Driver: Replace Option::ForwardToGCC by Option::DriverOption (which
matches the flag in Options.def). llvm-svn: 67679
1 parent 24e7ead commit 0e378b1

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

clang/include/clang/Driver/Option.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ namespace driver {
8282
/// Always render this option joined with its value.
8383
bool ForceJoinedRender : 1;
8484

85-
/// Forward to generic GCC tools.
86-
bool ForwardToGCC : 1;
85+
/// This option is only for consumed by the driver.
86+
bool DriverOption : 1;
8787

8888
protected:
8989
Option(OptionClass Kind, options::ID ID, const char *Name,
@@ -112,8 +112,10 @@ namespace driver {
112112
bool hasForceJoinedRender() const { return ForceJoinedRender; }
113113
void setForceJoinedRender(bool Value) { ForceJoinedRender = Value; }
114114

115-
bool hasForwardToGCC() const { return ForwardToGCC; }
116-
void setForwardToGCC(bool Value) { ForwardToGCC = Value; }
115+
bool isDriverOption() const { return DriverOption; }
116+
void setDriverOption(bool Value) { DriverOption = Value; }
117+
118+
bool hasForwardToGCC() const { return !DriverOption && !LinkerInput; }
117119

118120
/// getUnaliasedOption - Return the final option this option
119121
/// aliases (itself, if the option has no alias).

clang/lib/Driver/OptTable.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,13 @@ Option *OptTable::constructOption(options::ID id) const {
185185
case 'S':
186186
assert(info.Kind == Option::JoinedClass && "Invalid option.");
187187
Opt->setForceSeparateRender(true); break;
188-
case 'd': Opt->setForwardToGCC(false); break;
188+
case 'd': Opt->setDriverOption(true); break;
189189
case 'i': Opt->setNoOptAsInput(true); break;
190190
case 'l': Opt->setLinkerInput(true); break;
191191
case 'u': Opt->setUnsupported(true); break;
192192
}
193193
}
194194

195-
// Linker inputs shouldn't be forwarded to GCC as arguments (they
196-
// will, however, be forwarded as inputs).
197-
if (Opt->isLinkerInput())
198-
Opt->setForwardToGCC(false);
199-
200195
return Opt;
201196
}
202197

clang/lib/Driver/Option.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Option::Option(OptionClass _Kind, options::ID _ID, const char *_Name,
2121
: Kind(_Kind), ID(_ID), Name(_Name), Group(_Group), Alias(_Alias),
2222
Unsupported(false), LinkerInput(false), NoOptAsInput(false),
2323
ForceSeparateRender(false), ForceJoinedRender(false),
24-
ForwardToGCC(true)
24+
DriverOption(false)
2525
{
2626

2727
// Multi-level aliases are not supported, and alias options cannot

0 commit comments

Comments
 (0)