Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:22

0001 //===------------- Aliasing.h - clang-tidy --------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_ALIASING_H
0010 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_ALIASING_H
0011 
0012 #include "clang/AST/Decl.h"
0013 
0014 namespace clang::tidy::utils {
0015 
0016 /// Returns whether \p Var has a pointer or reference in \p Func.
0017 ///
0018 /// Example:
0019 /// void f() {
0020 ///   int n;
0021 ///   ...
0022 ///   int *p = &n;
0023 /// }
0024 ///
0025 /// For `f()` and `n` the function returns ``true`` because `p` is a
0026 /// pointer to `n` created in `f()`.
0027 
0028 bool hasPtrOrReferenceInFunc(const Decl *Func, const VarDecl *Var);
0029 
0030 } // namespace clang::tidy::utils
0031 
0032 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_ALIASING_H