diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
commit | 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df (patch) | |
tree | a9243275843fbeaa590afc07ee888e006b8d54ea /include/clang/AST/FullExpr.h | |
parent | 69b4eca4a4255ba43baa5c1d9bbdec3ec17f479e (diff) | |
download | FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.zip FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.tar.gz |
Vendor import of clang trunk r126079:
http://llvm.org/svn/llvm-project/cfe/trunk@126079
Diffstat (limited to 'include/clang/AST/FullExpr.h')
-rw-r--r-- | include/clang/AST/FullExpr.h | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/include/clang/AST/FullExpr.h b/include/clang/AST/FullExpr.h deleted file mode 100644 index 6ceefed..0000000 --- a/include/clang/AST/FullExpr.h +++ /dev/null @@ -1,88 +0,0 @@ -//===--- FullExpr.h - C++ full expression class -----------------*- 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 the FullExpr interface, to be used for type safe handling -// of full expressions. -// -// Full expressions are described in C++ [intro.execution]p12. -// -//===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_AST_FULLEXPR_H -#define LLVM_CLANG_AST_FULLEXPR_H - -#include "llvm/ADT/PointerUnion.h" - -namespace clang { - class ASTContext; - class CXXTemporary; - class Expr; - -class FullExpr { - struct ExprAndTemporaries { - Expr *SubExpr; - - unsigned NumTemps; - - typedef CXXTemporary** temps_iterator; - - temps_iterator temps_begin() { - return reinterpret_cast<CXXTemporary **>(this + 1); - } - temps_iterator temps_end() { - return temps_begin() + NumTemps; - } - }; - - typedef llvm::PointerUnion<Expr *, ExprAndTemporaries *> SubExprTy; - SubExprTy SubExpr; - - FullExpr() { } - -public: - static FullExpr Create(ASTContext &Context, Expr *SubExpr, - CXXTemporary **Temps, unsigned NumTemps); - - Expr *getExpr() { - if (Expr *E = SubExpr.dyn_cast<Expr *>()) - return E; - - return SubExpr.get<ExprAndTemporaries *>()->SubExpr; - } - - const Expr *getExpr() const { - return const_cast<FullExpr*>(this)->getExpr(); - } - - typedef CXXTemporary** temps_iterator; - - temps_iterator temps_begin() { - if (ExprAndTemporaries *ET = SubExpr.dyn_cast<ExprAndTemporaries *>()) - return ET->temps_begin(); - - return 0; - } - temps_iterator temps_end() { - if (ExprAndTemporaries *ET = SubExpr.dyn_cast<ExprAndTemporaries *>()) - return ET->temps_end(); - - return 0; - } - - void *getAsOpaquePtr() const { return SubExpr.getOpaqueValue(); } - - static FullExpr getFromOpaquePtr(void *Ptr) { - FullExpr E; - E.SubExpr = SubExprTy::getFromOpaqueValue(Ptr); - return E; - } -}; - -} // end namespace clang - -#endif |