diff options
author | James Molloy <james.molloy@arm.com> | 2012-05-02 07:56:14 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2012-05-02 07:56:14 +0000 |
commit | 8049c44d972fc7266b4369e8960875c118c067e0 (patch) | |
tree | 5d76699fadf73404ff04e06b60a84efea26a8236 /lib/Driver/Tools.cpp | |
parent | 3ecafe4d7d8f45da616be2ffef998c851dfb7b6b (diff) |
Fix forwarding of -fpack-struct from driver to CC1, and add a test.
-fpack-struct's handling has changed in CC1 (one of only two flags that needed changing) because the driver treats "-fpack-struct" as a boolean flag, and CC1 (did) treat it as an option with a separated value.
This change causes -fpack-struct=X to be forwarded correctly to -fpack-struct=X instead of erroneously to "-fpack-struct X"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155981 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 13d9820159..2cf0c6747c 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2500,12 +2500,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // Honor -fpack-struct= and -fpack-struct, if given. Note that // -fno-pack-struct doesn't apply to -fpack-struct=. if (Arg *A = Args.getLastArg(options::OPT_fpack_struct_EQ)) { - CmdArgs.push_back("-fpack-struct"); - CmdArgs.push_back(A->getValue(Args)); + std::string PackStructStr = "-fpack-struct="; + PackStructStr += A->getValue(Args); + CmdArgs.push_back(Args.MakeArgString(PackStructStr)); } else if (Args.hasFlag(options::OPT_fpack_struct, options::OPT_fno_pack_struct, false)) { - CmdArgs.push_back("-fpack-struct"); - CmdArgs.push_back("1"); + CmdArgs.push_back("-fpack-struct=1"); } if (Args.hasArg(options::OPT_mkernel) || |