This is an archive of the discontinued LLVM Phabricator instance.

Move some function declarations out of WindowsSupport.h
ClosedPublic

Authored by zturner on Jun 1 2018, 3:15 PM.

Details

Summary

The idea behind WindowsSupport.h is that it's in the source directory so that windows.h'isms don't leak out into the larger LLVM project. To that end, any symbol that references a symbol from windows.h must be in this private header, and not in a public header.

However, we had some useful utility functions in WindowsSupport.h which have no dependency on the Windows API, but still only make sense on Windows. Those functions should be usable outside of Support since there is no risk of causing a windows.h leak. Although this introduces some #define logic in some header files, It's not too egregious and it's better than the alternative of duplicating a ton of code.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner created this revision.Jun 1 2018, 3:15 PM
rnk accepted this revision.Jun 1 2018, 3:18 PM

lgtm

llvm/include/llvm/Support/ConvertUTF.h
292 ↗(On Diff #149569)

I guess these are win32 only because wchar_t is unlikely to be the right type on other systems with 32-bit wchars. Sounds good.

This revision is now accepted and ready to land.Jun 1 2018, 3:18 PM
This revision was automatically updated to reflect the committed changes.