@@ -221,7 +221,7 @@ std::optional<std::string> NVPTXSerializer::findTool(StringRef tool) {
221
221
// 1. Check the toolkit path given in the command line.
222
222
StringRef pathRef = targetOptions.getToolkitPath ();
223
223
SmallVector<char , 256 > path;
224
- if (pathRef.size ()) {
224
+ if (! pathRef.empty ()) {
225
225
path.insert (path.begin (), pathRef.begin (), pathRef.end ());
226
226
llvm::sys::path::append (path, " bin" , tool);
227
227
if (llvm::sys::fs::can_execute (path))
@@ -236,7 +236,7 @@ std::optional<std::string> NVPTXSerializer::findTool(StringRef tool) {
236
236
// 3. Check `getCUDAToolkitPath()`.
237
237
pathRef = getCUDAToolkitPath ();
238
238
path.clear ();
239
- if (pathRef.size ()) {
239
+ if (! pathRef.empty ()) {
240
240
path.insert (path.begin (), pathRef.begin (), pathRef.end ());
241
241
llvm::sys::path::append (path, " bin" , tool);
242
242
if (llvm::sys::fs::can_execute (path))
@@ -411,7 +411,7 @@ NVPTXSerializer::compileToBinary(const std::string &ptxCode) {
411
411
LLVM_DEBUG ({
412
412
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> logBuffer =
413
413
llvm::MemoryBuffer::getFile (logFile->first );
414
- if (logBuffer && (*logBuffer)->getBuffer ().size ()) {
414
+ if (logBuffer && ! (*logBuffer)->getBuffer ().empty ()) {
415
415
llvm::dbgs () << " Output:\n " << (*logBuffer)->getBuffer () << " \n " ;
416
416
llvm::dbgs ().flush ();
417
417
}
0 commit comments