Skip to content

Commit bdcb90a

Browse files
author
Martin Wehking
committed
Refactor by applying LLVM style consistently
1 parent 84497b0 commit bdcb90a

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
214214

215215
// For NVPTX and AMDGCN we only use one single bitcode library and ignore
216216
// manually specified SYCL device libraries.
217-
bool ignore_single_libs = TargetTriple.isNVPTX() || TargetTriple.isAMDGCN();
217+
bool IgnoreSingleLibs = TargetTriple.isNVPTX() || TargetTriple.isAMDGCN();
218218

219219
struct DeviceLibOptInfo {
220220
StringRef DeviceLibName;
@@ -237,13 +237,13 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
237237
if (A->getOption().matches(options::OPT_fno_sycl_device_lib_EQ))
238238
NoDeviceLibs = true;
239239

240-
bool printUnusedLibWarning = false;
240+
bool PrintUnusedLibWarning = false;
241241
for (StringRef Val : A->getValues()) {
242242
if (Val == "all") {
243243
for (const auto &K : DeviceLibLinkInfo.keys())
244-
DeviceLibLinkInfo[K] = (!ignore_single_libs && !NoDeviceLibs) ||
244+
DeviceLibLinkInfo[K] = (!IgnoreSingleLibs && !NoDeviceLibs) ||
245245
(K == "internal" && NoDeviceLibs);
246-
printUnusedLibWarning = false;
246+
PrintUnusedLibWarning = false;
247247
break;
248248
}
249249
auto LinkInfoIter = DeviceLibLinkInfo.find(Val);
@@ -254,23 +254,22 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
254254
C.getDriver().Diag(diag::err_drv_unsupported_option_argument)
255255
<< A->getSpelling() << Val;
256256
}
257-
DeviceLibLinkInfo[Val] = true && !NoDeviceLibs && !ignore_single_libs;
258-
printUnusedLibWarning = ignore_single_libs && !NoDeviceLibs && true;
257+
DeviceLibLinkInfo[Val] = !NoDeviceLibs && !IgnoreSingleLibs;
258+
PrintUnusedLibWarning = IgnoreSingleLibs && !NoDeviceLibs && true;
259259
}
260-
if (printUnusedLibWarning)
260+
if (PrintUnusedLibWarning)
261261
C.getDriver().Diag(diag::warn_ignored_clang_option)
262262
<< A->getSpelling() << A->getAsString(Args);
263263
}
264264
}
265265

266-
if (TargetTriple.isNVPTX() && !NoDeviceLibs) {
266+
if (TargetTriple.isNVPTX() && !NoDeviceLibs)
267267
LibraryList.push_back(Args.MakeArgString("devicelib--cuda.bc"));
268-
}
269-
if (TargetTriple.isAMDGCN() && !NoDeviceLibs) {
268+
269+
if (TargetTriple.isAMDGCN() && !NoDeviceLibs)
270270
LibraryList.push_back(Args.MakeArgString("devicelib--amd.bc"));
271-
}
272271

273-
if (ignore_single_libs && !NoDeviceLibs)
272+
if (IgnoreSingleLibs && !NoDeviceLibs)
274273
return LibraryList;
275274

276275
using SYCLDeviceLibsList = SmallVector<DeviceLibOptInfo, 5>;
@@ -326,8 +325,8 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
326325
C.getDefaultToolChain().getTriple().isWindowsMSVCEnvironment();
327326
bool IsNewOffload = C.getDriver().getUseNewOffloadingDriver();
328327
StringRef LibSuffix = ".bc";
329-
if ((TargetTriple.isSPIR() &&
330-
TargetTriple.getSubArch() == llvm::Triple::SPIRSubArch_fpga))
328+
if (TargetTriple.isSPIR() &&
329+
TargetTriple.getSubArch() == llvm::Triple::SPIRSubArch_fpga)
331330
// For FPGA, we are unbundling objects.
332331
LibSuffix = IsWindowsMSVCEnv ? ".obj" : ".o";
333332
if (IsNewOffload)

0 commit comments

Comments
 (0)