16using namespace markup;
21 llvm_unreachable(
"ignored");
31 llvm_unreachable(
"Invalid DiagnosticsEngine level!");
46 I = diags.begin(),
E = diags.end();
I !=
E; ++
I) {
52 RI =
D.range_begin(), RE =
D.range_end(); RI != RE; ++RI) {
53 AddFID(FM, Fids,
SM, RI->getBegin());
59 llvm::raw_fd_ostream o(outPath, EC, llvm::sys::fs::OF_TextWithCRLF);
61 llvm::errs() <<
"error: could not create file: " << outPath <<
'\n';
75 EmitString(o <<
" ",
SM.getFileEntryRefForID(FID)->getName()) <<
'\n';
78 " <key>diagnostics</key>\n"
82 DI = diags.begin(), DE = diags.end(); DI != DE; ++DI) {
92 o <<
" <key>description</key>";
94 o <<
" <key>category</key>";
97 o <<
" <key>type</key>";
101 o <<
" <key>location</key>\n";
105 if (!
D.getRanges().empty()) {
106 o <<
" <key>ranges</key>\n";
108 for (
auto &R :
D.getRanges()) {
123 o <<
"</dict>\n</plist>\n";
Defines the clang::FileManager interface and associated types.
static StringRef getLevelName(DiagnosticsEngine::Level Level)
Defines the SourceManager interface.
Represents a character-granular source range.
SourceLocation getLocation() const
Used for handling and querying diagnostic IDs.
static StringRef getCategoryNameFromID(unsigned CategoryID)
Given a category ID, return the name of the category.
static unsigned getCategoryNumberForDiag(unsigned DiagID)
Return the category number that a specified DiagID belongs to, or 0 if no category.
Level
The level of the diagnostic, after it has been through mapping.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
static CharSourceRange getAsCharRange(SourceRange Range, const SourceManager &SM, const LangOptions &LangOpts)
Given a token range, produce a corresponding CharSourceRange that is not a token range.
This class handles loading and caching of source files into memory.
Represents a diagnostic in a form that can be retained until its corresponding source manager is dest...
std::vector< CharSourceRange >::const_iterator range_iterator
void writeARCDiagsToPlist(const std::string &outPath, ArrayRef< StoredDiagnostic > diags, SourceManager &SM, const LangOptions &LangOpts)
void EmitRange(raw_ostream &o, const SourceManager &SM, CharSourceRange R, const FIDMap &FM, unsigned indent)
raw_ostream & EmitString(raw_ostream &o, StringRef s)
unsigned AddFID(FIDMap &FIDs, SmallVectorImpl< FileID > &V, FileID FID)
llvm::DenseMap< FileID, unsigned > FIDMap
raw_ostream & EmitPlistHeader(raw_ostream &o)
void EmitLocation(raw_ostream &o, const SourceManager &SM, SourceLocation L, const FIDMap &FM, unsigned indent)
The JSON file list parser is used to communicate input to InstallAPI.