forked from OSchip/llvm-project
Provide common include for all diagnostic headers.
Reviewed by Ted Kremenek. llvm-svn: 150616
This commit is contained in:
parent
a8cafe23e3
commit
af90ec11e1
|
@ -0,0 +1,39 @@
|
||||||
|
//===--- AllDiagnostics.h - Aggregate Diagnostic headers --------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
//
|
||||||
|
// This file includes all the separate Diagnostic headers & some related
|
||||||
|
// helpers.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef LLVM_CLANG_ALL_DIAGNOSTICS_H
|
||||||
|
#define LLVM_CLANG_ALL_DIAGNOSTICS_H
|
||||||
|
|
||||||
|
#include "clang/AST/ASTDiagnostic.h"
|
||||||
|
#include "clang/Analysis/AnalysisDiagnostic.h"
|
||||||
|
#include "clang/Driver/DriverDiagnostic.h"
|
||||||
|
#include "clang/Frontend/FrontendDiagnostic.h"
|
||||||
|
#include "clang/Lex/LexDiagnostic.h"
|
||||||
|
#include "clang/Parse/ParseDiagnostic.h"
|
||||||
|
#include "clang/Sema/SemaDiagnostic.h"
|
||||||
|
#include "clang/Serialization/SerializationDiagnostic.h"
|
||||||
|
|
||||||
|
namespace clang {
|
||||||
|
template <size_t SizeOfStr, typename FieldType>
|
||||||
|
class StringSizerHelper {
|
||||||
|
char FIELD_TOO_SMALL[SizeOfStr <= FieldType(~0U) ? 1 : -1];
|
||||||
|
public:
|
||||||
|
enum { Size = SizeOfStr };
|
||||||
|
};
|
||||||
|
} // end namespace clang
|
||||||
|
|
||||||
|
#define STR_SIZE(str, fieldTy) clang::StringSizerHelper<sizeof(str)-1, \
|
||||||
|
fieldTy>::Size
|
||||||
|
|
||||||
|
#endif
|
|
@ -11,17 +11,10 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "clang/AST/ASTDiagnostic.h"
|
|
||||||
#include "clang/Analysis/AnalysisDiagnostic.h"
|
|
||||||
#include "clang/Basic/DiagnosticIDs.h"
|
#include "clang/Basic/DiagnosticIDs.h"
|
||||||
|
#include "clang/Basic/AllDiagnostics.h"
|
||||||
#include "clang/Basic/DiagnosticCategories.h"
|
#include "clang/Basic/DiagnosticCategories.h"
|
||||||
#include "clang/Basic/SourceManager.h"
|
#include "clang/Basic/SourceManager.h"
|
||||||
#include "clang/Driver/DriverDiagnostic.h"
|
|
||||||
#include "clang/Frontend/FrontendDiagnostic.h"
|
|
||||||
#include "clang/Lex/LexDiagnostic.h"
|
|
||||||
#include "clang/Parse/ParseDiagnostic.h"
|
|
||||||
#include "clang/Sema/SemaDiagnostic.h"
|
|
||||||
#include "clang/Serialization/SerializationDiagnostic.h"
|
|
||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
|
|
||||||
|
@ -70,17 +63,8 @@ struct StaticDiagInfoRec {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <size_t SizeOfStr, typename FieldType>
|
|
||||||
class StringSizerHelper {
|
|
||||||
char FIELD_TOO_SMALL[SizeOfStr <= FieldType(~0U) ? 1 : -1];
|
|
||||||
public:
|
|
||||||
enum { Size = SizeOfStr };
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace anonymous
|
} // namespace anonymous
|
||||||
|
|
||||||
#define STR_SIZE(str, fieldTy) StringSizerHelper<sizeof(str)-1, fieldTy>::Size
|
|
||||||
|
|
||||||
static const StaticDiagInfoRec StaticDiagInfo[] = {
|
static const StaticDiagInfoRec StaticDiagInfo[] = {
|
||||||
#define DIAG(ENUM,CLASS,DEFAULT_MAPPING,DESC,GROUP, \
|
#define DIAG(ENUM,CLASS,DEFAULT_MAPPING,DESC,GROUP, \
|
||||||
SFINAE,ACCESS,NOWERROR,SHOWINSYSHEADER, \
|
SFINAE,ACCESS,NOWERROR,SHOWINSYSHEADER, \
|
||||||
|
|
|
@ -17,13 +17,7 @@
|
||||||
#include "llvm/Support/Format.h"
|
#include "llvm/Support/Format.h"
|
||||||
#include "llvm/ADT/StringMap.h"
|
#include "llvm/ADT/StringMap.h"
|
||||||
#include "clang/AST/ASTDiagnostic.h"
|
#include "clang/AST/ASTDiagnostic.h"
|
||||||
#include "clang/Analysis/AnalysisDiagnostic.h"
|
#include "clang/Basic/AllDiagnostics.h"
|
||||||
#include "clang/Driver/DriverDiagnostic.h"
|
|
||||||
#include "clang/Frontend/FrontendDiagnostic.h"
|
|
||||||
#include "clang/Lex/LexDiagnostic.h"
|
|
||||||
#include "clang/Parse/ParseDiagnostic.h"
|
|
||||||
#include "clang/Sema/SemaDiagnostic.h"
|
|
||||||
#include "clang/Serialization/SerializationDiagnostic.h"
|
|
||||||
|
|
||||||
DEF_DIAGTOOL("list-warnings",
|
DEF_DIAGTOOL("list-warnings",
|
||||||
"List warnings and their corresponding flags",
|
"List warnings and their corresponding flags",
|
||||||
|
@ -31,18 +25,6 @@ DEF_DIAGTOOL("list-warnings",
|
||||||
|
|
||||||
using namespace clang;
|
using namespace clang;
|
||||||
|
|
||||||
namespace {
|
|
||||||
template <size_t SizeOfStr, typename FieldType>
|
|
||||||
class StringSizerHelper {
|
|
||||||
char FIELD_TOO_SMALL[SizeOfStr <= FieldType(~0U) ? 1 : -1];
|
|
||||||
public:
|
|
||||||
enum { Size = SizeOfStr };
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace anonymous
|
|
||||||
|
|
||||||
#define STR_SIZE(str, fieldTy) StringSizerHelper<sizeof(str)-1, fieldTy>::Size
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct StaticDiagNameIndexRec {
|
struct StaticDiagNameIndexRec {
|
||||||
const char *NameStr;
|
const char *NameStr;
|
||||||
|
|
Loading…
Reference in New Issue