Skip to content

Commit 8278cae

Browse files
committed
Address review comments
1 parent 96de816 commit 8278cae

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

llvm/lib/Frontend/Offloading/PropertySet.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,18 @@ void llvm::offloading::writePropertiesToJSON(
3737
});
3838
}
3939

40+
// note: createStringError has an overload that takes a format string,
41+
// but it uses llvm::format instead of llvm::formatv, which does
42+
// not work with json::Value. This is a helper function to use
43+
// llvm::formatv with createStringError.
4044
template <typename... Ts> auto createStringErrorV(Ts &&...Args) {
41-
return createStringError(formatv(Args...));
45+
return createStringError(formatv(std::forward<Ts>(Args)...));
4246
}
4347

4448
Expected<PropertyValue>
4549
readPropertyValueFromJSON(const json::Value &PropValueVal) {
46-
if (std::optional<uint64_t> Val = PropValueVal.getAsUINT64()) {
50+
if (std::optional<uint64_t> Val = PropValueVal.getAsUINT64())
4751
return PropertyValue(static_cast<uint32_t>(*Val));
48-
}
4952

5053
if (std::optional<StringRef> Val = PropValueVal.getAsString()) {
5154
std::vector<char> Decoded;

0 commit comments

Comments
 (0)