summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-modernize/UseNullptr/NullptrMatchers.h
blob: b6b686859a6ec46fbabad689d5ca01cb879875e8 (plain)
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
//===-- UseNullptr/NullptrMatchers.h - Matchers for null casts --*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief This file contains the declarations for matcher-generating functions
/// and names for bound nodes found by AST matchers.
///
//===----------------------------------------------------------------------===//

#ifndef CPP11_MIGRATE_USE_NULLPTR_MATCHERS_H
#define CPP11_MIGRATE_USE_NULLPTR_MATCHERS_H

#include "clang/ASTMatchers/ASTMatchers.h"

// Names to bind with matched expressions.
extern const char *CastSequence;

/// \brief Create a matcher that finds implicit casts as well as the head of a
/// sequence of zero or more nested explicit casts that have an implicit cast
/// to null within.
/// Finding sequences of explict casts is necessary so that an entire sequence
/// can be replaced instead of just the inner-most implicit cast.
clang::ast_matchers::StatementMatcher makeCastSequenceMatcher();

#endif // CPP11_MIGRATE_USE_NULLPTR_MATCHERS_H
OpenPOWER on IntegriCloud