15 using namespace clang;
16 using namespace arcmt;
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";
124 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)
void EmitLocation(raw_ostream &o, const SourceManager &SM, SourceLocation L, const FIDMap &FM, unsigned indent)
Defines the clang::FileManager interface and associated types.
range_iterator range_begin() const
Defines the SourceManager interface.
Represents a diagnostic in a form that can be retained until its corresponding source manager is dest...
range_iterator range_end() const
static StringRef getCategoryNameFromID(unsigned CategoryID)
Given a category ID, return the name of the category.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
ArrayRef< CharSourceRange > getRanges() const
StringRef getMessage() const
static StringRef getLevelName(DiagnosticsEngine::Level Level)
Represents a character-granular source range.
DiagnosticsEngine::Level getLevel() const
const FileEntry * getFileEntryForID(FileID FID) const
Returns the FileEntry record for the provided FileID.
void writeARCDiagsToPlist(const std::string &outPath, ArrayRef< StoredDiagnostic > diags, SourceManager &SM, const LangOptions &LangOpts)
llvm::DenseMap< FileID, unsigned > FIDMap
StringRef getName() const
raw_ostream & EmitPlistHeader(raw_ostream &o)
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Dataflow Directional Tag Classes.
const FullSourceLoc & getLocation() 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.
CharSourceRange getExpansionRange(SourceLocation Loc) const
Given a SourceLocation object, return the range of tokens covered by the expansion in the ultimate fi...
raw_ostream & EmitString(raw_ostream &o, StringRef s)
Level
The level of the diagnostic, after it has been through mapping.
std::vector< CharSourceRange >::const_iterator range_iterator
This class handles loading and caching of source files into memory.