clang-tools
11.0.0
clang-tools-extra
clang-tidy
utils
Aliasing.h
Go to the documentation of this file.
1
//===------------- Aliasing.h - clang-tidy --------------------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_ALIASING_H
10
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_ALIASING_H
11
12
#include "clang/AST/Decl.h"
13
14
namespace
clang
{
15
namespace
tidy {
16
namespace
utils {
17
18
/// Returns whether \p Var has a pointer or reference in \p Func.
19
///
20
/// Example:
21
/// void f() {
22
/// int n;
23
/// ...
24
/// int *p = &n;
25
/// }
26
///
27
/// For `f()` and `n` the function returns ``true`` because `p` is a
28
/// pointer to `n` created in `f()`.
29
30
bool
hasPtrOrReferenceInFunc
(
const
FunctionDecl *Func,
const
VarDecl *Var);
31
32
}
// namespace utils
33
}
// namespace tidy
34
}
// namespace clang
35
36
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_ALIASING_H
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition:
ApplyReplacements.h:27
clang::tidy::utils::hasPtrOrReferenceInFunc
bool hasPtrOrReferenceInFunc(const FunctionDecl *Func, const VarDecl *Var)
Returns whether Var has a pointer or reference in Func.
Definition:
Aliasing.cpp:59
Generated on Tue Jul 28 2020 16:14:00 for clang-tools by
1.8.16