Skip to content

[SYCL][NFC] Code cleanup (phase 2) revealed by self build. #2856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2791,7 +2791,7 @@ bool Driver::checkForOffloadStaticLib(Compilation &C,
if (Args.hasArg(options::OPT_offload_lib_Group))
return true;
SmallVector<const char *, 16> OffloadLibArgs(getLinkerArgs(C, Args));
for (const StringRef &OLArg : OffloadLibArgs)
for (StringRef OLArg : OffloadLibArgs)
if (isStaticArchiveFile(OLArg) && hasOffloadSections(C, OLArg, Args)) {
// FPGA binaries with AOCX or AOCR sections are not considered fat
// static archives.
Expand Down Expand Up @@ -4443,7 +4443,7 @@ class OffloadingActionBuilder final {
// incorporated into the aoc compilation
if (SYCLfpgaTriple) {
SmallVector<const char *, 16> LinkArgs(getLinkerArgs(C, Args));
for (const StringRef &LA : LinkArgs) {
for (StringRef LA : LinkArgs) {
if (isStaticArchiveFile(LA) && hasOffloadSections(C, LA, Args)) {
const llvm::opt::OptTable &Opts = C.getDriver().getOpts();
Arg *InputArg = MakeInputArg(Args, Opts, Args.MakeArgString(LA));
Expand Down Expand Up @@ -5124,7 +5124,7 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
UnbundlerInputs.push_back(Current);
};
bool IsWholeArchive = false;
for (const StringRef &LA : LinkArgs) {
for (StringRef LA : LinkArgs) {
if (isStaticArchiveFile(LA)) {
addUnbundlerInput(
IsWholeArchive ? types::TY_WholeArchive : types::TY_Archive, LA);
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaSYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ class KernelObjVisitor {
template <typename... Tn>
bool handleField(FieldDecl *FD, QualType FDTy, Tn &&... tn) {
bool result = true;
std::initializer_list<int>{(result = result && tn(FD, FDTy), 0)...};
(void)std::initializer_list<int>{(result = result && tn(FD, FDTy), 0)...};
return result;
}
template <typename... Tn>
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Support/PropertySetIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ PropertyValue &PropertyValue::operator=(PropertyValue &&P) {

PropertyValue &PropertyValue::operator=(const PropertyValue &P) {
if (P.getType() == BYTE_ARRAY)
*this =
std::move(PropertyValue(P.asByteArray(), P.getByteArraySizeInBits()));
*this = PropertyValue(P.asByteArray(), P.getByteArraySizeInBits());
else
copy(P);
return *this;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Support/SimpleTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Error SimpleTable::addColumn(const Twine &Title, ArrayRef<std::string> Cells) {
if (!Rows.empty() && (Rows.size() != N))
return makeError("column size mismatch for " + Title);
if (Error Err = addColumnName(Title.str()))
return std::move(Err);
return Err;
if (Rows.empty()) {
Rows.resize(Cells.size());
for (auto &R : Rows)
Expand Down Expand Up @@ -114,7 +114,7 @@ Error SimpleTable::renameColumn(StringRef OldName, StringRef NewName) {

if (I < 0)
return makeError("column not found: " + OldName);
*ColumnNum2Name[I] = std::move(NewName.str());
*ColumnNum2Name[I] = NewName.str();
ColumnName2Num.erase(OldName);
ColumnName2Num[StringRef(*ColumnNum2Name[I])] = I;
return Error::success();
Expand Down
5 changes: 5 additions & 0 deletions sycl/include/CL/sycl/detail/pi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ template <typename T> inline void print(T val) {
std::cout << "<unknown> : " << val << std::endl;
}

template <typename Ret, typename... Args>
inline void print(Ret (*val)(Args...)) {
std::cout << "<FuncPtr>" << reinterpret_cast<const void *>(val) << std::endl;
}

template <> inline void print<>(PiPlatform val) {
std::cout << "pi_platform : " << val << std::endl;
}
Expand Down