15#ifndef LLVM_CLANG_BASIC_ATOMICLINELOGGER_H
16#define LLVM_CLANG_BASIC_ATOMICLINELOGGER_H
19#include "llvm/ADT/SmallString.h"
20#include "llvm/Support/raw_ostream.h"
30 std::optional<llvm::raw_svector_ostream> FormattingOS;
32 std::atomic<uint64_t> *DroppedLines =
nullptr;
34 explicit LogLine(
int FD, std::atomic<uint64_t> *DroppedLines);
51 template <
typename RangeT>
52 void logArray(StringRef Prefix, StringRef Sep,
const RangeT &Arr) {
54 *FormattingOS << Prefix;
55 for (
const auto &
C : Arr)
56 *FormattingOS << Sep <<
C;
64 std::atomic<int> FD{-1};
66 std::atomic<uint64_t> DroppedLines{0};
68 enum class LogPathSource {
73 LogPathSource PathSource = LogPathSource::None;
75 void initialize(StringRef LogFilePath);
92 bool enable(StringRef RequestedLogPath);
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
bool enable(StringRef RequestedLogPath)
Enables the logger if it is not already enabled.
AtomicLineLogger(AtomicLineLogger &&)=delete
AtomicLineLogger & operator=(AtomicLineLogger &&)=delete
StringRef getLogPath() const
LogLine(const LogLine &)=delete
LogLine & operator<<(const T &Val)
void logArray(StringRef Prefix, StringRef Sep, const RangeT &Arr)
friend class AtomicLineLogger
LogLine & operator=(const LogLine &)=delete
LogLine & operator=(LogLine &&)=delete
Top level wrappers for InstallAPI frontend operations.
const FunctionProtoType * T
@ Other
Other implicit parameter.