Skip to content

Commit ece7bff

Browse files
committed
Fix formatting
1 parent 53972e3 commit ece7bff

File tree

16 files changed

+122
-171
lines changed

16 files changed

+122
-171
lines changed

clang-tools-extra/clangd/CompileCommands.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
267267
IndicesToDrop.push_back(Input->getIndex());
268268
}
269269
// Anything after `--` is also treated as input, drop them as well.
270-
if (auto *DashDash =
271-
ArgList.getLastArgNoClaim(options::OPT__DASH_DASH)) {
270+
if (auto *DashDash = ArgList.getLastArgNoClaim(options::OPT__DASH_DASH)) {
272271
auto DashDashIndex = DashDash->getIndex() + 1; // +1 accounts for Cmd[0]
273272
// Another +1 so we don't treat the `--` itself as an input.
274273
for (unsigned I = DashDashIndex + 1; I < Cmd.size(); ++I)

clang/include/clang/Frontend/Utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
#include "clang/Basic/Diagnostic.h"
1717
#include "clang/Basic/LLVM.h"
18-
#include "clang/Options/OptionUtils.h"
1918
#include "clang/Frontend/DependencyOutputOptions.h"
19+
#include "clang/Options/OptionUtils.h"
2020
#include "llvm/ADT/ArrayRef.h"
2121
#include "llvm/ADT/IntrusiveRefCntPtr.h"
2222
#include "llvm/ADT/StringMap.h"

clang/lib/Driver/ToolChains/AIX.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ void aix::Linker::ConstructJob(Compilation &C, const JobAction &JA,
168168
Args.hasArg(options::OPT_coverage))
169169
CmdArgs.push_back("-bdbg:namedsects:ss");
170170

171-
if (Arg *A =
172-
Args.getLastArg(options::OPT_mxcoff_build_id_EQ)) {
171+
if (Arg *A = Args.getLastArg(options::OPT_mxcoff_build_id_EQ)) {
173172
StringRef BuildId = A->getValue();
174173
if (BuildId[0] != '0' || BuildId[1] != 'x' ||
175174
BuildId.find_if_not(llvm::isHexDigit, 2) != StringRef::npos)

clang/lib/Driver/ToolChains/AMDGPU.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -323,22 +323,19 @@ RocmInstallationDetector::RocmInstallationDetector(
323323
: D(D) {
324324
Verbose = Args.hasArg(options::OPT_v);
325325
RocmPathArg = Args.getLastArgValue(options::OPT_rocm_path_EQ);
326-
PrintROCmSearchDirs =
327-
Args.hasArg(options::OPT_print_rocm_search_dirs);
326+
PrintROCmSearchDirs = Args.hasArg(options::OPT_print_rocm_search_dirs);
328327
RocmDeviceLibPathArg =
329328
Args.getAllArgValues(options::OPT_rocm_device_lib_path_EQ);
330329
HIPPathArg = Args.getLastArgValue(options::OPT_hip_path_EQ);
331-
HIPStdParPathArg =
332-
Args.getLastArgValue(options::OPT_hipstdpar_path_EQ);
330+
HIPStdParPathArg = Args.getLastArgValue(options::OPT_hipstdpar_path_EQ);
333331
HasHIPStdParLibrary =
334332
!HIPStdParPathArg.empty() && D.getVFS().exists(HIPStdParPathArg +
335333
"/hipstdpar_lib.hpp");
336334
HIPRocThrustPathArg =
337-
Args.getLastArgValue(options::OPT_hipstdpar_thrust_path_EQ);
335+
Args.getLastArgValue(options::OPT_hipstdpar_thrust_path_EQ);
338336
HasRocThrustLibrary = !HIPRocThrustPathArg.empty() &&
339337
D.getVFS().exists(HIPRocThrustPathArg + "/thrust");
340-
HIPRocPrimPathArg =
341-
Args.getLastArgValue(options::OPT_hipstdpar_prim_path_EQ);
338+
HIPRocPrimPathArg = Args.getLastArgValue(options::OPT_hipstdpar_prim_path_EQ);
342339
HasRocPrimLibrary = !HIPRocPrimPathArg.empty() &&
343340
D.getVFS().exists(HIPRocPrimPathArg + "/rocprim");
344341

clang/lib/Driver/ToolChains/Arch/LoongArch.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ void loongarch::getLoongArchTargetFeatures(const Driver &D,
130130
const ArgList &Args,
131131
std::vector<StringRef> &Features) {
132132
// Enable the `lsx` feature on 64-bit LoongArch by default.
133-
if (Triple.isLoongArch64() &&
134-
(!Args.hasArgNoClaim(options::OPT_march_EQ)))
133+
if (Triple.isLoongArch64() && (!Args.hasArgNoClaim(options::OPT_march_EQ)))
135134
Features.push_back("+lsx");
136135

137136
// -mrelax is default, unless -mno-relax is specified.

clang/lib/Driver/ToolChains/Arch/Mips.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ void mips::getMipsCPUAndABI(const ArgList &Args, const llvm::Triple &Triple,
4949
DefMips64CPU = "mips3";
5050
}
5151

52-
if (Arg *A = Args.getLastArg(options::OPT_march_EQ,
53-
options::OPT_mcpu_EQ))
52+
if (Arg *A = Args.getLastArg(options::OPT_march_EQ, options::OPT_mcpu_EQ))
5453
CPUName = A->getValue();
5554

5655
if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) {

clang/lib/Driver/ToolChains/Arch/SystemZ.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ systemz::FloatABI systemz::getSystemZFloatABI(const Driver &D,
2525
D.Diag(diag::err_drv_unsupported_opt)
2626
<< Args.getLastArg(options::OPT_mfloat_abi_EQ)->getAsString(Args);
2727

28-
if (Arg *A = Args.getLastArg(options::OPT_msoft_float,
29-
options::OPT_mhard_float))
28+
if (Arg *A =
29+
Args.getLastArg(options::OPT_msoft_float, options::OPT_mhard_float))
3030
if (A->getOption().matches(options::OPT_msoft_float))
3131
ABI = systemz::FloatABI::Soft;
3232

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,8 +2173,7 @@ void Clang::AddX86TargetArgs(const ArgList &Args,
21732173

21742174
// Default to "generic" unless -march is present or targetting the PS4/PS5.
21752175
std::string TuneCPU;
2176-
if (!Args.hasArg(options::OPT_march_EQ) &&
2177-
!getToolChain().getTriple().isPS())
2176+
if (!Args.hasArg(options::OPT_march_EQ) && !getToolChain().getTriple().isPS())
21782177
TuneCPU = "generic";
21792178

21802179
// Override based on -mtune.

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ using namespace llvm::opt;
6969

7070
static bool useFramePointerForTargetByDefault(const llvm::opt::ArgList &Args,
7171
const llvm::Triple &Triple) {
72-
if (Args.hasArg(options::OPT_pg) &&
73-
!Args.hasArg(options::OPT_mfentry))
72+
if (Args.hasArg(options::OPT_pg) && !Args.hasArg(options::OPT_mfentry))
7473
return true;
7574

7675
if (Triple.isAndroid())
@@ -249,17 +248,16 @@ getFramePointerKind(const llvm::opt::ArgList &Args,
249248
// without requiring new frame records to be created.
250249

251250
bool DefaultFP = useFramePointerForTargetByDefault(Args, Triple);
252-
bool EnableFP =
253-
mustUseNonLeafFramePointerForTarget(Triple) ||
254-
Args.hasFlag(options::OPT_fno_omit_frame_pointer,
255-
options::OPT_fomit_frame_pointer, DefaultFP);
251+
bool EnableFP = mustUseNonLeafFramePointerForTarget(Triple) ||
252+
Args.hasFlag(options::OPT_fno_omit_frame_pointer,
253+
options::OPT_fomit_frame_pointer, DefaultFP);
256254

257255
bool DefaultLeafFP =
258256
useLeafFramePointerForTargetByDefault(Triple) ||
259257
(EnableFP && framePointerImpliesLeafFramePointer(Args, Triple));
260-
bool EnableLeafFP = Args.hasFlag(
261-
options::OPT_mno_omit_leaf_frame_pointer,
262-
options::OPT_momit_leaf_frame_pointer, DefaultLeafFP);
258+
bool EnableLeafFP =
259+
Args.hasFlag(options::OPT_mno_omit_leaf_frame_pointer,
260+
options::OPT_momit_leaf_frame_pointer, DefaultLeafFP);
263261

264262
bool FPRegReserved = EnableFP || mustMaintainValidFrameChain(Args, Triple);
265263

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,8 +2111,7 @@ void Generic_GCC::GCCInstallationDetector::init(
21112111
CandidateBiarchTripleAliases);
21122112

21132113
// If --gcc-install-dir= is specified, skip filesystem detection.
2114-
if (const Arg *A =
2115-
Args.getLastArg(options::OPT_gcc_install_dir_EQ);
2114+
if (const Arg *A = Args.getLastArg(options::OPT_gcc_install_dir_EQ);
21162115
A && A->getValue()[0]) {
21172116
StringRef InstallDir = A->getValue();
21182117
if (!ScanGCCForMultilibs(TargetTriple, Args, InstallDir, false)) {
@@ -2135,8 +2134,7 @@ void Generic_GCC::GCCInstallationDetector::init(
21352134

21362135
// If --gcc-triple is specified use this instead of trying to
21372136
// auto-detect a triple.
2138-
if (const Arg *A =
2139-
Args.getLastArg(options::OPT_gcc_triple_EQ)) {
2137+
if (const Arg *A = Args.getLastArg(options::OPT_gcc_triple_EQ)) {
21402138
StringRef GCCTriple = A->getValue();
21412139
CandidateTripleAliases.clear();
21422140
CandidateTripleAliases.push_back(GCCTriple);

0 commit comments

Comments
 (0)