clang-tools
5.0.0
Main Page
Namespaces
Classes
Files
File List
File Members
llvm.src
tools
clang
tools
extra
clang-tidy
utils
ASTUtils.h
Go to the documentation of this file.
1
//===---------- ASTUtils.h - clang-tidy -----------------------------------===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ASTUTILS_H
11
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ASTUTILS_H
12
13
#include "clang/AST/AST.h"
14
15
namespace
clang {
16
namespace
tidy {
17
namespace
utils {
18
// Returns the (closest) Function declaration surrounding |Statement| or NULL.
19
const
FunctionDecl *
getSurroundingFunction
(ASTContext &
Context
,
20
const
Stmt &Statement);
21
// Determine whether Expr is a Binary or Ternary expression.
22
bool
IsBinaryOrTernary
(
const
Expr *E);
23
24
/// Checks whether a macro flag is present in the given argument. Only considers
25
/// cases of single match or match in a binary OR expression. For example,
26
/// <needed-flag> or <flag> | <needed-flag> | ...
27
bool
exprHasBitFlagWithSpelling
(
const
Expr *Flags,
const
SourceManager &
SM
,
28
const
LangOptions &
LangOpts
,
29
StringRef FlagName);
30
}
// namespace utils
31
}
// namespace tidy
32
}
// namespace clang
33
34
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ASTUTILS_H
clang::tidy::utils::IsBinaryOrTernary
bool IsBinaryOrTernary(const Expr *E)
Definition:
ASTUtils.cpp:28
LangOpts
LangOptions LangOpts
Definition:
ClangTidy.cpp:253
clang::tidy::utils::exprHasBitFlagWithSpelling
bool exprHasBitFlagWithSpelling(const Expr *Flags, const SourceManager &SM, const LangOptions &LangOpts, StringRef FlagName)
Checks whether a macro flag is present in the given argument.
Definition:
ASTUtils.cpp:43
SM
SourceManager & SM
Definition:
IncludeOrderCheck.cpp:48
clang::tidy::utils::getSurroundingFunction
const FunctionDecl * getSurroundingFunction(ASTContext &Context, const Stmt &Statement)
Definition:
ASTUtils.cpp:21
Context
ClangTidyContext & Context
Definition:
ClangTidy.cpp:87
Generated on Tue Sep 5 2017 11:44:54 for clang-tools by
1.8.6