[AMDGPU] Infer amdgpu-no-flat-scratch-init attribute in AMDGPUAttributor (#94647)
[llvm-project.git] / clang-tools-extra / clang-tidy / utils / Aliasing.h
blob7dad16fc57f1ef98ebaccb3b9e325f83b8ca35dd
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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_ALIASING_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_ALIASING_H
12 #include "clang/AST/Decl.h"
14 namespace clang::tidy::utils {
16 /// Returns whether \p Var has a pointer or reference in \p Func.
17 ///
18 /// Example:
19 /// void f() {
20 /// int n;
21 /// ...
22 /// int *p = &n;
23 /// }
24 ///
25 /// For `f()` and `n` the function returns ``true`` because `p` is a
26 /// pointer to `n` created in `f()`.
28 bool hasPtrOrReferenceInFunc(const Decl *Func, const VarDecl *Var);
30 } // namespace clang::tidy::utils
32 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_ALIASING_H