diff options
Diffstat (limited to 'lib/Driver/ToolChains/MipsLinux.cpp')
-rw-r--r-- | lib/Driver/ToolChains/MipsLinux.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/lib/Driver/ToolChains/MipsLinux.cpp b/lib/Driver/ToolChains/MipsLinux.cpp index 9f23996b76..cfda7f4bb4 100644 --- a/lib/Driver/ToolChains/MipsLinux.cpp +++ b/lib/Driver/ToolChains/MipsLinux.cpp @@ -1,9 +1,8 @@ -//===--- Mips.cpp - Mips ToolChain Implementations --------------*- C++ -*-===// +//===-- MipsLinux.cpp - Mips ToolChain Implementations ----------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -119,11 +118,23 @@ void MipsLLVMToolChain::AddCXXStdlibLibArgs(const ArgList &Args, std::string MipsLLVMToolChain::getCompilerRT(const ArgList &Args, StringRef Component, - bool Shared) const { + FileType Type) const { SmallString<128> Path(getDriver().ResourceDir); llvm::sys::path::append(Path, SelectedMultilib.osSuffix(), "lib" + LibSuffix, getOS()); - llvm::sys::path::append(Path, Twine("libclang_rt." + Component + "-" + - "mips" + (Shared ? ".so" : ".a"))); + const char *Suffix; + switch (Type) { + case ToolChain::FT_Object: + Suffix = ".o"; + break; + case ToolChain::FT_Static: + Suffix = ".a"; + break; + case ToolChain::FT_Shared: + Suffix = ".so"; + break; + } + llvm::sys::path::append( + Path, Twine("libclang_rt." + Component + "-" + "mips" + Suffix)); return Path.str(); } |