summaryrefslogtreecommitdiffstats
path: root/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
diff options
context:
space:
mode:
authorJF Bastien <jfbastien@apple.com>2019-07-29 23:12:48 +0000
committerJF Bastien <jfbastien@apple.com>2019-07-29 23:12:48 +0000
commitac8686205b0b05e0ccc92fdf943518f9959cd472 (patch)
tree18c39875c6f79af006a24eec5dd0c1b499984b93 /clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
parent79d117f27ecd3a3508decb990794c648bda7270b (diff)
downloadbcm5719-llvm-ac8686205b0b05e0ccc92fdf943518f9959cd472.tar.gz
bcm5719-llvm-ac8686205b0b05e0ccc92fdf943518f9959cd472.zip
[NFC] avoid AlignedCharArray in clang
As discussed in D65249, don't use AlignedCharArray or std::aligned_storage. Just use alignas(X) char Buf[Size];. This will allow me to remove AlignedCharArray entirely, and works on the current minimum version of Visual Studio. llvm-svn: 367274
Diffstat (limited to 'clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp')
-rw-r--r--clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp b/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
index 6d7d69da4db..114d0815ba4 100644
--- a/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
+++ b/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
@@ -184,10 +184,11 @@ void DirectoryWatcherLinux::InotifyPollingLoop() {
// the inotify file descriptor should have the same alignment as
// struct inotify_event.
- auto ManagedBuffer =
- llvm::make_unique<llvm::AlignedCharArray<alignof(struct inotify_event),
- EventBufferLength>>();
- char *const Buf = ManagedBuffer->buffer;
+ struct Buffer {
+ alignas(struct inotify_event) char buffer[EventBufferLength];
+ };
+ auto ManagedBuffer = llvm::make_unique<Buffer>();
+ char *const Buf = ManagedBuffer.buffer;
const int EpollFD = epoll_create1(EPOLL_CLOEXEC);
if (EpollFD == -1) {
@@ -350,4 +351,4 @@ std::unique_ptr<DirectoryWatcher> clang::DirectoryWatcher::create(
return llvm::make_unique<DirectoryWatcherLinux>(
Path, Receiver, WaitForInitialSync, InotifyFD, InotifyWD,
std::move(*InotifyPollingStopper));
-} \ No newline at end of file
+}
OpenPOWER on IntegriCloud