This is an archive of the discontinued LLVM Phabricator instance.

[JITLink] Minor fix to avoid Windows compiler warning for static-cast
ClosedPublic

Authored by dstuttard on Apr 8 2021, 2:41 AM.

Details

Summary

Change-Id: Id0c1d5535b53e2aebe314151c0efa585e763f3f6

Diff Detail

Event Timeline

dstuttard created this revision.Apr 8 2021, 2:41 AM
dstuttard requested review of this revision.Apr 8 2021, 2:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2021, 2:41 AM

Windows builds give a warning without this change

foad accepted this revision.Apr 30 2021, 2:56 AM
foad added a subscriber: foad.

LGTM. The warning is still showing up in Windows buildbots e.g. https://lab.llvm.org/buildbot/#/builders/86/builds/12569

C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm-project\llvm\lib\ExecutionEngine\JITLink\x86_64.cpp(60): warning C4309: 'static_cast': truncation of constant value

As an alternative I think you could write just char(0xFF). Both approaches have been used in the past according to git log --grep "truncation of constant value"

This revision is now accepted and ready to land.Apr 30 2021, 2:56 AM