Skip to content

Commit 2ba1295

Browse files
committed
[Orc] Remove some reinterpret casts in debugging output.
These casts were from function pointer to data pointer type, which some compilers (including GCC) may warn about. In all cases where these casts were used the original value was still available as a TargetAddress (uint64_t), so we can just print a formatted version of that instead. llvm-svn: 257932
1 parent 8801145 commit 2ba1295

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,7 @@ class OrcRemoteTargetServer : public OrcRemoteTargetRPCAPI {
191191
IntVoidFnTy Fn =
192192
reinterpret_cast<IntVoidFnTy>(static_cast<uintptr_t>(Addr));
193193

194-
DEBUG(dbgs() << " Calling "
195-
<< reinterpret_cast<void *>(reinterpret_cast<intptr_t>(Fn))
196-
<< "\n");
194+
DEBUG(dbgs() << " Calling " << format("0x%016x", Addr) << "\n");
197195
int Result = Fn();
198196
DEBUG(dbgs() << " Result = " << Result << "\n");
199197

@@ -212,7 +210,7 @@ class OrcRemoteTargetServer : public OrcRemoteTargetRPCAPI {
212210
for (auto &Arg : Args)
213211
ArgV[Idx++] = Arg.c_str();
214212

215-
DEBUG(dbgs() << " Calling " << reinterpret_cast<void *>(Fn) << "\n");
213+
DEBUG(dbgs() << " Calling " << format("0x%016x", Addr) << "\n");
216214
int Result = Fn(ArgC, ArgV.get());
217215
DEBUG(dbgs() << " Result = " << Result << "\n");
218216

@@ -224,7 +222,7 @@ class OrcRemoteTargetServer : public OrcRemoteTargetRPCAPI {
224222
VoidVoidFnTy Fn =
225223
reinterpret_cast<VoidVoidFnTy>(static_cast<uintptr_t>(Addr));
226224

227-
DEBUG(dbgs() << " Calling " << reinterpret_cast<void *>(Fn) << "\n");
225+
DEBUG(dbgs() << " Calling " << format("0x%016x", Addr) << "\n");
228226
Fn();
229227
DEBUG(dbgs() << " Complete.\n");
230228

@@ -375,7 +373,7 @@ class OrcRemoteTargetServer : public OrcRemoteTargetRPCAPI {
375373
char *Src = reinterpret_cast<char *>(static_cast<uintptr_t>(RSrc));
376374

377375
DEBUG(dbgs() << " Reading " << Size << " bytes from "
378-
<< static_cast<void *>(Src) << "\n");
376+
<< format("0x%016x", RSrc) << "\n");
379377

380378
if (auto EC = call<ReadMemResponse>(Channel))
381379
return EC;

0 commit comments

Comments
 (0)