Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / tools / lldb-dap / OutputRedirector.h
blobdba51016775bf452c83c6a7f0c3a636a31c0b842
1 //===-- OutputRedirector.h -------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===/
9 #ifndef LLDB_TOOLS_LLDB_DAP_OUTPUT_REDIRECTOR_H
10 #define LLDB_TOOLS_LLDB_DAP_OUTPUT_REDIRECTOR_H
12 #include <thread>
14 #include "llvm/ADT/StringRef.h"
15 #include "llvm/Support/Error.h"
17 namespace lldb_dap {
19 /// Redirects the output of a given file descriptor to a callback.
20 ///
21 /// \return
22 /// \a Error::success if the redirection was set up correctly, or an error
23 /// otherwise.
24 llvm::Error RedirectFd(int fd, std::function<void(llvm::StringRef)> callback);
26 } // namespace lldb_dap
28 #endif // LLDB_TOOLS_LLDB_DAP_OUTPUT_REDIRECTOR_H