aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-07 23:51:44 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-07 23:51:44 +0000
commit82d00688525c876bf47bce414dedae9c343e67f5 (patch)
tree5f5ee364f2d5cac08debec937dc72947e8429f20 /lib/Driver/Tools.cpp
parent93a259500186fa7270f66cb460c5f5728e5680ae (diff)
Driver: Fix forwarding of -fpascal-strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index a3cea95c26..f44be0a7be 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -410,27 +410,24 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-fblocks=0");
}
- // -fno-pascal-strings is default, only pass non-default.
+ // -fno-pascal-strings is default, only pass non-default. If the
+ // -tool chain happened to translate to -mpascal-strings, we want to
+ // -back translate here.
+ //
+ // FIXME: This is gross; that translation should be pulled from the
+ // tool chain.
if (Args.hasFlag(options::OPT_fpascal_strings,
- options::OPT_fno_pascal_strings))
+ options::OPT_fno_pascal_strings,
+ false) ||
+ Args.hasFlag(options::OPT_mpascal_strings,
+ options::OPT_mno_pascal_strings,
+ false))
CmdArgs.push_back("-fpascal-strings");
// -fcommon is default, only pass non-default.
if (!Args.hasFlag(options::OPT_fcommon, options::OPT_fno_common))
CmdArgs.push_back("-fno-common");
- // If tool chain translates fpascal-strings, we want to back
- // translate here.
- // FIXME: This is gross; that translation should be pulled from the
- // tool chain.
- if (Arg *A = Args.getLastArg(options::OPT_mpascal_strings,
- options::OPT_mno_pascal_strings)) {
- if (A->getOption().matches(options::OPT_mpascal_strings))
- CmdArgs.push_back("-fpascal-strings");
- else
- CmdArgs.push_back("-fno-pascal-strings");
- }
-
Args.AddLastArg(CmdArgs, options::OPT_dM);
// Add -Wp, and -Xassembler if using the preprocessor.