[clang] 49795d2 - [Driver][NFC] A bit more const for OpenBSD and DragonFly
Brad Smith via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 16 16:11:00 PST 2023
Author: Brad Smith
Date: 2023-11-15T19:36:56-05:00
New Revision: 49795d27761b9f398302354acd30980a319b1502
URL: https://github.com/llvm/llvm-project/commit/49795d27761b9f398302354acd30980a319b1502
DIFF: https://github.com/llvm/llvm-project/commit/49795d27761b9f398302354acd30980a319b1502.diff
LOG: [Driver][NFC] A bit more const for OpenBSD and DragonFly
Added:
Modified:
clang/lib/Driver/ToolChains/DragonFly.cpp
clang/lib/Driver/ToolChains/OpenBSD.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/DragonFly.cpp b/clang/lib/Driver/ToolChains/DragonFly.cpp
index b13449bf778fa9f..9942fc632e0a917 100644
--- a/clang/lib/Driver/ToolChains/DragonFly.cpp
+++ b/clang/lib/Driver/ToolChains/DragonFly.cpp
@@ -57,11 +57,11 @@ void dragonfly::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const auto &ToolChain = static_cast<const DragonFly &>(getToolChain());
const Driver &D = ToolChain.getDriver();
const llvm::Triple::ArchType Arch = ToolChain.getArch();
+ const bool Static = Args.hasArg(options::OPT_static);
+ const bool Shared = Args.hasArg(options::OPT_shared);
+ const bool Profiling = Args.hasArg(options::OPT_pg);
+ const bool Pie = Args.hasArg(options::OPT_pie);
ArgStringList CmdArgs;
- bool Static = Args.hasArg(options::OPT_static);
- bool Shared = Args.hasArg(options::OPT_shared);
- bool Profiling = Args.hasArg(options::OPT_pg);
- bool Pie = Args.hasArg(options::OPT_pie);
if (!D.SysRoot.empty())
CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
diff --git a/clang/lib/Driver/ToolChains/OpenBSD.cpp b/clang/lib/Driver/ToolChains/OpenBSD.cpp
index 5d06cd8ab0bad16..c8f02161d8311e3 100644
--- a/clang/lib/Driver/ToolChains/OpenBSD.cpp
+++ b/clang/lib/Driver/ToolChains/OpenBSD.cpp
@@ -33,9 +33,9 @@ void openbsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const auto &ToolChain = static_cast<const OpenBSD &>(getToolChain());
const Driver &D = ToolChain.getDriver();
const llvm::Triple &Triple = ToolChain.getTriple();
+ ArgStringList CmdArgs;
claimNoWarnArgs(Args);
- ArgStringList CmdArgs;
switch (ToolChain.getArch()) {
case llvm::Triple::x86:
@@ -112,13 +112,13 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const auto &ToolChain = static_cast<const OpenBSD &>(getToolChain());
const Driver &D = ToolChain.getDriver();
const llvm::Triple::ArchType Arch = ToolChain.getArch();
- ArgStringList CmdArgs;
- bool Static = Args.hasArg(options::OPT_static);
- bool Shared = Args.hasArg(options::OPT_shared);
- bool Profiling = Args.hasArg(options::OPT_pg);
- bool Pie = Args.hasArg(options::OPT_pie);
- bool Nopie = Args.hasArg(options::OPT_nopie);
+ const bool Static = Args.hasArg(options::OPT_static);
+ const bool Shared = Args.hasArg(options::OPT_shared);
+ const bool Profiling = Args.hasArg(options::OPT_pg);
+ const bool Pie = Args.hasArg(options::OPT_pie);
+ const bool Nopie = Args.hasArg(options::OPT_nopie);
const bool Relocatable = Args.hasArg(options::OPT_r);
+ ArgStringList CmdArgs;
// Silence warning for "clang -g foo.o -o foo"
Args.ClaimAllArgs(options::OPT_g_Group);
More information about the cfe-commits
mailing list