aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/OptTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Driver/OptTable.cpp')
-rw-r--r--lib/Driver/OptTable.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/Driver/OptTable.cpp b/lib/Driver/OptTable.cpp
index 54e5ee1b6a..7b7e2a7bbc 100644
--- a/lib/Driver/OptTable.cpp
+++ b/lib/Driver/OptTable.cpp
@@ -29,7 +29,7 @@ struct Info {
static Info OptionInfos[] = {
// The InputOption info
- { "<input>", "", Option::InputClass, OPT_INVALID, OPT_INVALID, 0 },
+ { "<input>", "d", Option::InputClass, OPT_INVALID, OPT_INVALID, 0 },
// The UnknownOption info
{ "<unknown>", "", Option::UnknownClass, OPT_INVALID, OPT_INVALID, 0 },
@@ -107,14 +107,24 @@ Option *OptTable::constructOption(options::ID id) const {
for (const char *s = info.Flags; *s; ++s) {
switch (*s) {
default: assert(0 && "Invalid option flag.");
- case 'J': Opt->setForceJoinedRender(true); break;
- case 'S': Opt->setForceSeparateRender(true); break;
+ case 'J':
+ assert(info.Kind == Option::SeparateClass && "Invalid option.");
+ Opt->setForceJoinedRender(true); break;
+ case 'S':
+ assert(info.Kind == Option::JoinedClass && "Invalid option.");
+ Opt->setForceSeparateRender(true); break;
+ case 'd': Opt->setForwardToGCC(false); break;
case 'i': Opt->setNoOptAsInput(true); break;
case 'l': Opt->setLinkerInput(true); break;
case 'u': Opt->setUnsupported(true); break;
}
}
+ // Linker inputs shouldn't be forwarded to GCC as arguments (they
+ // will, however, be forwarded as inputs).
+ if (Opt->isLinkerInput())
+ Opt->setForwardToGCC(false);
+
return Opt;
}