From 36d9d6860d0d2645b8d32366c1e153d7247d7aee Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 8 Dec 2015 02:10:19 +0000 Subject: [PATCH] Replace a bunch of duplicate conditions with the call from types::. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254986 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index eb19a65c64..a73c0863d0 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -215,13 +215,9 @@ static void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, 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(Compilation &C, const JobAction &JA, // 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(Compilation &C, const JobAction &JA, // 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) -- 2.40.0