14#ifndef LLVM_CLANG_SOURCEMGRADAPTER_H
15#define LLVM_CLANG_SOURCEMGRADAPTER_H
18#include "llvm/ADT/DenseMap.h"
19#include "llvm/Support/SourceMgr.h"
25class DiagnosticsEngine;
38 unsigned ErrorDiagID, WarningDiagID, NoteDiagID;
45 llvm::DenseMap<std::pair<const llvm::SourceMgr *, unsigned>,
FileID>
49 static void handleDiag(
const llvm::SMDiagnostic &
Diag,
void *Context);
55 unsigned ErrorDiagID,
unsigned WarningDiagID,
71 void handleDiag(
const llvm::SMDiagnostic &
Diag);
75 return &SourceMgrAdapter::handleDiag;
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.