aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-18 08:01:15 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-18 08:01:15 +0000
commit6d954d788925e6b80077ef379c8eeb028cc31d0e (patch)
tree900ad3dd113cfdccffcf0500449f378a9adba774 /lib/Driver
parent871adcf4e41285e3f4c3b62eaa1b2e05b60b92da (diff)
Driver: Add "d" flag to Options.def for options which are completely
handled by driver. - This is not very precise, we use it to drive the "forward-to-gcc" predicate, when trying to talk to a generic gcc tool. - Slightly better than what ccc was doing, and should be good enough. Platforms which want a robust driver should implement a proper tool chain. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67181 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver')
-rw-r--r--lib/Driver/OptTable.cpp16
-rw-r--r--lib/Driver/Option.cpp3
2 files changed, 15 insertions, 4 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;
}
diff --git a/lib/Driver/Option.cpp b/lib/Driver/Option.cpp
index 503b54d8fe..12d501b3cb 100644
--- a/lib/Driver/Option.cpp
+++ b/lib/Driver/Option.cpp
@@ -20,7 +20,8 @@ Option::Option(OptionClass _Kind, options::ID _ID, const char *_Name,
const OptionGroup *_Group, const Option *_Alias)
: Kind(_Kind), ID(_ID), Name(_Name), Group(_Group), Alias(_Alias),
Unsupported(false), LinkerInput(false), NoOptAsInput(false),
- ForceSeparateRender(false), ForceJoinedRender(false)
+ ForceSeparateRender(false), ForceJoinedRender(false),
+ ForwardToGCC(true)
{
// Multi-level aliases are not supported, and alias options cannot