[cfe-commits] r111795 - in /cfe/trunk: include/clang/Parse/ include/clang/Sema/ lib/Parse/ lib/Sema/
John McCall
rjmccall at apple.com
Sun Aug 22 23:44:23 PDT 2010
Author: rjmccall
Date: Mon Aug 23 01:44:23 2010
New Revision: 111795
URL: http://llvm.org/viewvc/llvm-project?rev=111795&view=rev
Log:
Sundry incremental steps towards killing off Action.
Modified:
cfe/trunk/include/clang/Parse/Parser.h
cfe/trunk/include/clang/Sema/Action.h
cfe/trunk/include/clang/Sema/AttributeList.h
cfe/trunk/include/clang/Sema/DeclSpec.h
cfe/trunk/include/clang/Sema/Ownership.h
cfe/trunk/include/clang/Sema/ParsedTemplate.h
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/Parse/ParseDecl.cpp
cfe/trunk/lib/Parse/ParseDeclCXX.cpp
cfe/trunk/lib/Parse/ParseExpr.cpp
cfe/trunk/lib/Parse/ParseExprCXX.cpp
cfe/trunk/lib/Parse/ParseInit.cpp
cfe/trunk/lib/Parse/ParseObjc.cpp
cfe/trunk/lib/Parse/ParsePragma.cpp
cfe/trunk/lib/Parse/ParseStmt.cpp
cfe/trunk/lib/Parse/ParseTemplate.cpp
cfe/trunk/lib/Sema/SemaCXXCast.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/lib/Sema/SemaInit.cpp
cfe/trunk/lib/Sema/SemaOverload.cpp
cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
cfe/trunk/lib/Sema/TreeTransform.h
Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Mon Aug 23 01:44:23 2010
@@ -145,17 +145,17 @@
// Type forwarding. All of these are statically 'void*', but they may all be
// different actual classes based on the actions in place.
- typedef Action::ExprTy ExprTy;
- typedef Action::StmtTy StmtTy;
+ typedef Expr ExprTy;
+ typedef Stmt StmtTy;
typedef Action::DeclGroupPtrTy DeclGroupPtrTy;
typedef Action::TypeTy TypeTy;
- typedef Action::BaseTy BaseTy;
- typedef Action::MemInitTy MemInitTy;
- typedef Action::CXXScopeTy CXXScopeTy;
- typedef Action::TemplateParamsTy TemplateParamsTy;
+ typedef CXXBaseSpecifier BaseTy;
+ typedef CXXBaseOrMemberInitializer MemInitTy;
+ typedef NestedNameSpecifier CXXScopeTy;
+ typedef TemplateParameterList TemplateParamsTy;
typedef Action::TemplateTy TemplateTy;
- typedef llvm::SmallVector<TemplateParamsTy *, 4> TemplateParameterLists;
+ typedef llvm::SmallVector<TemplateParameterList *, 4> TemplateParameterLists;
typedef Action::ExprResult ExprResult;
typedef Action::StmtResult StmtResult;
@@ -172,20 +172,20 @@
/// Adorns a ExprResult with Actions to make it an OwningExprResult
OwningExprResult Owned(ExprResult res) {
- return OwningExprResult(Actions, res);
+ return OwningExprResult(res);
}
/// Adorns a StmtResult with Actions to make it an OwningStmtResult
OwningStmtResult Owned(StmtResult res) {
- return OwningStmtResult(Actions, res);
+ return OwningStmtResult(res);
}
- OwningExprResult ExprError() { return OwningExprResult(Actions, true); }
- OwningStmtResult StmtError() { return OwningStmtResult(Actions, true); }
+ OwningExprResult ExprError() { return OwningExprResult(true); }
+ OwningStmtResult StmtError() { return OwningStmtResult(true); }
OwningExprResult ExprError(const DiagnosticBuilder &) { return ExprError(); }
OwningStmtResult StmtError(const DiagnosticBuilder &) { return StmtError(); }
- OwningExprResult ExprEmpty() { return OwningExprResult(Actions, false); }
+ OwningExprResult ExprEmpty() { return OwningExprResult(false); }
// Parsing methods.
@@ -949,16 +949,17 @@
TypeTy *&CastTy,
SourceRange &CastRange);
- static const unsigned ExprListSize = 12;
- typedef llvm::SmallVector<ExprTy*, ExprListSize> ExprListTy;
- typedef llvm::SmallVector<SourceLocation, ExprListSize> CommaLocsTy;
+ typedef llvm::SmallVector<Expr*, 20> ExprListTy;
+ typedef llvm::SmallVector<SourceLocation, 20> CommaLocsTy;
/// ParseExpressionList - Used for C/C++ (argument-)expression-list.
- bool ParseExpressionList(ExprListTy &Exprs, CommaLocsTy &CommaLocs,
- void (Action::*Completer)(Scope *S, void *Data,
- ExprTy **Args,
+ bool ParseExpressionList(llvm::SmallVectorImpl<Expr*> &Exprs,
+ llvm::SmallVectorImpl<SourceLocation> &CommaLocs,
+ void (Action::*Completer)(Scope *S,
+ Expr *Data,
+ Expr **Args,
unsigned NumArgs) = 0,
- void *Data = 0);
+ Expr *Data = 0);
/// ParenParseOption - Control what ParseParenExpression will parse.
enum ParenParseOption {
@@ -1040,7 +1041,8 @@
//===--------------------------------------------------------------------===//
// C++ 5.3.4 and 5.3.5: C++ new and delete
- bool ParseExpressionListOrTypeId(ExprListTy &Exprs, Declarator &D);
+ bool ParseExpressionListOrTypeId(llvm::SmallVectorImpl<Expr*> &Exprs,
+ Declarator &D);
void ParseDirectNewDeclarator(Declarator &D);
OwningExprResult ParseCXXNewExpression(bool UseGlobal, SourceLocation Start);
OwningExprResult ParseCXXDeleteExpression(bool UseGlobal,
Modified: cfe/trunk/include/clang/Sema/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Action.h?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Action.h (original)
+++ cfe/trunk/include/clang/Sema/Action.h Mon Aug 23 01:44:23 2010
@@ -31,6 +31,7 @@
class CXXScopeSpec;
class Declarator;
class AttributeList;
+ class TemplateParameterList;
struct FieldDeclarator;
// Parse.
class Scope;
@@ -84,23 +85,23 @@
typedef clang::StmtResult StmtResult;
typedef clang::TypeResult TypeResult;
typedef clang::BaseResult BaseResult;
- typedef clang::MemInitResult MemInitResult;
typedef clang::DeclResult DeclResult;
+ typedef clang::MemInitResult MemInitResult;
/// Same, but with ownership.
- typedef ASTOwningResult<&ActionBase::DeleteExpr> OwningExprResult;
- typedef ASTOwningResult<&ActionBase::DeleteStmt> OwningStmtResult;
+ typedef ASTOwningResult<Expr*> OwningExprResult;
+ typedef ASTOwningResult<Stmt*> OwningStmtResult;
// Note that these will replace ExprResult and StmtResult when the transition
// is complete.
/// Single expressions or statements as arguments.
- typedef ASTOwningPtr<&ActionBase::DeleteExpr> ExprArg;
- typedef ASTOwningPtr<&ActionBase::DeleteStmt> StmtArg;
+ typedef ASTOwningPtr<Expr*> ExprArg;
+ typedef ASTOwningPtr<Stmt*> StmtArg;
/// Multiple expressions or statements as arguments.
- typedef ASTMultiPtr<&ActionBase::DeleteExpr> MultiExprArg;
- typedef ASTMultiPtr<&ActionBase::DeleteStmt> MultiStmtArg;
- typedef ASTMultiPtr<&ActionBase::DeleteTemplateParams> MultiTemplateParamsArg;
+ typedef ASTMultiPtr<Expr*> MultiExprArg;
+ typedef ASTMultiPtr<Stmt*> MultiStmtArg;
+ typedef ASTMultiPtr<TemplateParameterList*> MultiTemplateParamsArg;
class FullExprArg {
public:
@@ -143,14 +144,14 @@
// Utilities for Action implementations to return smart results.
- OwningExprResult ExprError() { return OwningExprResult(*this, true); }
- OwningStmtResult StmtError() { return OwningStmtResult(*this, true); }
+ OwningExprResult ExprError() { return OwningExprResult(true); }
+ OwningStmtResult StmtError() { return OwningStmtResult(true); }
OwningExprResult ExprError(const DiagnosticBuilder&) { return ExprError(); }
OwningStmtResult StmtError(const DiagnosticBuilder&) { return StmtError(); }
- OwningExprResult ExprEmpty() { return OwningExprResult(*this, false); }
- OwningStmtResult StmtEmpty() { return OwningStmtResult(*this, false); }
+ OwningExprResult ExprEmpty() { return OwningExprResult(false); }
+ OwningStmtResult StmtEmpty() { return OwningStmtResult(false); }
/// Statistics.
virtual void PrintStats() const {}
@@ -709,8 +710,8 @@
IdentifierInfo *ClassName,
llvm::SmallVectorImpl<Decl *> &Decls) {}
virtual Decl *ActOnField(Scope *S, Decl *TagD,
- SourceLocation DeclStart,
- Declarator &D, ExprTy *BitfieldWidth) {
+ SourceLocation DeclStart,
+ Declarator &D, ExprTy *BitfieldWidth) {
return 0;
}
@@ -783,9 +784,7 @@
virtual void ActOnForEachDeclStmt(DeclGroupPtrTy Decl) {
}
- virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
- return OwningStmtResult(*this, Expr->release());
- }
+ virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) = 0;
/// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
/// which can specify an RHS value. The sub-statement of the case is
@@ -2576,9 +2575,7 @@
SourceLocation LBracLoc,
SourceLocation SelectorLoc,
SourceLocation RBracLoc,
- MultiExprArg Args) {
- return OwningExprResult(*this);
- }
+ MultiExprArg Args) = 0;
/// \brief Parsed a message send to a class.
///
@@ -2595,9 +2592,7 @@
SourceLocation LBracLoc,
SourceLocation SelectorLoc,
SourceLocation RBracLoc,
- MultiExprArg Args) {
- return OwningExprResult(*this);
- }
+ MultiExprArg Args) = 0;
/// \brief Parsed a message send to an object instance.
///
@@ -2614,9 +2609,7 @@
SourceLocation LBracLoc,
SourceLocation SelectorLoc,
SourceLocation RBracLoc,
- MultiExprArg Args) {
- return OwningExprResult(*this);
- }
+ MultiExprArg Args) = 0;
virtual Decl *ActOnForwardClassDeclaration(
SourceLocation AtClassLoc,
@@ -2847,8 +2840,8 @@
/// \param Args the arguments to the function call (so far).
///
/// \param NumArgs the number of arguments in \p Args.
- virtual void CodeCompleteCall(Scope *S, ExprTy *Fn,
- ExprTy **Args, unsigned NumArgs) { }
+ virtual void CodeCompleteCall(Scope *S, Expr *Fn,
+ Expr **Args, unsigned NumArgs) { }
/// \brief Code completion for the initializer of a variable declaration.
///
Modified: cfe/trunk/include/clang/Sema/AttributeList.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/AttributeList.h?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/AttributeList.h (original)
+++ cfe/trunk/include/clang/Sema/AttributeList.h Mon Aug 23 01:44:23 2010
@@ -22,6 +22,7 @@
namespace clang {
class IdentifierInfo;
class Action;
+ class Expr;
/// AttributeList - Represents GCC's __attribute__ declaration. There are
/// 4 forms of this construct...they are:
@@ -49,7 +50,7 @@
AttributeList(IdentifierInfo *AttrName, SourceLocation AttrLoc,
IdentifierInfo *ScopeName, SourceLocation ScopeLoc,
IdentifierInfo *ParmName, SourceLocation ParmLoc,
- ActionBase::ExprTy **args, unsigned numargs,
+ Expr **args, unsigned numargs,
AttributeList *Next, bool declspec = false, bool cxx0x = false);
~AttributeList();
Modified: cfe/trunk/include/clang/Sema/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/DeclSpec.h?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/DeclSpec.h (original)
+++ cfe/trunk/include/clang/Sema/DeclSpec.h Mon Aug 23 01:44:23 2010
@@ -30,6 +30,7 @@
class LangOptions;
class Diagnostic;
class IdentifierInfo;
+ class NestedNameSpecifier;
class Preprocessor;
class Declarator;
struct TemplateIdAnnotation;
@@ -47,7 +48,7 @@
/// The actual scope is described by getScopeRep().
class CXXScopeSpec {
SourceRange Range;
- void *ScopeRep;
+ NestedNameSpecifier *ScopeRep;
public:
CXXScopeSpec() : Range(), ScopeRep() { }
@@ -59,7 +60,7 @@
SourceLocation getBeginLoc() const { return Range.getBegin(); }
SourceLocation getEndLoc() const { return Range.getEnd(); }
- ActionBase::CXXScopeTy *getScopeRep() const { return ScopeRep; }
+ NestedNameSpecifier *getScopeRep() const { return ScopeRep; }
void setScopeRep(ActionBase::CXXScopeTy *S) { ScopeRep = S; }
/// No scope specifier.
@@ -799,7 +800,7 @@
/// This is the size of the array, or null if [] or [*] was specified.
/// Since the parser is multi-purpose, and we don't want to impose a root
/// expression class on all clients, NumElts is untyped.
- ActionBase::ExprTy *NumElts;
+ Expr *NumElts;
void destroy() {}
};
@@ -1010,7 +1011,7 @@
/// getArray - Return a DeclaratorChunk for an array.
///
static DeclaratorChunk getArray(unsigned TypeQuals, bool isStatic,
- bool isStar, void *NumElts,
+ bool isStar, Expr *NumElts,
SourceLocation LBLoc, SourceLocation RBLoc) {
DeclaratorChunk I;
I.Kind = Array;
Modified: cfe/trunk/include/clang/Sema/Ownership.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Ownership.h?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Ownership.h (original)
+++ cfe/trunk/include/clang/Sema/Ownership.h Mon Aug 23 01:44:23 2010
@@ -23,7 +23,14 @@
namespace clang {
class ActionBase;
+ class Attr;
+ class CXXBaseOrMemberInitializer;
+ class CXXBaseSpecifier;
class Decl;
+ class Expr;
+ class NestedNameSpecifier;
+ class Stmt;
+ class TemplateParameterList;
/// OpaquePtr - This is a very simple POD type that wraps a pointer that the
/// Parser doesn't know about but that Sema or another client does. The UID
@@ -186,7 +193,7 @@
// Determines whether the low bit of the result pointer for the
// given UID is always zero. If so, ActionResult will use that bit
// for it's "invalid" flag.
- template<unsigned UID>
+ template<class Ptr>
struct IsResultPtrLowBitFree {
static const bool value = false;
};
@@ -202,13 +209,13 @@
// what types are required to be identical for the actions.
typedef OpaquePtr<1> DeclGroupPtrTy;
typedef OpaquePtr<2> TemplateTy;
- typedef void AttrTy;
- typedef void BaseTy;
- typedef void MemInitTy;
- typedef void ExprTy;
- typedef void StmtTy;
- typedef void TemplateParamsTy;
- typedef void CXXScopeTy;
+ typedef Attr AttrTy;
+ typedef CXXBaseSpecifier BaseTy;
+ typedef CXXBaseOrMemberInitializer MemInitTy;
+ typedef Expr ExprTy;
+ typedef Stmt StmtTy;
+ typedef TemplateParameterList TemplateParamsTy;
+ typedef NestedNameSpecifier CXXScopeTy;
typedef void TypeTy; // FIXME: Change TypeTy to use OpaquePtr<N>.
/// ActionResult - This structure is used while parsing/acting on
@@ -216,19 +223,21 @@
/// the action, plus a sense of whether or not it is valid.
/// When CompressInvalid is true, the "invalid" flag will be
/// stored in the low bit of the Val pointer.
- template<unsigned UID,
- typename PtrTy = void*,
- bool CompressInvalid = IsResultPtrLowBitFree<UID>::value>
+ template<class PtrTy,
+ bool CompressInvalid = IsResultPtrLowBitFree<PtrTy>::value>
class ActionResult {
PtrTy Val;
bool Invalid;
public:
ActionResult(bool Invalid = false) : Val(PtrTy()), Invalid(Invalid) {}
- template<typename ActualExprTy>
- ActionResult(ActualExprTy val) : Val(val), Invalid(false) {}
+ ActionResult(PtrTy val) : Val(val), Invalid(false) {}
ActionResult(const DiagnosticBuilder &) : Val(PtrTy()), Invalid(true) {}
+ // These two overloads prevent void* -> bool conversions.
+ ActionResult(const void *);
+ ActionResult(volatile void *);
+
PtrTy get() const { return Val; }
void set(PtrTy V) { Val = V; }
bool isInvalid() const { return Invalid; }
@@ -242,8 +251,8 @@
// This ActionResult partial specialization places the "invalid"
// flag into the low bit of the pointer.
- template<unsigned UID, typename PtrTy>
- class ActionResult<UID, PtrTy, true> {
+ template<typename PtrTy>
+ class ActionResult<PtrTy, true> {
// A pointer whose low bit is 1 if this result is invalid, 0
// otherwise.
uintptr_t PtrWithInvalid;
@@ -252,20 +261,16 @@
ActionResult(bool Invalid = false)
: PtrWithInvalid(static_cast<uintptr_t>(Invalid)) { }
- template<typename ActualExprTy>
- ActionResult(ActualExprTy *val) {
- PtrTy V(val);
- void *VP = PtrTraits::getAsVoidPointer(V);
- PtrWithInvalid = reinterpret_cast<uintptr_t>(VP);
- assert((PtrWithInvalid & 0x01) == 0 && "Badly aligned pointer");
- }
-
ActionResult(PtrTy V) {
void *VP = PtrTraits::getAsVoidPointer(V);
PtrWithInvalid = reinterpret_cast<uintptr_t>(VP);
assert((PtrWithInvalid & 0x01) == 0 && "Badly aligned pointer");
}
+ // These two overloads prevent void* -> bool conversions.
+ ActionResult(const void *);
+ ActionResult(volatile void *);
+
ActionResult(const DiagnosticBuilder &) : PtrWithInvalid(0x01) { }
PtrTy get() const {
@@ -298,80 +303,68 @@
virtual void DeleteTemplateParams(TemplateParamsTy *P) {}
};
- /// ASTDestroyer - The type of an AST node destruction function pointer.
- typedef void (ActionBase::*ASTDestroyer)(void *);
-
- /// For the transition phase: translate from an ASTDestroyer to its
- /// ActionResult UID.
- template <ASTDestroyer Destroyer> struct DestroyerToUID;
- template <> struct DestroyerToUID<&ActionBase::DeleteExpr> {
- static const unsigned UID = 0;
- };
- template <> struct DestroyerToUID<&ActionBase::DeleteStmt> {
- static const unsigned UID = 1;
- };
/// ASTOwningResult - A moveable smart pointer for AST nodes that also
/// has an extra flag to indicate an additional success status.
- template <ASTDestroyer Destroyer> class ASTOwningResult;
+ template <typename PtrTy> class ASTOwningResult;
/// ASTMultiPtr - A moveable smart pointer to multiple AST nodes. Only owns
/// the individual pointers, not the array holding them.
- template <ASTDestroyer Destroyer> class ASTMultiPtr;
+ template <typename PtrTy> class ASTMultiPtr;
/// Kept only as a type-safe wrapper for a void pointer.
- template <ASTDestroyer Destroyer>
- class ASTOwningPtr {
- void *Node;
+ template <typename PtrTy> class ASTOwningPtr {
+ PtrTy Node;
public:
explicit ASTOwningPtr(ActionBase &) : Node(0) {}
- ASTOwningPtr(ActionBase &, void *node) : Node(node) {}
+ ASTOwningPtr(ActionBase &, PtrTy node) : Node(node) {}
+
// Normal copying operators are defined implicitly.
- ASTOwningPtr(const ASTOwningResult<Destroyer> &o);
+ ASTOwningPtr(const ASTOwningResult<PtrTy> &o);
- ASTOwningPtr & operator =(void *raw) {
+ ASTOwningPtr & operator =(PtrTy raw) {
Node = raw;
return *this;
}
/// Access to the raw pointer.
- void * get() const { return Node; }
+ PtrTy get() const { return Node; }
/// Release the raw pointer.
- void * take() {
- return Node;
- }
+ PtrTy take() { return Node; }
/// Take outside ownership of the raw pointer and cast it down.
- template<typename T>
- T *takeAs() {
+ template<typename T> T *takeAs() {
return static_cast<T*>(Node);
}
/// Alias for interface familiarity with unique_ptr.
- void * release() {
+ PtrTy release() {
return take();
}
};
- template <ASTDestroyer Destroyer>
- class ASTOwningResult {
+ template <class PtrTy> class ASTOwningResult {
public:
- typedef ActionBase::ActionResult<DestroyerToUID<Destroyer>::UID> DumbResult;
+ typedef ActionBase::ActionResult<PtrTy> DumbResult;
private:
DumbResult Result;
public:
- explicit ASTOwningResult(ActionBase &actions, bool invalid = false)
+ explicit ASTOwningResult(bool invalid = false)
: Result(invalid) { }
- ASTOwningResult(ActionBase &actions, void *node) : Result(node) { }
- ASTOwningResult(ActionBase &actions, const DumbResult &res) : Result(res) { }
+ explicit ASTOwningResult(PtrTy node) : Result(node) { }
+ explicit ASTOwningResult(const DumbResult &res) : Result(res) { }
// Normal copying semantics are defined implicitly.
- ASTOwningResult(const ASTOwningPtr<Destroyer> &o) : Result(o.get()) { }
+ ASTOwningResult(const ASTOwningPtr<PtrTy> &o) : Result(o.get()) { }
+
+ // These two overloads prevent void* -> bool conversions.
+ explicit ASTOwningResult(const void *);
+ explicit ASTOwningResult(volatile void *);
/// Assignment from a raw pointer. Takes ownership - beware!
- ASTOwningResult & operator =(void *raw) {
+ ASTOwningResult & operator =(PtrTy raw) {
Result = raw;
return *this;
}
@@ -383,7 +376,7 @@
}
/// Access to the raw pointer.
- void * get() const { return Result.get(); }
+ PtrTy get() const { return Result.get(); }
bool isInvalid() const { return Result.isInvalid(); }
@@ -392,7 +385,7 @@
bool isUsable() const { return !Result.isInvalid() && get(); }
/// Take outside ownership of the raw pointer.
- void * take() {
+ PtrTy take() {
return Result.get();
}
@@ -403,32 +396,32 @@
}
/// Alias for interface familiarity with unique_ptr.
- void * release() { return take(); }
+ PtrTy release() { return take(); }
/// Pass ownership to a classical ActionResult.
DumbResult result() { return Result; }
};
- template <ASTDestroyer Destroyer>
+ template <class PtrTy>
class ASTMultiPtr {
- void **Nodes;
+ PtrTy *Nodes;
unsigned Count;
public:
// Normal copying implicitly defined
explicit ASTMultiPtr(ActionBase &) : Nodes(0), Count(0) {}
- ASTMultiPtr(ActionBase &, void **nodes, unsigned count)
+ ASTMultiPtr(ActionBase &, PtrTy *nodes, unsigned count)
: Nodes(nodes), Count(count) {}
// Fake mover in Parse/AstGuard.h needs this:
- ASTMultiPtr(void **nodes, unsigned count) : Nodes(nodes), Count(count) {}
+ ASTMultiPtr(PtrTy *nodes, unsigned count) : Nodes(nodes), Count(count) {}
/// Access to the raw pointers.
- void ** get() const { return Nodes; }
+ PtrTy *get() const { return Nodes; }
/// Access to the count.
unsigned size() const { return Count; }
- void ** release() {
+ PtrTy *release() {
return Nodes;
}
};
@@ -472,8 +465,8 @@
};
/// \brief A small vector that owns a set of AST nodes.
- template <ASTDestroyer Destroyer, unsigned N = 8>
- class ASTOwningVector : public llvm::SmallVector<void *, N> {
+ template <class PtrTy, unsigned N = 8>
+ class ASTOwningVector : public llvm::SmallVector<PtrTy, N> {
ASTOwningVector(ASTOwningVector &); // do not implement
ASTOwningVector &operator=(ASTOwningVector &); // do not implement
@@ -481,60 +474,67 @@
explicit ASTOwningVector(ActionBase &Actions)
{ }
- void **take() {
+ PtrTy *take() {
return &this->front();
}
- template<typename T> T **takeAs() { return (T**)take(); }
+ template<typename T> T **takeAs() { return reinterpret_cast<T**>(take()); }
};
/// A SmallVector of statements, with stack size 32 (as that is the only one
/// used.)
- typedef ASTOwningVector<&ActionBase::DeleteStmt, 32> StmtVector;
+ typedef ASTOwningVector<Stmt*, 32> StmtVector;
/// A SmallVector of expressions, with stack size 12 (the maximum used.)
- typedef ASTOwningVector<&ActionBase::DeleteExpr, 12> ExprVector;
+ typedef ASTOwningVector<Expr*, 12> ExprVector;
- template <ASTDestroyer Destroyer, unsigned N> inline
- ASTMultiPtr<Destroyer> move_arg(ASTOwningVector<Destroyer, N> &vec) {
- return ASTMultiPtr<Destroyer>(vec.take(), vec.size());
+ template <class T, unsigned N> inline
+ ASTMultiPtr<T> move_arg(ASTOwningVector<T, N> &vec) {
+ return ASTMultiPtr<T>(vec.take(), vec.size());
}
- template <ASTDestroyer Destroyer> inline
- ASTOwningPtr<Destroyer>::ASTOwningPtr(const ASTOwningResult<Destroyer> &o)
+ template <class T> inline
+ ASTOwningPtr<T>::ASTOwningPtr(const ASTOwningResult<T> &o)
: Node(o.get()) { }
// These versions are hopefully no-ops.
- template <ASTDestroyer Destroyer> inline
- ASTOwningResult<Destroyer>& move(ASTOwningResult<Destroyer> &ptr) {
+ template <class T> inline
+ ASTOwningResult<T>& move(ASTOwningResult<T> &ptr) {
return ptr;
}
- template <ASTDestroyer Destroyer> inline
- ASTOwningPtr<Destroyer>& move(ASTOwningPtr<Destroyer> &ptr) {
+ template <class T> inline
+ ASTOwningPtr<T>& move(ASTOwningPtr<T> &ptr) {
return ptr;
}
- template <ASTDestroyer Destroyer> inline
- ASTMultiPtr<Destroyer>& move(ASTMultiPtr<Destroyer> &ptr) {
+ template <class T> inline
+ ASTMultiPtr<T>& move(ASTMultiPtr<T> &ptr) {
return ptr;
}
// We can re-use the low bit of expression, statement, base, and
// member-initializer pointers for the "invalid" flag of
// ActionResult.
- template<> struct IsResultPtrLowBitFree<0> { static const bool value = true;};
- template<> struct IsResultPtrLowBitFree<1> { static const bool value = true;};
- template<> struct IsResultPtrLowBitFree<3> { static const bool value = true;};
- template<> struct IsResultPtrLowBitFree<4> { static const bool value = true;};
- template<> struct IsResultPtrLowBitFree<5> { static const bool value = true;};
-
- typedef ActionBase::ActionResult<0> ExprResult;
- typedef ActionBase::ActionResult<1> StmtResult;
- typedef ActionBase::ActionResult<2> TypeResult;
- typedef ActionBase::ActionResult<3> BaseResult;
- typedef ActionBase::ActionResult<4> MemInitResult;
+ template<> struct IsResultPtrLowBitFree<Expr*> {
+ static const bool value = true;
+ };
+ template<> struct IsResultPtrLowBitFree<Stmt*> {
+ static const bool value = true;
+ };
+ template<> struct IsResultPtrLowBitFree<CXXBaseSpecifier*> {
+ static const bool value = true;
+ };
+ template<> struct IsResultPtrLowBitFree<CXXBaseOrMemberInitializer*> {
+ static const bool value = true;
+ };
+
+ typedef ActionBase::ActionResult<Expr*> ExprResult;
+ typedef ActionBase::ActionResult<Stmt*> StmtResult;
+ typedef ActionBase::ActionResult<void*> TypeResult;
+ typedef ActionBase::ActionResult<CXXBaseSpecifier*> BaseResult;
+ typedef ActionBase::ActionResult<CXXBaseOrMemberInitializer*> MemInitResult;
- typedef ActionBase::ActionResult<5, Decl*> DeclResult;
+ typedef ActionBase::ActionResult<Decl*> DeclResult;
}
#endif
Modified: cfe/trunk/include/clang/Sema/ParsedTemplate.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/ParsedTemplate.h?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/ParsedTemplate.h (original)
+++ cfe/trunk/include/clang/Sema/ParsedTemplate.h Mon Aug 23 01:44:23 2010
@@ -70,9 +70,9 @@
}
/// \brief Retrieve the non-type template argument's expression.
- ActionBase::ExprTy *getAsExpr() const {
+ Expr *getAsExpr() const {
assert(Kind == NonType && "Not a non-type template argument");
- return Arg;
+ return static_cast<Expr*>(Arg);
}
/// \brief Retrieve the template template argument's template name.
Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Mon Aug 23 01:44:23 2010
@@ -688,17 +688,17 @@
OwningExprResult Owned(Expr* E) {
assert(!E || E->isRetained());
- return OwningExprResult(*this, E);
+ return OwningExprResult(E);
}
OwningExprResult Owned(ExprResult R) {
if (R.isInvalid())
return ExprError();
assert(!R.get() || ((Expr*) R.get())->isRetained());
- return OwningExprResult(*this, R.get());
+ return OwningExprResult(R.get());
}
OwningStmtResult Owned(Stmt* S) {
assert(!S || S->isRetained());
- return OwningStmtResult(*this, S);
+ return OwningStmtResult(S);
}
virtual void ActOnEndOfTranslationUnit();
@@ -2398,7 +2398,7 @@
bool CompleteConstructorCall(CXXConstructorDecl *Constructor,
MultiExprArg ArgsPtr,
SourceLocation Loc,
- ASTOwningVector<&ActionBase::DeleteExpr> &ConvertedArgs);
+ ASTOwningVector<Expr*> &ConvertedArgs);
virtual TypeTy *getDestructorName(SourceLocation TildeLoc,
IdentifierInfo &II, SourceLocation NameLoc,
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Mon Aug 23 01:44:23 2010
@@ -258,7 +258,7 @@
// correctly.
OwningExprResult ArgExpr(ParseAssignmentExpression());
if (!ArgExpr.isInvalid()) {
- ExprTy* ExprList = ArgExpr.take();
+ Expr *ExprList = ArgExpr.take();
CurrAttr = new AttributeList(AttrName, AttrNameLoc, 0, AttrNameLoc, 0,
SourceLocation(), &ExprList, 1,
CurrAttr, true);
@@ -900,7 +900,7 @@
goto DoneWithDeclSpec;
CXXScopeSpec SS;
- SS.setScopeRep(Tok.getAnnotationValue());
+ SS.setScopeRep((NestedNameSpecifier*) Tok.getAnnotationValue());
SS.setRange(Tok.getAnnotationRange());
// We are looking for a qualified typename.
@@ -2052,7 +2052,7 @@
SourceLocation IdentLoc = ConsumeToken();
SourceLocation EqualLoc;
- OwningExprResult AssignedVal(Actions);
+ OwningExprResult AssignedVal;
if (Tok.is(tok::equal)) {
EqualLoc = ConsumeToken();
AssignedVal = ParseConstantExpression();
@@ -3283,7 +3283,7 @@
}
// Remember that we parsed the empty array type.
- OwningExprResult NumElements(Actions);
+ OwningExprResult NumElements;
D.AddTypeInfo(DeclaratorChunk::getArray(0, false, false, 0,
StartLoc, EndLoc),
EndLoc);
@@ -3329,7 +3329,7 @@
// Handle "direct-declarator [ type-qual-list[opt] * ]".
bool isStar = false;
- OwningExprResult NumElements(Actions);
+ OwningExprResult NumElements;
// Handle the case where we have '[*]' as the array size. However, a leading
// star could be the start of an expression, for example 'X[*p + 4]'. Verify
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Mon Aug 23 01:44:23 2010
@@ -1070,7 +1070,7 @@
ConsumeToken();
// Build up an array of parsed base specifiers.
- llvm::SmallVector<BaseTy *, 8> BaseInfo;
+ llvm::SmallVector<CXXBaseSpecifier *, 8> BaseInfo;
while (true) {
// Parse a base-specifier.
@@ -1406,8 +1406,8 @@
// member-declarator-list ',' member-declarator
llvm::SmallVector<Decl *, 8> DeclsInGroup;
- OwningExprResult BitfieldSize(Actions);
- OwningExprResult Init(Actions);
+ OwningExprResult BitfieldSize;
+ OwningExprResult Init;
bool Deleted = false;
while (1) {
@@ -1706,7 +1706,7 @@
SourceLocation ColonLoc = ConsumeToken();
- llvm::SmallVector<MemInitTy*, 4> MemInitializers;
+ llvm::SmallVector<CXXBaseOrMemberInitializer*, 4> MemInitializers;
bool AnyErrors = false;
do {
Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Mon Aug 23 01:44:23 2010
@@ -200,7 +200,7 @@
/// process of disambiguating between an expression and a declaration.
Parser::OwningExprResult
Parser::ParseExpressionWithLeadingExtension(SourceLocation ExtLoc) {
- OwningExprResult LHS(Actions, true);
+ OwningExprResult LHS(true);
{
// Silence extension warnings in the sub-expression
ExtensionRAIIObject O(Diags);
@@ -290,7 +290,7 @@
ConsumeToken();
// Special case handling for the ternary operator.
- OwningExprResult TernaryMiddle(Actions, true);
+ OwningExprResult TernaryMiddle(true);
if (NextTokPrec == prec::Conditional) {
if (Tok.isNot(tok::colon)) {
// Don't parse FOO:BAR as if it were a typo for FOO::BAR.
@@ -357,7 +357,7 @@
// Therefore we need some special-casing here.
// Also note that the third operand of the conditional operator is
// an assignment-expression in C++.
- OwningExprResult RHS(Actions);
+ OwningExprResult RHS;
if (getLang().CPlusPlus && NextTokPrec <= prec::Conditional)
RHS = ParseAssignmentExpression();
else
@@ -549,7 +549,7 @@
bool isAddressOfOperand,
bool &NotCastExpr,
TypeTy *TypeOfCast) {
- OwningExprResult Res(Actions);
+ OwningExprResult Res;
tok::TokenKind SavedKind = Tok.getKind();
NotCastExpr = false;
@@ -1127,7 +1127,7 @@
OpTok.is(tok::kw___alignof) || OpTok.is(tok::kw_alignof)) &&
"Not a typeof/sizeof/alignof expression!");
- OwningExprResult Operand(Actions);
+ OwningExprResult Operand;
// If the operand doesn't start with an '(', it must be an expression.
if (Tok.isNot(tok::l_paren)) {
@@ -1241,7 +1241,7 @@
/// [GNU] offsetof-member-designator '[' expression ']'
///
Parser::OwningExprResult Parser::ParseBuiltinPrimaryExpression() {
- OwningExprResult Res(Actions);
+ OwningExprResult Res;
const IdentifierInfo *BuiltinII = Tok.getIdentifierInfo();
tok::TokenKind T = Tok.getKind();
@@ -1428,7 +1428,7 @@
assert(Tok.is(tok::l_paren) && "Not a paren expr!");
GreaterThanIsOperatorScope G(GreaterThanIsOperator, true);
SourceLocation OpenLoc = ConsumeParen();
- OwningExprResult Result(Actions, true);
+ OwningExprResult Result(true);
bool isAmbiguousTypeId;
CastTy = 0;
@@ -1479,7 +1479,7 @@
// Note that this doesn't parse the subsequent cast-expression, it just
// returns the parsed type to the callee.
if (stopIfCastExpr)
- return OwningExprResult(Actions);
+ return OwningExprResult();
// Reject the cast of super idiom in ObjC.
if (Tok.is(tok::identifier) && getLang().ObjC1 &&
@@ -1585,12 +1585,13 @@
/// [C++] assignment-expression
/// [C++] expression-list , assignment-expression
///
-bool Parser::ParseExpressionList(ExprListTy &Exprs, CommaLocsTy &CommaLocs,
+bool Parser::ParseExpressionList(llvm::SmallVectorImpl<Expr*> &Exprs,
+ llvm::SmallVectorImpl<SourceLocation> &CommaLocs,
void (Action::*Completer)(Scope *S,
- void *Data,
- ExprTy **Args,
+ Expr *Data,
+ Expr **Args,
unsigned NumArgs),
- void *Data) {
+ Expr *Data) {
while (1) {
if (Tok.is(tok::code_completion)) {
if (Completer)
@@ -1723,7 +1724,7 @@
}
- OwningExprResult Result(Actions, true);
+ OwningExprResult Result(true);
if (!Tok.is(tok::l_brace)) {
// Saw something like: ^expr
Diag(Tok, diag::err_expected_expression);
Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Mon Aug 23 01:44:23 2010
@@ -64,7 +64,7 @@
"Call sites of this function should be guarded by checking for C++");
if (Tok.is(tok::annot_cxxscope)) {
- SS.setScopeRep(Tok.getAnnotationValue());
+ SS.setScopeRep(static_cast<NestedNameSpecifier*>(Tok.getAnnotationValue()));
SS.setRange(Tok.getAnnotationRange());
ConsumeToken();
return false;
@@ -507,7 +507,7 @@
"typeid"))
return ExprError();
- OwningExprResult Result(Actions);
+ OwningExprResult Result;
if (isTypeIdInParens()) {
TypeResult Ty = ParseTypeName();
@@ -1698,7 +1698,8 @@
/// new-placement:
/// '(' expression-list ')'
///
-bool Parser::ParseExpressionListOrTypeId(ExprListTy &PlacementArgs,
+bool Parser::ParseExpressionListOrTypeId(
+ llvm::SmallVectorImpl<Expr*> &PlacementArgs,
Declarator &D) {
// The '(' was already consumed.
if (isTypeIdInParens()) {
@@ -1809,7 +1810,7 @@
assert(ExprType == CastExpr && "Compound literals are not ambiguous!");
assert(isTypeIdInParens() && "Not a type-id!");
- OwningExprResult Result(Actions, true);
+ OwningExprResult Result(true);
CastTy = 0;
// We need to disambiguate a very ugly part of the C++ syntax:
Modified: cfe/trunk/lib/Parse/ParseInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseInit.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseInit.cpp (original)
+++ cfe/trunk/lib/Parse/ParseInit.cpp Mon Aug 23 01:44:23 2010
@@ -137,7 +137,7 @@
// [4][foo bar] -> obsolete GNU designation with objc message send.
//
SourceLocation StartLoc = ConsumeBracket();
- OwningExprResult Idx(Actions);
+ OwningExprResult Idx;
// If Objective-C is enabled and this is a typename (class message
// send) or send to 'super', parse this as a message send
@@ -167,7 +167,7 @@
CheckArrayDesignatorSyntax(*this, StartLoc, Desig);
return ParseAssignmentExprWithObjCMessageExprStart(StartLoc,
SourceLocation(),
- TypeOrExpr,
+ TypeOrExpr,
ExprArg(Actions));
}
@@ -175,7 +175,7 @@
// whether we have a message send or an array designator; just
// adopt the expression for further analysis below.
// FIXME: potentially-potentially evaluated expression above?
- Idx = OwningExprResult(Actions, TypeOrExpr);
+ Idx = OwningExprResult(static_cast<Expr*>(TypeOrExpr));
} else if (getLang().ObjC1 && Tok.is(tok::identifier)) {
IdentifierInfo *II = Tok.getIdentifierInfo();
SourceLocation IILoc = Tok.getLocation();
@@ -330,7 +330,7 @@
// If we know that this cannot be a designation, just parse the nested
// initializer directly.
- OwningExprResult SubElt(Actions);
+ OwningExprResult SubElt;
if (MayBeDesignationStart(Tok.getKind(), PP))
SubElt = ParseInitializerWithPotentialDesignator();
else
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Mon Aug 23 01:44:23 2010
@@ -1458,7 +1458,7 @@
/// throw expression[opt];
///
Parser::OwningStmtResult Parser::ParseObjCThrowStmt(SourceLocation atLoc) {
- OwningExprResult Res(Actions);
+ OwningExprResult Res;
ConsumeToken(); // consume throw
if (Tok.isNot(tok::semi)) {
Res = ParseExpression();
@@ -1529,7 +1529,7 @@
return StmtError();
}
StmtVector CatchStmts(Actions);
- OwningStmtResult FinallyStmt(Actions);
+ OwningStmtResult FinallyStmt;
ParseScope TryScope(this, Scope::DeclScope);
OwningStmtResult TryBody(ParseCompoundStatementBody());
TryScope.Exit();
@@ -1574,7 +1574,7 @@
else // Skip over garbage, until we get to ')'. Eat the ')'.
SkipUntil(tok::r_paren, true, false);
- OwningStmtResult CatchBody(Actions, true);
+ OwningStmtResult CatchBody(true);
if (Tok.is(tok::l_brace))
CatchBody = ParseCompoundStatementBody();
else
@@ -1600,7 +1600,7 @@
ConsumeToken(); // consume finally
ParseScope FinallyScope(this, Scope::DeclScope);
- OwningStmtResult FinallyBody(Actions, true);
+ OwningStmtResult FinallyBody(true);
if (Tok.is(tok::l_brace))
FinallyBody = ParseCompoundStatementBody();
else
@@ -1874,7 +1874,7 @@
if (IsExpr)
return ParseObjCMessageExpressionBody(LBracLoc, SourceLocation(), 0,
- OwningExprResult(Actions, TypeOrExpr));
+ OwningExprResult(static_cast<Expr*>(TypeOrExpr)));
return ParseObjCMessageExpressionBody(LBracLoc, SourceLocation(),
TypeOrExpr, ExprArg(Actions));
Modified: cfe/trunk/lib/Parse/ParsePragma.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParsePragma.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParsePragma.cpp (original)
+++ cfe/trunk/lib/Parse/ParsePragma.cpp Mon Aug 23 01:44:23 2010
@@ -87,7 +87,7 @@
Action::PragmaPackKind Kind = Action::PPK_Default;
IdentifierInfo *Name = 0;
- Action::OwningExprResult Alignment(Actions);
+ Action::OwningExprResult Alignment;
SourceLocation LParenLoc = Tok.getLocation();
PP.Lex(Tok);
if (Tok.is(tok::numeric_constant)) {
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Mon Aug 23 01:44:23 2010
@@ -76,7 +76,7 @@
Parser::OwningStmtResult
Parser::ParseStatementOrDeclaration(bool OnlyStatement) {
const char *SemiError = 0;
- OwningStmtResult Res(Actions);
+ OwningStmtResult Res;
ParenBraceBracketBalancer BalancerRAIIObj(*this);
@@ -272,7 +272,7 @@
// TopLevelCase - This is the highest level we have parsed. 'case 1' in the
// example above.
- OwningStmtResult TopLevelCase(Actions, true);
+ OwningStmtResult TopLevelCase(true);
// DeepestParsedCaseStmt - This is the deepest statement we have parsed, which
// gets updated each time a new case is parsed, and whose body is unset so
@@ -301,7 +301,7 @@
// GNU case range extension.
SourceLocation DotDotDotLoc;
- OwningExprResult RHS(Actions);
+ OwningExprResult RHS;
if (Tok.is(tok::ellipsis)) {
Diag(Tok, diag::ext_gnu_case_range);
DotDotDotLoc = ConsumeToken();
@@ -336,7 +336,7 @@
} else {
// If this is the first case statement we parsed, it becomes TopLevelCase.
// Otherwise we link it into the current chain.
- StmtTy *NextDeepest = Case.get();
+ Stmt *NextDeepest = Case.get();
if (TopLevelCase.isInvalid())
TopLevelCase = move(Case);
else
@@ -350,7 +350,7 @@
assert(!TopLevelCase.isInvalid() && "Should have parsed at least one case!");
// If we found a non-case statement, start by parsing it.
- OwningStmtResult SubStmt(Actions);
+ OwningStmtResult SubStmt;
if (Tok.isNot(tok::r_brace)) {
SubStmt = ParseStatement();
@@ -468,7 +468,7 @@
typedef StmtVector StmtsTy;
StmtsTy Stmts(Actions);
while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) {
- OwningStmtResult R(Actions);
+ OwningStmtResult R;
if (Tok.isNot(tok::kw___extension__)) {
R = ParseStatementOrDeclaration(false);
} else {
@@ -611,7 +611,7 @@
ParseScope IfScope(this, Scope::DeclScope | Scope::ControlScope, C99orCXX);
// Parse the condition.
- OwningExprResult CondExp(Actions);
+ OwningExprResult CondExp;
Decl *CondVar = 0;
if (ParseParenExprOrCondition(CondExp, CondVar, IfLoc, true))
return StmtError();
@@ -649,7 +649,7 @@
// If it has an else, parse it.
SourceLocation ElseLoc;
SourceLocation ElseStmtLoc;
- OwningStmtResult ElseStmt(Actions);
+ OwningStmtResult ElseStmt;
if (Tok.is(tok::kw_else)) {
ElseLoc = ConsumeToken();
@@ -737,7 +737,7 @@
ParseScope SwitchScope(this, ScopeFlags);
// Parse the condition.
- OwningExprResult Cond(Actions);
+ OwningExprResult Cond;
Decl *CondVar = 0;
if (ParseParenExprOrCondition(Cond, CondVar, SwitchLoc, false))
return StmtError();
@@ -827,7 +827,7 @@
ParseScope WhileScope(this, ScopeFlags);
// Parse the condition.
- OwningExprResult Cond(Actions);
+ OwningExprResult Cond;
Decl *CondVar = 0;
if (ParseParenExprOrCondition(Cond, CondVar, WhileLoc, true))
return StmtError();
@@ -982,13 +982,13 @@
ParseScope ForScope(this, ScopeFlags);
SourceLocation LParenLoc = ConsumeParen();
- OwningExprResult Value(Actions);
+ OwningExprResult Value;
bool ForEach = false;
- OwningStmtResult FirstPart(Actions);
+ OwningStmtResult FirstPart;
bool SecondPartIsInvalid = false;
FullExprArg SecondPart(Actions);
- OwningExprResult Collection(Actions);
+ OwningExprResult Collection;
FullExprArg ThirdPart(Actions);
Decl *SecondVar = 0;
@@ -1051,7 +1051,7 @@
if (Tok.is(tok::semi)) { // for (...;;
// no second part.
} else {
- OwningExprResult Second(Actions);
+ OwningExprResult Second;
if (getLang().CPlusPlus)
ParseCXXCondition(Second, SecondVar, ForLoc, true);
else {
@@ -1132,7 +1132,7 @@
assert(Tok.is(tok::kw_goto) && "Not a goto stmt!");
SourceLocation GotoLoc = ConsumeToken(); // eat the 'goto'.
- OwningStmtResult Res(Actions);
+ OwningStmtResult Res;
if (Tok.is(tok::identifier)) {
Res = Actions.ActOnGotoStmt(GotoLoc, Tok.getLocation(),
Tok.getIdentifierInfo());
@@ -1193,7 +1193,7 @@
assert(Tok.is(tok::kw_return) && "Not a return stmt!");
SourceLocation ReturnLoc = ConsumeToken(); // eat the 'return'.
- OwningExprResult R(Actions);
+ OwningExprResult R;
if (Tok.isNot(tok::semi)) {
if (Tok.is(tok::code_completion)) {
Actions.CodeCompleteReturn(getCurScope());
Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Mon Aug 23 01:44:23 2010
@@ -601,7 +601,7 @@
// Per C++0x [basic.scope.pdecl]p9, we parse the default argument before
// we introduce the template parameter into the local scope.
SourceLocation EqualLoc;
- OwningExprResult DefaultArg(Actions);
+ OwningExprResult DefaultArg;
if (Tok.is(tok::equal)) {
EqualLoc = ConsumeToken();
Modified: cfe/trunk/lib/Sema/SemaCXXCast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCXXCast.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCXXCast.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCXXCast.cpp Mon Aug 23 01:44:23 2010
@@ -967,7 +967,7 @@
Sema::OwningExprResult Result
= InitSeq.Perform(Self, Entity, InitKind,
- Action::MultiExprArg(Self, (void**)&SrcExpr, 1));
+ Action::MultiExprArg(Self, &SrcExpr, 1));
if (Result.isInvalid()) {
msg = 0;
return TC_Failed;
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Aug 23 01:44:23 2010
@@ -4136,7 +4136,7 @@
} else if (!VDecl->isInvalidDecl()) {
InitializationSequence InitSeq(*this, Entity, Kind, &Init, 1);
OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, (void**)&Init, 1),
+ MultiExprArg(*this, &Init, 1),
&DclT);
if (Result.isInvalid()) {
VDecl->setInvalidDecl();
@@ -4207,7 +4207,7 @@
if (!VDecl->isInvalidDecl()) {
InitializationSequence InitSeq(*this, Entity, Kind, &Init, 1);
OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, (void**)&Init, 1),
+ MultiExprArg(*this, &Init, 1),
&DclT);
if (Result.isInvalid()) {
VDecl->setInvalidDecl();
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Mon Aug 23 01:44:23 2010
@@ -129,7 +129,7 @@
EqualLoc);
InitializationSequence InitSeq(*this, Entity, Kind, &Arg, 1);
OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, (void**)&Arg, 1));
+ MultiExprArg(*this, &Arg, 1));
if (Result.isInvalid())
return true;
Arg = Result.takeAs<Expr>();
@@ -1325,7 +1325,7 @@
OwningExprResult MemberInit =
InitSeq.Perform(*this, MemberEntity, Kind,
- MultiExprArg(*this, (void**)Args, NumArgs), 0);
+ MultiExprArg(*this, Args, NumArgs), 0);
if (MemberInit.isInvalid())
return true;
@@ -1457,7 +1457,7 @@
OwningExprResult BaseInit =
InitSeq.Perform(*this, BaseEntity, Kind,
- MultiExprArg(*this, (void**)Args, NumArgs), 0);
+ MultiExprArg(*this, Args, NumArgs), 0);
if (BaseInit.isInvalid())
return true;
@@ -1515,7 +1515,7 @@
= InitializedEntity::InitializeBase(SemaRef.Context, BaseSpec,
IsInheritedVirtualBase);
- Sema::OwningExprResult BaseInit(SemaRef);
+ Sema::OwningExprResult BaseInit;
switch (ImplicitInitKind) {
case IIK_Default: {
@@ -1553,7 +1553,7 @@
&CopyCtorArg, 1);
BaseInit = InitSeq.Perform(SemaRef, InitEntity, InitKind,
Sema::MultiExprArg(SemaRef,
- (void**)&CopyCtorArg, 1));
+ &CopyCtorArg, 1));
break;
}
@@ -1674,7 +1674,7 @@
Sema::OwningExprResult MemberInit
= InitSeq.Perform(SemaRef, Entities.back(), InitKind,
- Sema::MultiExprArg(SemaRef, (void**)&CopyCtorArgE, 1));
+ Sema::MultiExprArg(SemaRef, &CopyCtorArgE, 1));
MemberInit = SemaRef.MaybeCreateCXXExprWithTemporaries(move(MemberInit));
if (MemberInit.isInvalid())
return true;
@@ -4927,7 +4927,7 @@
// which they were declared in the class definition.
// The statements that form the synthesized function body.
- ASTOwningVector<&ActionBase::DeleteStmt> Statements(*this);
+ ASTOwningVector<Stmt*> Statements(*this);
// The parameter for the "other" object, which we are copying from.
ParmVarDecl *Other = CopyAssignOperator->getParamDecl(0);
@@ -5132,7 +5132,7 @@
assert(BuiltinMemCpyRef && "Builtin reference cannot fail");
}
- ASTOwningVector<&ActionBase::DeleteExpr> CallArgs(*this);
+ ASTOwningVector<Expr*> CallArgs(*this);
CallArgs.push_back(To.takeAs<Expr>());
CallArgs.push_back(From.takeAs<Expr>());
CallArgs.push_back(new (Context) IntegerLiteral(Size, SizeType, Loc));
@@ -5602,7 +5602,7 @@
Sema::CompleteConstructorCall(CXXConstructorDecl *Constructor,
MultiExprArg ArgsPtr,
SourceLocation Loc,
- ASTOwningVector<&ActionBase::DeleteExpr> &ConvertedArgs) {
+ ASTOwningVector<Expr*> &ConvertedArgs) {
// FIXME: This duplicates a lot of code from Sema::ConvertArgumentsForCall.
unsigned NumArgs = ArgsPtr.size();
Expr **Args = (Expr **)ArgsPtr.get();
@@ -6139,7 +6139,7 @@
SourceLocation());
InitializationSequence InitSeq(*this, Entity, Kind, &ExDeclRef, 1);
OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, (void**)&ExDeclRef, 1));
+ MultiExprArg(*this, &ExDeclRef, 1));
if (Result.isInvalid())
Invalid = true;
else
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Aug 23 01:44:23 2010
@@ -3344,7 +3344,7 @@
BaseArg = MaybeConvertParenListExprToParenExpr(S, move(BaseArg));
Expr *Base = BaseArg.takeAs<Expr>();
- OwningExprResult Result(*this);
+ OwningExprResult Result;
if (Base->getType()->isDependentType() || Name.isDependentName() ||
isDependentScopeSpecifier(SS)) {
Result = ActOnDependentMemberExpr(ExprArg(*this, Base), Base->getType(),
@@ -3417,7 +3417,7 @@
InitializationSequence InitSeq(*this, Entity, Kind, &ResultE, 1);
Result = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, (void**)&ResultE, 1));
+ MultiExprArg(*this, &ResultE, 1));
if (Result.isInvalid())
return ExprError();
@@ -3841,7 +3841,7 @@
/*IsCStyleCast=*/true);
InitializationSequence InitSeq(*this, Entity, Kind, &literalExpr, 1);
OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, (void**)&literalExpr, 1),
+ MultiExprArg(*this, &literalExpr, 1),
&literalType);
if (Result.isInvalid())
return ExprError();
@@ -4108,7 +4108,7 @@
if (!E)
return Owned(expr);
- OwningExprResult Result(*this, E->getExpr(0));
+ OwningExprResult Result(E->getExpr(0));
for (unsigned i = 1, e = E->getNumExprs(); i != e && !Result.isInvalid(); ++i)
Result = ActOnBinOp(S, E->getExprLoc(), tok::comma, move(Result),
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Mon Aug 23 01:44:23 2010
@@ -780,7 +780,7 @@
CXXConstructorDecl *Constructor = 0;
Expr **ConsArgs = (Expr**)ConstructorArgs.get();
unsigned NumConsArgs = ConstructorArgs.size();
- ASTOwningVector<&ActionBase::DeleteExpr> ConvertedConstructorArgs(*this);
+ ASTOwningVector<Expr*> ConvertedConstructorArgs(*this);
// Array 'new' can't have any initializers.
if (NumConsArgs && (ResultType->isArrayType() || ArraySize)) {
@@ -1592,10 +1592,10 @@
switch (Kind) {
default: assert(0 && "Unhandled cast kind!");
case CastExpr::CK_ConstructorConversion: {
- ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(S);
+ ASTOwningVector<Expr*> ConstructorArgs(S);
if (S.CompleteConstructorCall(cast<CXXConstructorDecl>(Method),
- Sema::MultiExprArg(S, (void **)&From, 1),
+ Sema::MultiExprArg(S, &From, 1),
CastLoc, ConstructorArgs))
return S.ExprError();
@@ -1723,9 +1723,9 @@
// FIXME: When can ToType be a reference type?
assert(!ToType->isReferenceType());
if (SCS.Second == ICK_Derived_To_Base) {
- ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(*this);
+ ASTOwningVector<Expr*> ConstructorArgs(*this);
if (CompleteConstructorCall(cast<CXXConstructorDecl>(SCS.CopyConstructor),
- MultiExprArg(*this, (void **)&From, 1),
+ MultiExprArg(*this, &From, 1),
/*FIXME:ConstructLoc*/SourceLocation(),
ConstructorArgs))
return true;
@@ -1741,7 +1741,7 @@
OwningExprResult FromResult =
BuildCXXConstructExpr(/*FIXME:ConstructLoc*/SourceLocation(),
ToType, SCS.CopyConstructor,
- MultiExprArg(*this, (void**)&From, 1));
+ MultiExprArg(*this, &From, 1));
if (FromResult.isInvalid())
return true;
@@ -2187,7 +2187,7 @@
SourceLocation());
InitializationSequence InitSeq(Self, Entity, Kind, &E, 1);
Sema::OwningExprResult Result = InitSeq.Perform(Self, Entity, Kind,
- Sema::MultiExprArg(Self, (void **)&E, 1));
+ Sema::MultiExprArg(Self, &E, 1));
if (Result.isInvalid())
return true;
@@ -2569,14 +2569,14 @@
// Convert E1 to Composite1
OwningExprResult E1Result
- = E1ToC1.Perform(*this, Entity1, Kind, MultiExprArg(*this,(void**)&E1,1));
+ = E1ToC1.Perform(*this, Entity1, Kind, MultiExprArg(*this,&E1,1));
if (E1Result.isInvalid())
return QualType();
E1 = E1Result.takeAs<Expr>();
// Convert E2 to Composite1
OwningExprResult E2Result
- = E2ToC1.Perform(*this, Entity1, Kind, MultiExprArg(*this,(void**)&E2,1));
+ = E2ToC1.Perform(*this, Entity1, Kind, MultiExprArg(*this,&E2,1));
if (E2Result.isInvalid())
return QualType();
E2 = E2Result.takeAs<Expr>();
@@ -2594,14 +2594,14 @@
// Convert E1 to Composite2
OwningExprResult E1Result
- = E1ToC2.Perform(*this, Entity2, Kind, MultiExprArg(*this, (void**)&E1, 1));
+ = E1ToC2.Perform(*this, Entity2, Kind, MultiExprArg(*this, &E1, 1));
if (E1Result.isInvalid())
return QualType();
E1 = E1Result.takeAs<Expr>();
// Convert E2 to Composite2
OwningExprResult E2Result
- = E2ToC2.Perform(*this, Entity2, Kind, MultiExprArg(*this, (void**)&E2, 1));
+ = E2ToC2.Perform(*this, Entity2, Kind, MultiExprArg(*this, &E2, 1));
if (E2Result.isInvalid())
return QualType();
E2 = E2Result.takeAs<Expr>();
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Mon Aug 23 01:44:23 2010
@@ -680,7 +680,7 @@
if (Seq) {
Sema::OwningExprResult Result =
Seq.Perform(SemaRef, Entity, Kind,
- Sema::MultiExprArg(SemaRef, (void **)&expr, 1));
+ Sema::MultiExprArg(SemaRef, &expr, 1));
if (Result.isInvalid())
hadError = true;
@@ -3411,7 +3411,7 @@
}
CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(Best->Function);
- ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(S);
+ ASTOwningVector<Expr*> ConstructorArgs(S);
CurInit.release(); // Ownership transferred into MultiExprArg, below.
S.CheckConstructorAccess(Loc, Constructor, Entity,
@@ -3447,9 +3447,7 @@
// constructor call (we might have derived-to-base conversions, or
// the copy constructor may have default arguments).
if (S.CompleteConstructorCall(Constructor,
- Sema::MultiExprArg(S,
- (void **)&CurInitExpr,
- 1),
+ Sema::MultiExprArg(S, &CurInitExpr, 1),
Loc, ConstructorArgs))
return S.ExprError();
@@ -3530,7 +3528,7 @@
}
if (Kind.getKind() == InitializationKind::IK_Copy || Kind.isExplicitCast())
- return Sema::OwningExprResult(S, Args.release()[0]);
+ return Sema::OwningExprResult(Args.release()[0]);
if (Args.size() == 0)
return S.Owned((Expr *)0);
@@ -3579,7 +3577,7 @@
case SK_StringInit:
case SK_ObjCObjectConversion:
assert(Args.size() == 1);
- CurInit = Sema::OwningExprResult(S, ((Expr **)(Args.get()))[0]->Retain());
+ CurInit = Sema::OwningExprResult(((Expr **)(Args.get()))[0]->Retain());
if (CurInit.isInvalid())
return S.ExprError();
break;
@@ -3703,16 +3701,14 @@
bool IsLvalue = false;
if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(Fn)) {
// Build a call to the selected constructor.
- ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(S);
+ ASTOwningVector<Expr*> ConstructorArgs(S);
SourceLocation Loc = CurInitExpr->getLocStart();
CurInit.release(); // Ownership transferred into MultiExprArg, below.
// Determine the arguments required to actually perform the constructor
// call.
if (S.CompleteConstructorCall(Constructor,
- Sema::MultiExprArg(S,
- (void **)&CurInitExpr,
- 1),
+ Sema::MultiExprArg(S, &CurInitExpr, 1),
Loc, ConstructorArgs))
return S.ExprError();
@@ -3838,7 +3834,7 @@
= cast<CXXConstructorDecl>(Step->Function.Function);
// Build a call to the selected constructor.
- ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(S);
+ ASTOwningVector<Expr*> ConstructorArgs(S);
SourceLocation Loc = (Kind.isCopyInit() && Kind.getEqualLoc().isValid())
? Kind.getEqualLoc()
: Kind.getLocation();
@@ -4464,6 +4460,5 @@
EqualLoc);
InitializationSequence Seq(*this, Entity, Kind, &InitE, 1);
Init.release();
- return Seq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, (void**)&InitE, 1));
+ return Seq.Perform(*this, Entity, Kind, MultiExprArg(*this, &InitE, 1));
}
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Mon Aug 23 01:44:23 2010
@@ -6556,7 +6556,7 @@
// an expression with non-empty lookup results, which should never
// end up here.
return SemaRef.ActOnCallExpr(/*Scope*/ 0, move(NewFn), LParenLoc,
- Sema::MultiExprArg(SemaRef, (void**) Args, NumArgs),
+ Sema::MultiExprArg(SemaRef, Args, NumArgs),
CommaLocs, RParenLoc);
}
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Mon Aug 23 01:44:23 2010
@@ -253,7 +253,7 @@
Expr **Args, unsigned NumArgs,
const MultiLevelTemplateArgumentList &TemplateArgs,
llvm::SmallVectorImpl<SourceLocation> &FakeCommaLocs,
- ASTOwningVector<&ActionBase::DeleteExpr> &InitArgs) {
+ ASTOwningVector<Expr*> &InitArgs) {
for (unsigned I = 0; I != NumArgs; ++I) {
// When we hit the first defaulted argument, break out of the loop:
// we don't pass those default arguments on.
@@ -292,7 +292,7 @@
const MultiLevelTemplateArgumentList &TemplateArgs,
SourceLocation &LParenLoc,
llvm::SmallVector<SourceLocation, 4> &CommaLocs,
- ASTOwningVector<&ActionBase::DeleteExpr> &NewArgs,
+ ASTOwningVector<Expr*> &NewArgs,
SourceLocation &RParenLoc) {
NewArgs.clear();
LParenLoc = SourceLocation();
@@ -421,7 +421,7 @@
// Instantiate the initializer.
SourceLocation LParenLoc, RParenLoc;
llvm::SmallVector<SourceLocation, 4> CommaLocs;
- ASTOwningVector<&ActionBase::DeleteExpr> InitArgs(SemaRef);
+ ASTOwningVector<Expr*> InitArgs(SemaRef);
if (!InstantiateInitializer(SemaRef, D->getInit(), TemplateArgs, LParenLoc,
CommaLocs, InitArgs, RParenLoc)) {
// Attach the initializer to the declaration.
@@ -591,7 +591,7 @@
if (InstantiatedAssertExpr.isInvalid())
return 0;
- OwningExprResult Message(SemaRef, D->getMessage());
+ OwningExprResult Message(D->getMessage());
D->getMessage()->Retain();
return SemaRef.ActOnStaticAssertDeclaration(D->getLocation(),
move(InstantiatedAssertExpr),
@@ -2251,7 +2251,7 @@
CXXBaseOrMemberInitializer *Init = *Inits;
SourceLocation LParenLoc, RParenLoc;
- ASTOwningVector<&ActionBase::DeleteExpr> NewArgs(*this);
+ ASTOwningVector<Expr*> NewArgs(*this);
llvm::SmallVector<SourceLocation, 4> CommaLocs;
// Instantiate the initializer.
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=111795&r1=111794&r2=111795&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Mon Aug 23 01:44:23 2010
@@ -1510,7 +1510,7 @@
SourceLocation LParenLoc,
ExprArg SubExpr,
SourceLocation RParenLoc) {
- void *Sub = SubExpr.takeAs<Expr>();
+ Expr *Sub = SubExpr.get();
return getSema().ActOnCXXTypeConstructExpr(TypeRange,
TInfo->getType().getAsOpaquePtr(),
LParenLoc,
@@ -1687,7 +1687,7 @@
MultiExprArg Args,
bool RequiresZeroInit,
CXXConstructExpr::ConstructionKind ConstructKind) {
- ASTOwningVector<&ActionBase::DeleteExpr> ConvertedArgs(SemaRef);
+ ASTOwningVector<Expr*> ConvertedArgs(SemaRef);
if (getSema().CompleteConstructorCall(Constructor, move(Args), Loc,
ConvertedArgs))
return getSema().ExprError();
@@ -3469,7 +3469,7 @@
TreeTransform<Derived>::TransformCompoundStmt(CompoundStmt *S,
bool IsStmtExpr) {
bool SubStmtChanged = false;
- ASTOwningVector<&ActionBase::DeleteStmt> Statements(getSema());
+ ASTOwningVector<Stmt*> Statements(getSema());
for (CompoundStmt::body_iterator B = S->body_begin(), BEnd = S->body_end();
B != BEnd; ++B) {
OwningStmtResult Result = getDerived().TransformStmt(*B);
@@ -3493,7 +3493,7 @@
template<typename Derived>
Sema::OwningStmtResult
TreeTransform<Derived>::TransformCaseStmt(CaseStmt *S) {
- OwningExprResult LHS(SemaRef), RHS(SemaRef);
+ OwningExprResult LHS, RHS;
{
// The case value expressions are not potentially evaluated.
EnterExpressionEvaluationContext Unevaluated(SemaRef, Action::Unevaluated);
@@ -3559,7 +3559,7 @@
Sema::OwningStmtResult
TreeTransform<Derived>::TransformIfStmt(IfStmt *S) {
// Transform the condition
- OwningExprResult Cond(SemaRef);
+ OwningExprResult Cond;
VarDecl *ConditionVar = 0;
if (S->getConditionVariable()) {
ConditionVar
@@ -3617,7 +3617,7 @@
Sema::OwningStmtResult
TreeTransform<Derived>::TransformSwitchStmt(SwitchStmt *S) {
// Transform the condition.
- OwningExprResult Cond(SemaRef);
+ OwningExprResult Cond;
VarDecl *ConditionVar = 0;
if (S->getConditionVariable()) {
ConditionVar
@@ -3655,7 +3655,7 @@
Sema::OwningStmtResult
TreeTransform<Derived>::TransformWhileStmt(WhileStmt *S) {
// Transform the condition
- OwningExprResult Cond(SemaRef);
+ OwningExprResult Cond;
VarDecl *ConditionVar = 0;
if (S->getConditionVariable()) {
ConditionVar
@@ -3733,7 +3733,7 @@
return SemaRef.StmtError();
// Transform the condition
- OwningExprResult Cond(SemaRef);
+ OwningExprResult Cond;
VarDecl *ConditionVar = 0;
if (S->getConditionVariable()) {
ConditionVar
@@ -3874,12 +3874,12 @@
Sema::OwningStmtResult
TreeTransform<Derived>::TransformAsmStmt(AsmStmt *S) {
- ASTOwningVector<&ActionBase::DeleteExpr> Constraints(getSema());
- ASTOwningVector<&ActionBase::DeleteExpr> Exprs(getSema());
+ ASTOwningVector<Expr*> Constraints(getSema());
+ ASTOwningVector<Expr*> Exprs(getSema());
llvm::SmallVector<IdentifierInfo *, 4> Names;
- OwningExprResult AsmString(SemaRef);
- ASTOwningVector<&ActionBase::DeleteExpr> Clobbers(getSema());
+ OwningExprResult AsmString;
+ ASTOwningVector<Expr*> Clobbers(getSema());
bool ExprsChanged = false;
@@ -3954,7 +3954,7 @@
// Transform the @catch statements (if present).
bool AnyCatchChanged = false;
- ASTOwningVector<&ActionBase::DeleteStmt> CatchStmts(SemaRef);
+ ASTOwningVector<Stmt*> CatchStmts(SemaRef);
for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I) {
OwningStmtResult Catch = getDerived().TransformStmt(S->getCatchStmt(I));
if (Catch.isInvalid())
@@ -3965,7 +3965,7 @@
}
// Transform the @finally statement (if present).
- OwningStmtResult Finally(SemaRef);
+ OwningStmtResult Finally;
if (S->getFinallyStmt()) {
Finally = getDerived().TransformStmt(S->getFinallyStmt());
if (Finally.isInvalid())
@@ -4041,7 +4041,7 @@
template<typename Derived>
Sema::OwningStmtResult
TreeTransform<Derived>::TransformObjCAtThrowStmt(ObjCAtThrowStmt *S) {
- OwningExprResult Operand(SemaRef);
+ OwningExprResult Operand;
if (S->getThrowExpr()) {
Operand = getDerived().TransformExpr(S->getThrowExpr());
if (Operand.isInvalid())
@@ -4167,7 +4167,7 @@
// Transform the handlers.
bool HandlerChanged = false;
- ASTOwningVector<&ActionBase::DeleteStmt> Handlers(SemaRef);
+ ASTOwningVector<Stmt*> Handlers(SemaRef);
for (unsigned I = 0, N = S->getNumHandlers(); I != N; ++I) {
OwningStmtResult Handler
= getDerived().TransformCXXCatchStmt(S->getHandler(I));
@@ -4393,7 +4393,7 @@
E->getSourceRange());
}
- Sema::OwningExprResult SubExpr(SemaRef);
+ Sema::OwningExprResult SubExpr;
{
// C++0x [expr.sizeof]p1:
// The operand is either an expression, which is an unevaluated operand
@@ -4446,7 +4446,7 @@
// Transform arguments.
bool ArgChanged = false;
- ASTOwningVector<&ActionBase::DeleteExpr> Args(SemaRef);
+ ASTOwningVector<Expr*> Args(SemaRef);
llvm::SmallVector<SourceLocation, 4> FakeCommaLocs;
for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I) {
OwningExprResult Arg = getDerived().TransformExpr(E->getArg(I));
@@ -4700,7 +4700,7 @@
TreeTransform<Derived>::TransformInitListExpr(InitListExpr *E) {
bool InitChanged = false;
- ASTOwningVector<&ActionBase::DeleteExpr, 4> Inits(SemaRef);
+ ASTOwningVector<Expr*, 4> Inits(SemaRef);
for (unsigned I = 0, N = E->getNumInits(); I != N; ++I) {
OwningExprResult Init = getDerived().TransformExpr(E->getInit(I));
if (Init.isInvalid())
@@ -4728,7 +4728,7 @@
return SemaRef.ExprError();
// transform the designators.
- ASTOwningVector<&ActionBase::DeleteExpr, 4> ArrayExprs(SemaRef);
+ ASTOwningVector<Expr*, 4> ArrayExprs(SemaRef);
bool ExprChanged = false;
for (DesignatedInitExpr::designators_iterator D = E->designators_begin(),
DEnd = E->designators_end();
@@ -4828,7 +4828,7 @@
Sema::OwningExprResult
TreeTransform<Derived>::TransformParenListExpr(ParenListExpr *E) {
bool ArgumentChanged = false;
- ASTOwningVector<&ActionBase::DeleteExpr, 4> Inits(SemaRef);
+ ASTOwningVector<Expr*, 4> Inits(SemaRef);
for (unsigned I = 0, N = E->getNumExprs(); I != N; ++I) {
OwningExprResult Init = getDerived().TransformExpr(E->getExpr(I));
if (Init.isInvalid())
@@ -4954,7 +4954,7 @@
static_cast<Expr *>(Object.get())->getLocEnd());
// Transform the call arguments.
- ASTOwningVector<&ActionBase::DeleteExpr> Args(SemaRef);
+ ASTOwningVector<Expr*> Args(SemaRef);
llvm::SmallVector<SourceLocation, 4> FakeCommaLocs;
for (unsigned I = 1, N = E->getNumArgs(); I != N; ++I) {
if (getDerived().DropCallArgument(E->getArg(I)))
@@ -5004,7 +5004,7 @@
if (First.isInvalid())
return SemaRef.ExprError();
- OwningExprResult Second(SemaRef);
+ OwningExprResult Second;
if (E->getNumArgs() == 2) {
Second = getDerived().TransformExpr(E->getArg(1));
if (Second.isInvalid())
@@ -5266,7 +5266,7 @@
// Transform the placement arguments (if any).
bool ArgumentChanged = false;
- ASTOwningVector<&ActionBase::DeleteExpr> PlacementArgs(SemaRef);
+ ASTOwningVector<Expr*> PlacementArgs(SemaRef);
for (unsigned I = 0, N = E->getNumPlacementArgs(); I != N; ++I) {
OwningExprResult Arg = getDerived().TransformExpr(E->getPlacementArg(I));
if (Arg.isInvalid())
@@ -5277,7 +5277,7 @@
}
// transform the constructor arguments (if any).
- ASTOwningVector<&ActionBase::DeleteExpr> ConstructorArgs(SemaRef);
+ ASTOwningVector<Expr*> ConstructorArgs(SemaRef);
for (unsigned I = 0, N = E->getNumConstructorArgs(); I != N; ++I) {
if (getDerived().DropCallArgument(E->getConstructorArg(I)))
break;
@@ -5660,7 +5660,7 @@
return SemaRef.ExprError();
bool ArgumentChanged = false;
- ASTOwningVector<&ActionBase::DeleteExpr> Args(SemaRef);
+ ASTOwningVector<Expr*> Args(SemaRef);
for (CXXConstructExpr::arg_iterator Arg = E->arg_begin(),
ArgEnd = E->arg_end();
Arg != ArgEnd; ++Arg) {
@@ -5743,7 +5743,7 @@
return SemaRef.ExprError();
bool ArgumentChanged = false;
- ASTOwningVector<&ActionBase::DeleteExpr> Args(SemaRef);
+ ASTOwningVector<Expr*> Args(SemaRef);
Args.reserve(E->getNumArgs());
for (CXXTemporaryObjectExpr::arg_iterator Arg = E->arg_begin(),
ArgEnd = E->arg_end();
@@ -5795,7 +5795,7 @@
return SemaRef.ExprError();
bool ArgumentChanged = false;
- ASTOwningVector<&ActionBase::DeleteExpr> Args(SemaRef);
+ ASTOwningVector<Expr*> Args(SemaRef);
llvm::SmallVector<SourceLocation, 8> FakeCommaLocs;
for (CXXUnresolvedConstructExpr::arg_iterator Arg = E->arg_begin(),
ArgEnd = E->arg_end();
@@ -5829,7 +5829,7 @@
TreeTransform<Derived>::TransformCXXDependentScopeMemberExpr(
CXXDependentScopeMemberExpr *E) {
// Transform the base of the expression.
- OwningExprResult Base(SemaRef, (Expr*) 0);
+ OwningExprResult Base((Expr*) 0);
Expr *OldBase;
QualType BaseType;
QualType ObjectType;
@@ -5926,7 +5926,7 @@
Sema::OwningExprResult
TreeTransform<Derived>::TransformUnresolvedMemberExpr(UnresolvedMemberExpr *Old) {
// Transform the base of the expression.
- OwningExprResult Base(SemaRef, (Expr*) 0);
+ OwningExprResult Base((Expr*) 0);
QualType BaseType;
if (!Old->isImplicitAccess()) {
Base = getDerived().TransformExpr(Old->getBase());
@@ -6049,7 +6049,7 @@
TreeTransform<Derived>::TransformObjCMessageExpr(ObjCMessageExpr *E) {
// Transform arguments.
bool ArgChanged = false;
- ASTOwningVector<&ActionBase::DeleteExpr> Args(SemaRef);
+ ASTOwningVector<Expr*> Args(SemaRef);
for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I) {
OwningExprResult Arg = getDerived().TransformExpr(E->getArg(I));
if (Arg.isInvalid())
@@ -6211,7 +6211,7 @@
Sema::OwningExprResult
TreeTransform<Derived>::TransformShuffleVectorExpr(ShuffleVectorExpr *E) {
bool ArgumentChanged = false;
- ASTOwningVector<&ActionBase::DeleteExpr> SubExprs(SemaRef);
+ ASTOwningVector<Expr*> SubExprs(SemaRef);
for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I) {
OwningExprResult SubExpr = getDerived().TransformExpr(E->getExpr(I));
if (SubExpr.isInvalid())
More information about the cfe-commits
mailing list