diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-05-02 20:14:53 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-05-02 20:14:53 +0000 |
commit | a8304f67291b0182fb64f3afc621615288dd1d31 (patch) | |
tree | c9f100c85b1ab2c22552131d7df3f11a64045d07 /lib/Driver/Tools.cpp | |
parent | 5ddce196cb253ee12a31111a55af532d17ce0402 (diff) |
Driver: Generate an error when trying to pass an LLVM bc input to a
non-Darwin linker (sorry Gold + LTO-plugin users).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index c8622284fc..d79f850f07 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -608,6 +608,7 @@ void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA, const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const { + const Driver &D = getToolChain().getHost().getDriver(); ArgStringList CmdArgs; for (ArgList::const_iterator @@ -660,6 +661,12 @@ void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA, for (InputInfoList::const_iterator it = Inputs.begin(), ie = Inputs.end(); it != ie; ++it) { const InputInfo &II = *it; + + // Don't try to pass LLVM inputs to a generic gcc. + if (II.getType() == types::TY_LLVMBC) + D.Diag(clang::diag::err_drv_no_linker_llvm_support) + << getToolChain().getTripleString().c_str(); + if (types::canTypeBeUserSpecified(II.getType())) { CmdArgs.push_back("-x"); CmdArgs.push_back(types::getTypeName(II.getType())); @@ -1726,8 +1733,8 @@ void freebsd::Link::ConstructJob(Compilation &C, const JobAction &JA, Job &Dest, const InputInfo &Output, const InputInfoList &Inputs, const ArgList &Args, - const char *LinkingOutput) const -{ + const char *LinkingOutput) const { + const Driver &D = getToolChain().getHost().getDriver(); ArgStringList CmdArgs; if (Args.hasArg(options::OPT_static)) { @@ -1778,6 +1785,12 @@ void freebsd::Link::ConstructJob(Compilation &C, const JobAction &JA, for (InputInfoList::const_iterator it = Inputs.begin(), ie = Inputs.end(); it != ie; ++it) { const InputInfo &II = *it; + + // Don't try to pass LLVM inputs to a generic gcc. + if (II.getType() == types::TY_LLVMBC) + D.Diag(clang::diag::err_drv_no_linker_llvm_support) + << getToolChain().getTripleString().c_str(); + if (II.isPipe()) CmdArgs.push_back("-"); else if (II.isFilename()) @@ -1871,6 +1884,7 @@ void dragonfly::Link::ConstructJob(Compilation &C, const JobAction &JA, const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const { + const Driver &D = getToolChain().getHost().getDriver(); ArgStringList CmdArgs; if (Args.hasArg(options::OPT_static)) { @@ -1920,6 +1934,12 @@ void dragonfly::Link::ConstructJob(Compilation &C, const JobAction &JA, for (InputInfoList::const_iterator it = Inputs.begin(), ie = Inputs.end(); it != ie; ++it) { const InputInfo &II = *it; + + // Don't try to pass LLVM inputs to a generic gcc. + if (II.getType() == types::TY_LLVMBC) + D.Diag(clang::diag::err_drv_no_linker_llvm_support) + << getToolChain().getTripleString().c_str(); + if (II.isPipe()) CmdArgs.push_back("-"); else if (II.isFilename()) |