r254986 - Replace a bunch of duplicate conditions with the call from types::.
Eric Christopher via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 7 18:10:19 PST 2015
Author: echristo
Date: Mon Dec 7 20:10:19 2015
New Revision: 254986
URL: http://llvm.org/viewvc/llvm-project?rev=254986&view=rev
Log:
Replace a bunch of duplicate conditions with the call from types::.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=254986&r1=254985&r2=254986&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Dec 7 20:10:19 2015
@@ -215,13 +215,9 @@ static void AddLinkerInputs(const ToolCh
Args.AddAllArgValues(CmdArgs, options::OPT_Zlinker_input);
for (const auto &II : Inputs) {
- if (!TC.HasNativeLLVMSupport()) {
+ if (!TC.HasNativeLLVMSupport() && types::isLLVMIR(II.getType()))
// Don't try to pass LLVM inputs unless we have native support.
- if (II.getType() == types::TY_LLVM_IR ||
- II.getType() == types::TY_LTO_IR ||
- II.getType() == types::TY_LLVM_BC || II.getType() == types::TY_LTO_BC)
- D.Diag(diag::err_drv_no_linker_llvm_support) << TC.getTripleString();
- }
+ D.Diag(diag::err_drv_no_linker_llvm_support) << TC.getTripleString();
// Add filenames immediately.
if (II.isFilename()) {
@@ -5975,8 +5971,7 @@ void gcc::Common::ConstructJob(Compilati
// inputs into '-Wl,' options?
for (const auto &II : Inputs) {
// Don't try to pass LLVM or AST inputs to a generic gcc.
- if (II.getType() == types::TY_LLVM_IR || II.getType() == types::TY_LTO_IR ||
- II.getType() == types::TY_LLVM_BC || II.getType() == types::TY_LTO_BC)
+ if (types::isLLVMIR(II.getType()))
D.Diag(diag::err_drv_no_linker_llvm_support)
<< getToolChain().getTripleString();
else if (II.getType() == types::TY_AST)
@@ -6094,8 +6089,7 @@ void hexagon::Assembler::ConstructJob(Co
// inputs into '-Wl,' options?
for (const auto &II : Inputs) {
// Don't try to pass LLVM or AST inputs to a generic gcc.
- if (II.getType() == types::TY_LLVM_IR || II.getType() == types::TY_LTO_IR ||
- II.getType() == types::TY_LLVM_BC || II.getType() == types::TY_LTO_BC)
+ if (types::isLLVMIR(II.getType()))
D.Diag(clang::diag::err_drv_no_linker_llvm_support)
<< getToolChain().getTripleString();
else if (II.getType() == types::TY_AST)
More information about the cfe-commits
mailing list