[clang] 6dd094d - [Driver][OpenBSD] Use Arch reference instead of getArch(). NFC
Brad Smith via cfe-commits
cfe-commits at lists.llvm.org
Sat Jun 18 15:14:55 PDT 2022
Author: Brad Smith
Date: 2022-06-18T18:11:15-04:00
New Revision: 6dd094dd435d09872687c1bdcce6845f70cf25cc
URL: https://github.com/llvm/llvm-project/commit/6dd094dd435d09872687c1bdcce6845f70cf25cc
DIFF: https://github.com/llvm/llvm-project/commit/6dd094dd435d09872687c1bdcce6845f70cf25cc.diff
LOG: [Driver][OpenBSD] Use Arch reference instead of getArch(). NFC
Added:
Modified:
clang/lib/Driver/ToolChains/OpenBSD.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/OpenBSD.cpp b/clang/lib/Driver/ToolChains/OpenBSD.cpp
index 92b91ed9d7f4..62c430b66e5f 100644
--- a/clang/lib/Driver/ToolChains/OpenBSD.cpp
+++ b/clang/lib/Driver/ToolChains/OpenBSD.cpp
@@ -113,6 +113,7 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const toolchains::OpenBSD &ToolChain =
static_cast<const toolchains::OpenBSD &>(getToolChain());
const Driver &D = ToolChain.getDriver();
+ const llvm::Triple::ArchType Arch = ToolChain.getArch();
ArgStringList CmdArgs;
// Silence warning for "clang -g foo.o -o foo"
@@ -126,9 +127,9 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
if (!D.SysRoot.empty())
CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
- if (ToolChain.getArch() == llvm::Triple::mips64)
+ if (Arch == llvm::Triple::mips64)
CmdArgs.push_back("-EB");
- else if (ToolChain.getArch() == llvm::Triple::mips64el)
+ else if (Arch == llvm::Triple::mips64el)
CmdArgs.push_back("-EL");
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_shared)) {
@@ -156,7 +157,7 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
if (Args.hasArg(options::OPT_nopie) || Args.hasArg(options::OPT_pg))
CmdArgs.push_back("-nopie");
- if (ToolChain.getArch() == llvm::Triple::riscv64)
+ if (Arch == llvm::Triple::riscv64)
CmdArgs.push_back("-X");
if (Output.isFilename()) {
More information about the cfe-commits
mailing list