Skip to content

Commit 0cf42f2

Browse files
authored
[SYCL][NFC] Code cleanup (phase 2) revealed by self build. (#2856)
1 parent f2a91b3 commit 0cf42f2

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,7 +2791,7 @@ bool Driver::checkForOffloadStaticLib(Compilation &C,
27912791
if (Args.hasArg(options::OPT_offload_lib_Group))
27922792
return true;
27932793
SmallVector<const char *, 16> OffloadLibArgs(getLinkerArgs(C, Args));
2794-
for (const StringRef &OLArg : OffloadLibArgs)
2794+
for (StringRef OLArg : OffloadLibArgs)
27952795
if (isStaticArchiveFile(OLArg) && hasOffloadSections(C, OLArg, Args)) {
27962796
// FPGA binaries with AOCX or AOCR sections are not considered fat
27972797
// static archives.
@@ -4443,7 +4443,7 @@ class OffloadingActionBuilder final {
44434443
// incorporated into the aoc compilation
44444444
if (SYCLfpgaTriple) {
44454445
SmallVector<const char *, 16> LinkArgs(getLinkerArgs(C, Args));
4446-
for (const StringRef &LA : LinkArgs) {
4446+
for (StringRef LA : LinkArgs) {
44474447
if (isStaticArchiveFile(LA) && hasOffloadSections(C, LA, Args)) {
44484448
const llvm::opt::OptTable &Opts = C.getDriver().getOpts();
44494449
Arg *InputArg = MakeInputArg(Args, Opts, Args.MakeArgString(LA));
@@ -5124,7 +5124,7 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
51245124
UnbundlerInputs.push_back(Current);
51255125
};
51265126
bool IsWholeArchive = false;
5127-
for (const StringRef &LA : LinkArgs) {
5127+
for (StringRef LA : LinkArgs) {
51285128
if (isStaticArchiveFile(LA)) {
51295129
addUnbundlerInput(
51305130
IsWholeArchive ? types::TY_WholeArchive : types::TY_Archive, LA);

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ class KernelObjVisitor {
816816
template <typename... Tn>
817817
bool handleField(FieldDecl *FD, QualType FDTy, Tn &&... tn) {
818818
bool result = true;
819-
std::initializer_list<int>{(result = result && tn(FD, FDTy), 0)...};
819+
(void)std::initializer_list<int>{(result = result && tn(FD, FDTy), 0)...};
820820
return result;
821821
}
822822
template <typename... Tn>

llvm/lib/Support/PropertySetIO.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ PropertyValue &PropertyValue::operator=(PropertyValue &&P) {
182182

183183
PropertyValue &PropertyValue::operator=(const PropertyValue &P) {
184184
if (P.getType() == BYTE_ARRAY)
185-
*this =
186-
std::move(PropertyValue(P.asByteArray(), P.getByteArraySizeInBits()));
185+
*this = PropertyValue(P.asByteArray(), P.getByteArraySizeInBits());
187186
else
188187
copy(P);
189188
return *this;

llvm/lib/Support/SimpleTable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Error SimpleTable::addColumn(const Twine &Title, ArrayRef<std::string> Cells) {
7676
if (!Rows.empty() && (Rows.size() != N))
7777
return makeError("column size mismatch for " + Title);
7878
if (Error Err = addColumnName(Title.str()))
79-
return std::move(Err);
79+
return Err;
8080
if (Rows.empty()) {
8181
Rows.resize(Cells.size());
8282
for (auto &R : Rows)
@@ -114,7 +114,7 @@ Error SimpleTable::renameColumn(StringRef OldName, StringRef NewName) {
114114

115115
if (I < 0)
116116
return makeError("column not found: " + OldName);
117-
*ColumnNum2Name[I] = std::move(NewName.str());
117+
*ColumnNum2Name[I] = NewName.str();
118118
ColumnName2Num.erase(OldName);
119119
ColumnName2Num[StringRef(*ColumnNum2Name[I])] = I;
120120
return Error::success();

sycl/include/CL/sycl/detail/pi.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ template <typename T> inline void print(T val) {
176176
std::cout << "<unknown> : " << val << std::endl;
177177
}
178178

179+
template <typename Ret, typename... Args>
180+
inline void print(Ret (*val)(Args...)) {
181+
std::cout << "<FuncPtr>" << reinterpret_cast<const void *>(val) << std::endl;
182+
}
183+
179184
template <> inline void print<>(PiPlatform val) {
180185
std::cout << "pi_platform : " << val << std::endl;
181186
}

0 commit comments

Comments
 (0)