Skip to content

Commit 24ffd3e

Browse files
committed
Fixed printing code to be cleaner
1 parent 30b99de commit 24ffd3e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,18 +1857,16 @@ NVPTX::Scope NVPTXScopes::operator[](SyncScope::ID ID) const {
18571857
scopeName = name->str();
18581858

18591859
// Build list of supported syncscopes programmatically
1860-
std::string supportedScopes;
1860+
SmallVector<StringRef> supportedScopes;
18611861
for (const auto &Entry : Scopes) {
1862-
if (!supportedScopes.empty())
1863-
supportedScopes += ", ";
18641862
if (auto name = Context->getSyncScopeName(Entry.first))
1865-
supportedScopes += name->empty() ? "<empty string>" : name->str();
1863+
supportedScopes.push_back(name->empty() ? "<empty string>" : *name);
18661864
}
18671865

18681866
reportFatalUsageError(
18691867
formatv("NVPTX backend does not support syncscope \"{0}\" (ID={1}).\n"
18701868
"Supported syncscopes are: {2}.",
1871-
scopeName, int(ID), supportedScopes));
1869+
scopeName, int(ID), llvm::join(supportedScopes, ", ")));
18721870
}
18731871
return S->second;
18741872
}

0 commit comments

Comments
 (0)