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 | e3e263fb713faa3c4511943476c8f1fb1e672efc (patch) | |
| tree | ec05dd0fe0cefefd83660af0a7f79b8c62384cb4 /clang/lib/Driver | |
| parent | 10c6ee968f51612b20117389804e6170e7feb507 (diff) | |
| download | bcm5719-llvm-e3e263fb713faa3c4511943476c8f1fb1e672efc.tar.gz bcm5719-llvm-e3e263fb713faa3c4511943476c8f1fb1e672efc.zip | |
Driver: Generate an error when trying to pass an LLVM bc input to a
non-Darwin linker (sorry Gold + LTO-plugin users).
llvm-svn: 70641
Diffstat (limited to 'clang/lib/Driver')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index c8622284fc2..d79f850f072 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/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()) |

