[PATCH] D48859: Make WindowsSupport.h a public header

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 2 17:32:36 PDT 2018


zturner created this revision.
zturner added reviewers: Bigcheese, aaron.ballman, probinson.
Herald added a subscriber: hiraditya.

I sort of hesitate to do this, but I honestly don't have a better solution.  Currently `WindowsSupport.h` is kept private by putting it in `llvm\lib\Support\Windows` so that it's only available to use from within the support library itself, and only from implementation files.

However, it's not just the thing that sets up and invokes `#include <windows.h>`, it also has various utility functions and classes that wrap Windows specific types (e.g. a `ScopedHandle`).  It would be nice to be able to share this kind of thing across other sub-projects and/or libraries (basically, anything not `Support`) when they have to invoke some platform specific code and end up needing the same thing.  It would be nice if LLVM had some means of exposing platform specific utility functions, classes, and helpers in the same way that it exposes platform-independent ones.

The alternative is to just copy the stuff I need from `WindowsSupport.h` into another project-specific header.  This would duplicate some code, but I won't blame anyone if they think that's better than making this header public.


https://reviews.llvm.org/D48859

Files:
  llvm/include/llvm/Support/WindowsSupport.h
  llvm/lib/Support/CrashRecoveryContext.cpp
  llvm/lib/Support/InitLLVM.cpp
  llvm/lib/Support/RandomNumberGenerator.cpp
  llvm/lib/Support/Windows/WindowsSupport.h
  llvm/lib/Support/raw_ostream.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48859.153830.patch
Type: text/x-patch
Size: 5804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180703/74c295c6/attachment.bin>


More information about the llvm-commits mailing list