summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/cpp11-migrate/UseAuto/UseAutoMatchers.h
diff options
context:
space:
mode:
authorEdwin Vane <edwin.vane@intel.com>2013-02-28 16:29:24 +0000
committerEdwin Vane <edwin.vane@intel.com>2013-02-28 16:29:24 +0000
commit266b625ca90de49dac72022232deac1a59f09ccd (patch)
treec1d3ec4cf38c7f06d5205ee702e0f5c4d85e09a6 /clang-tools-extra/cpp11-migrate/UseAuto/UseAutoMatchers.h
parent3305b177e6b62e54efb3fa92b5cafbc0c58df981 (diff)
downloadbcm5719-llvm-266b625ca90de49dac72022232deac1a59f09ccd.tar.gz
bcm5719-llvm-266b625ca90de49dac72022232deac1a59f09ccd.zip
Introducing Use-Auto transform for cpp11-migrate
The new Use-Auto transform replaces the type specifier for variable declarations with the special C++11 'auto' type specifier. For now, the replacement is done only for variables that are iterators of any of the std containers and only if the type used is one of those explicitly allowed by the standard (i.e. not an implementation-specific type). Reviewers: gribozavr, silvas, klimek llvm-svn: 176266
Diffstat (limited to 'clang-tools-extra/cpp11-migrate/UseAuto/UseAutoMatchers.h')
-rw-r--r--clang-tools-extra/cpp11-migrate/UseAuto/UseAutoMatchers.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/clang-tools-extra/cpp11-migrate/UseAuto/UseAutoMatchers.h b/clang-tools-extra/cpp11-migrate/UseAuto/UseAutoMatchers.h
new file mode 100644
index 00000000000..db160f8766e
--- /dev/null
+++ b/clang-tools-extra/cpp11-migrate/UseAuto/UseAutoMatchers.h
@@ -0,0 +1,27 @@
+//===-- UseAutoMatchers.h - Matchers for use-auto transform ----*- 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 LLVM_TOOLS_CLANG_TOOLS_EXTRA_CPP11_MIGRATE_USE_AUTO_MATCHERS_H
+#define LLVM_TOOLS_CLANG_TOOLS_EXTRA_CPP11_MIGRATE_USE_AUTO_MATCHERS_H
+
+#include "clang/ASTMatchers/ASTMatchers.h"
+
+extern const char *DeclNodeId;
+
+/// \brief Create a matcher that matches variable declarations where the type
+/// is an iterator for an std container and has an explicit initializer of the
+/// same type.
+clang::ast_matchers::DeclarationMatcher makeIteratorMatcher();
+
+#endif // LLVM_TOOLS_CLANG_TOOLS_EXTRA_CPP11_MIGRATE_USE_AUTO_MATCHERS_H
OpenPOWER on IntegriCloud