diff options
Diffstat (limited to 'lib/Parse')
-rw-r--r-- | lib/Parse/AstGuard.h | 83 | ||||
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 1 | ||||
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 1 | ||||
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 1 | ||||
-rw-r--r-- | lib/Parse/ParseExprCXX.cpp | 1 | ||||
-rw-r--r-- | lib/Parse/ParseInit.cpp | 1 | ||||
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 1 | ||||
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 1 | ||||
-rw-r--r-- | lib/Parse/ParseTemplate.cpp | 1 |
9 files changed, 0 insertions, 91 deletions
diff --git a/lib/Parse/AstGuard.h b/lib/Parse/AstGuard.h deleted file mode 100644 index 1ff6a4e35a..0000000000 --- a/lib/Parse/AstGuard.h +++ /dev/null @@ -1,83 +0,0 @@ -//===--- AstGuard.h - Parser Ownership Tracking Utilities -------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines RAII objects for managing ExprTy* and StmtTy*. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_PARSE_ASTGUARD_H -#define LLVM_CLANG_PARSE_ASTGUARD_H - -#include "clang/Parse/Action.h" -#include "llvm/ADT/SmallVector.h" - -namespace clang -{ - /// RAII SmallVector wrapper that holds Action::ExprTy* and similar, - /// automatically freeing them on destruction unless it's been disowned. - /// Instantiated for statements and expressions (Action::DeleteStmt and - /// Action::DeleteExpr). - template <ASTDestroyer Destroyer, unsigned N> - class ASTVector : public llvm::SmallVector<void*, N> { - private: -#if !defined(DISABLE_SMART_POINTERS) - Action &Actions; - bool Owns; - - void destroy() { - if (Owns) { - while (!this->empty()) { - (Actions.*Destroyer)(this->back()); - this->pop_back(); - } - } - } - - ASTVector(const ASTVector&); // DO NOT IMPLEMENT - // Reference member prevents copy assignment. -#endif - - public: -#if !defined(DISABLE_SMART_POINTERS) - ASTVector(Action &actions) : Actions(actions), Owns(true) {} - - ~ASTVector() { destroy(); } -#else - ASTVector(Action &) {} -#endif - - void **take() { -#if !defined(DISABLE_SMART_POINTERS) - Owns = false; -#endif - return this->data(); - } - -#if !defined(DISABLE_SMART_POINTERS) - Action &getActions() const { return Actions; } -#endif - }; - - /// A SmallVector of statements, with stack size 32 (as that is the only one - /// used.) - typedef ASTVector<&Action::DeleteStmt, 32> StmtVector; - /// A SmallVector of expressions, with stack size 12 (the maximum used.) - typedef ASTVector<&Action::DeleteExpr, 12> ExprVector; - - template <ASTDestroyer Destroyer, unsigned N> inline - ASTMultiPtr<Destroyer> move_arg(ASTVector<Destroyer, N> &vec) { -#if !defined(DISABLE_SMART_POINTERS) - return ASTMultiPtr<Destroyer>(vec.getActions(), vec.take(), vec.size()); -#else - return ASTMultiPtr<Destroyer>(vec.take(), vec.size()); -#endif - } -} - -#endif diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 4c2a77e7d0..0a33d7daa0 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -15,7 +15,6 @@ #include "clang/Parse/ParseDiagnostic.h" #include "clang/Parse/Scope.h" #include "ExtensionRAIIObject.h" -#include "AstGuard.h" #include "llvm/ADT/SmallSet.h" using namespace clang; diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index b900e25c69..c53b0f071c 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -15,7 +15,6 @@ #include "clang/Parse/ParseDiagnostic.h" #include "clang/Parse/DeclSpec.h" #include "clang/Parse/Scope.h" -#include "AstGuard.h" #include "ExtensionRAIIObject.h" using namespace clang; diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 527fd4695c..869b315d99 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -24,7 +24,6 @@ #include "clang/Parse/Scope.h" #include "clang/Basic/PrettyStackTrace.h" #include "ExtensionRAIIObject.h" -#include "AstGuard.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallString.h" using namespace clang; diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index d2d9a87f49..c065b4760a 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -14,7 +14,6 @@ #include "clang/Parse/ParseDiagnostic.h" #include "clang/Parse/Parser.h" #include "clang/Parse/DeclSpec.h" -#include "AstGuard.h" using namespace clang; /// ParseOptionalCXXScopeSpecifier - Parse global scope or diff --git a/lib/Parse/ParseInit.cpp b/lib/Parse/ParseInit.cpp index 052586f5ca..bbc2124e59 100644 --- a/lib/Parse/ParseInit.cpp +++ b/lib/Parse/ParseInit.cpp @@ -13,7 +13,6 @@ #include "clang/Parse/Designator.h" #include "clang/Parse/Parser.h" -#include "AstGuard.h" #include "clang/Parse/ParseDiagnostic.h" #include "llvm/ADT/SmallString.h" using namespace clang; diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 571c610836..3014f95a84 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -14,7 +14,6 @@ #include "clang/Parse/Parser.h" #include "clang/Parse/DeclSpec.h" #include "clang/Parse/Scope.h" -#include "AstGuard.h" #include "clang/Parse/ParseDiagnostic.h" #include "llvm/ADT/SmallVector.h" using namespace clang; diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index 842235264e..952c4c15f3 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -14,7 +14,6 @@ #include "clang/Parse/Parser.h" #include "ExtensionRAIIObject.h" -#include "AstGuard.h" #include "clang/Parse/DeclSpec.h" #include "clang/Parse/Scope.h" #include "clang/Basic/Diagnostic.h" diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index f23f8c0c83..2a79b99d29 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -15,7 +15,6 @@ #include "clang/Parse/ParseDiagnostic.h" #include "clang/Parse/DeclSpec.h" #include "clang/Parse/Scope.h" -#include "AstGuard.h" using namespace clang; /// \brief Parse a template declaration, explicit instantiation, or |