WithColor.h is one of the most common headers, we can severely reduce its frontend impact (in ClangBuildAnalyzer reports) by removing the bulky CommandLine.h include, forward declaring llvm::cl::OptionCategory and just including raw_ostream.h instead.
#ifndef LLVM_SUPPORT_WITHCOLOR_H
#define LLVM_SUPPORT_WITHCOLOR_H
-#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/raw_ostream.h"
namespace llvm {
class Error;
-class raw_ostream;
class StringRef;
+namespace cl {
+class OptionCategory;
+}
+
extern cl::OptionCategory ColorCategory;
// Symbolic names for various syntax elements.
//===----------------------------------------------------------------------===//
#include "llvm/Support/WithColor.h"
-#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/CommandLine.h"
using namespace llvm;