Skip to content

Commit 5f1d4d4

Browse files
author
Vyacheslav Zakharin
committed
[libomptarget][NFC] Use portable printf format specifiers.
Differential Revision: https://reviews.llvm.org/D95476
1 parent 716b9dd commit 5f1d4d4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

openmp/libomptarget/src/omptarget.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,9 @@ static int targetDataNonContiguous(ident_t *loc, DeviceTy &Device,
764764
}
765765
} else {
766766
char *Ptr = (char *)ArgsBase + Offset;
767-
DP("Transfer of non-contiguous : host ptr %lx offset %ld len %ld\n",
768-
(uint64_t)Ptr, Offset, Size);
767+
DP("Transfer of non-contiguous : host ptr " DPxMOD " offset %" PRIu64
768+
" len %" PRIu64 "\n",
769+
DPxPTR(Ptr), Offset, Size);
769770
Ret = targetDataContiguous(loc, Device, ArgsBase, Ptr, Size, ArgType);
770771
}
771772
return Ret;
@@ -894,7 +895,7 @@ uint64_t getLoopTripCount(int64_t DeviceId) {
894895
if (I != Device.LoopTripCnt.end()) {
895896
LoopTripCount = I->second;
896897
Device.LoopTripCnt.erase(I);
897-
DP("loop trip count is %lu.\n", LoopTripCount);
898+
DP("loop trip count is %" PRIu64 ".\n", LoopTripCount);
898899
}
899900
}
900901

openmp/libomptarget/src/private.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ static inline void dumpTargetPointerMappings(const ident_t *Loc,
112112
for (const auto &HostTargetMap : Device.HostDataToTargetMap) {
113113
SourceInfo Info(HostTargetMap.HstPtrName);
114114
INFO(OMP_INFOTYPE_ALL, Device.DeviceID,
115-
DPxMOD " " DPxMOD " %-8lu %-8ld %s at %s:%d:%d\n",
115+
DPxMOD " " DPxMOD " %-8" PRIuPTR " %-8" PRId64 " %s at %s:%d:%d\n",
116116
DPxPTR(HostTargetMap.HstPtrBegin), DPxPTR(HostTargetMap.TgtPtrBegin),
117-
(long unsigned)(HostTargetMap.HstPtrEnd - HostTargetMap.HstPtrBegin),
117+
HostTargetMap.HstPtrEnd - HostTargetMap.HstPtrBegin,
118118
HostTargetMap.getRefCount(), Info.getName(), Info.getFilename(),
119119
Info.getLine(), Info.getColumn());
120120
}
@@ -152,7 +152,7 @@ printKernelArguments(const ident_t *Loc, const int64_t DeviceId,
152152
else
153153
type = "use_address";
154154

155-
INFO(OMP_INFOTYPE_ALL, DeviceId, "%s(%s)[%ld] %s\n", type,
155+
INFO(OMP_INFOTYPE_ALL, DeviceId, "%s(%s)[%" PRId64 "] %s\n", type,
156156
getNameFromMapping(varName).c_str(), ArgSizes[i], implicit);
157157
}
158158
}

0 commit comments

Comments
 (0)