15 using namespace clang;
16 using namespace arcmt;
17 using namespace markup;
22 llvm_unreachable(
"ignored");
32 llvm_unreachable(
"Invalid DiagnosticsEngine level!");
47 I = diags.begin(), E = diags.end(); I != E; ++I) {
54 AddFID(FM, Fids, SM, RI->getBegin());
55 AddFID(FM, Fids, SM, RI->getEnd());
60 llvm::raw_fd_ostream o(outPath, EC, llvm::sys::fs::F_Text);
62 llvm::errs() <<
"error: could not create file: " << outPath <<
'\n';
79 " <key>diagnostics</key>\n"
83 DI = diags.begin(), DE = diags.end(); DI != DE; ++DI) {
93 o <<
" <key>description</key>";
95 o <<
" <key>category</key>";
98 o <<
" <key>type</key>";
102 o <<
" <key>location</key>\n";
107 o <<
" <key>ranges</key>\n";
125 o <<
"</dict>\n</plist>";
static unsigned getCategoryNumberForDiag(unsigned DiagID)
Return the category number that a specified DiagID belongs to, or 0 if no category.
void AddFID(FIDMap &FIDs, SmallVectorImpl< FileID > &V, const SourceManager &SM, SourceLocation L)
std::vector< CharSourceRange >::const_iterator range_iterator
void EmitLocation(raw_ostream &o, const SourceManager &SM, SourceLocation L, const FIDMap &FM, unsigned indent)
Defines the clang::FileManager interface and associated types.
Defines the SourceManager interface.
StringRef getMessage() const
Represents a diagnostic in a form that can be retained until its corresponding source manager is dest...
const FullSourceLoc & getLocation() const
static StringRef getCategoryNameFromID(unsigned CategoryID)
Given a category ID, return the name of the category.
std::pair< SourceLocation, SourceLocation > getExpansionRange(SourceLocation Loc) const
Given a SourceLocation object, return the range of tokens covered by the expansion in the ultimate fi...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
const FileEntry * getFileEntryForID(FileID FID) const
Returns the FileEntry record for the provided FileID.
static StringRef getLevelName(DiagnosticsEngine::Level Level)
Represents a character-granular source range.
range_iterator range_begin() const
void writeARCDiagsToPlist(const std::string &outPath, ArrayRef< StoredDiagnostic > diags, SourceManager &SM, const LangOptions &LangOpts)
const char * getName() const
llvm::DenseMap< FileID, unsigned > FIDMap
raw_ostream & EmitPlistHeader(raw_ostream &o)
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
range_iterator range_end() const
Used for handling and querying diagnostic IDs.
void EmitRange(raw_ostream &o, const SourceManager &SM, CharSourceRange R, const FIDMap &FM, unsigned indent)
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 allows the source range to be used by components that don't have access to the lexer and thus can't find the end of the range for themselves.
ArrayRef< CharSourceRange > getRanges() const
raw_ostream & EmitString(raw_ostream &o, StringRef s)
Level
The level of the diagnostic, after it has been through mapping.
DiagnosticsEngine::Level getLevel() const
This class handles loading and caching of source files into memory.