-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSourceManager.h
55 lines (41 loc) · 2.07 KB
/
SourceManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef SOURCE_MANAGER_H
#define SOURCE_MANAGER_H
#include <clang/AST/ASTContext.h>
#include <clang/AST/Expr.h>
#include <clang/Basic/SourceManager.h>
#include <clang/Lex/Lexer.h>
class SourceManager {
public:
static bool IsInHeader(const clang::SourceManager &SM, clang::Decl *D);
static int GetStartingColumn(clang::SourceManager &SM, int Line);
static clang::SourceLocation
FindLocationAfterCond(const clang::SourceManager &SM, clang::Expr *E);
static clang::SourceLocation GetRealLocation(clang::ASTContext *Context,
clang::SourceLocation Loc);
static clang::SourceLocation GetEndOfCond(const clang::SourceManager &SM,
clang::Expr *E);
static clang::SourceLocation GetBeginOfStmt(clang::ASTContext *Context,
clang::Stmt *S);
static clang::SourceLocation GetEndOfStmt(clang::ASTContext *Context,
clang::Stmt *S);
static clang::SourceLocation GetEndLocation(clang::ASTContext *Context,
clang::SourceLocation Loc);
static clang::SourceLocation
GetEndLocationAfter(const clang::SourceManager &SM, clang::SourceRange Range,
char Symbol);
static clang::SourceLocation
GetEndLocationUntil(const clang::SourceManager &SM,
clang::SourceLocation EndLoc,
clang::tok::TokenKind Symbol,
bool Skip = false,
int offs = -1);
static clang::SourceLocation
GetEndLocationFromBegin(const clang::SourceManager &SM,
clang::SourceRange Range);
static llvm::StringRef GetSourceText(const clang::SourceManager &SM,
const clang::SourceLocation &B,
const clang::SourceLocation &E);
static llvm::StringRef GetSourceText(const clang::SourceManager &SM,
const clang::SourceRange &SR);
};
#endif // SOURCE_MANAGER_H