clang: include/clang/Basic/SourceMgrAdapter.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_CLANG_SOURCEMGRADAPTER_H
15#define LLVM_CLANG_SOURCEMGRADAPTER_H
16
18#include "llvm/ADT/DenseMap.h"
19#include "llvm/Support/SourceMgr.h"
20#include
21#include
22
24
25class DiagnosticsEngine;
26class FileEntry;
27
28
29
31
33
34
36
37
38 unsigned ErrorDiagID, WarningDiagID, NoteDiagID;
39
40
42
43
44
45 llvm::DenseMap<std::pair<const llvm::SourceMgr *, unsigned>, FileID>
46 FileIDMapping;
47
48
49 static void handleDiag(const llvm::SMDiagnostic &Diag, void *Context);
50
51public:
52
53
55 unsigned ErrorDiagID, unsigned WarningDiagID,
56 unsigned NoteDiagID,
58
60
61
62
64 llvm::SMLoc Loc);
65
66
67
69
70
71 void handleDiag(const llvm::SMDiagnostic &Diag);
72
73
75 return &SourceMgrAdapter::handleDiag;
76 }
77
78
79
81};
82
83}
84
85#endif
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
Defines the SourceManager interface.
Concrete class used by the front-end to report problems and issues.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Encodes a location in the source.
This class handles loading and caching of source files into memory.
An adapter that can be used to translate diagnostics from one or more llvm::SourceMgr instances to a ...
llvm::SourceMgr::DiagHandlerTy getDiagHandler()
Retrieve the diagnostic handler to use with the underlying SourceMgr.
SourceLocation mapLocation(const llvm::SourceMgr &LLVMSrcMgr, llvm::SMLoc Loc)
Map a source location in the given LLVM source manager to its corresponding location in the Clang sou...
void * getDiagContext()
Retrieve the context to use with the diagnostic handler produced by getDiagHandler().
SourceRange mapRange(const llvm::SourceMgr &LLVMSrcMgr, llvm::SMRange Range)
Map a source range in the given LLVM source manager to its corresponding range in the Clang source ma...
A trivial tuple used to represent a source range.
The JSON file list parser is used to communicate input to InstallAPI.