[cfe-commits] r103086 - in /cfe/trunk: include/clang/AST/Expr.h include/clang/AST/Makefile include/clang/AST/Stmt.h include/clang/AST/StmtNodes.def include/clang/AST/StmtNodes.td include/clang/AST/StmtVisitor.h include/clang/CMakeLists.txt include/clang/Makefile lib/AST/Expr.cpp lib/AST/Stmt.cpp lib/AST/StmtPrinter.cpp lib/AST/StmtProfile.cpp lib/CodeGen/Mangle.cpp lib/Sema/TreeTransform.h
Sean Hunt
rideau3 at gmail.com
Wed May 5 08:23:54 PDT 2010
Author: coppro
Date: Wed May 5 10:23:54 2010
New Revision: 103086
URL: http://llvm.org/viewvc/llvm-project?rev=103086&view=rev
Log:
Revert r103072; I accidentally ended up deleting a bunch of trailing
whitespace which makes this patch unreadable. Will recommit without the
whitespace.
Added:
cfe/trunk/include/clang/AST/StmtNodes.def
Removed:
cfe/trunk/include/clang/AST/Makefile
cfe/trunk/include/clang/AST/StmtNodes.td
Modified:
cfe/trunk/include/clang/AST/Expr.h
cfe/trunk/include/clang/AST/Stmt.h
cfe/trunk/include/clang/AST/StmtVisitor.h
cfe/trunk/include/clang/CMakeLists.txt
cfe/trunk/include/clang/Makefile
cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/lib/AST/Stmt.cpp
cfe/trunk/lib/AST/StmtPrinter.cpp
cfe/trunk/lib/AST/StmtProfile.cpp
cfe/trunk/lib/CodeGen/Mangle.cpp
cfe/trunk/lib/Sema/TreeTransform.h
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=103086&r1=103085&r2=103086&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Wed May 5 10:23:54 2010
@@ -203,13 +203,13 @@
/// \brief Returns whether this expression refers to a vector element.
bool refersToVectorElement() const;
-
+
/// isKnownToHaveBooleanValue - Return true if this is an integer expression
/// that is known to return 0 or 1. This happens for _Bool/bool expressions
/// but also int expressions which are produced by things like comparisons in
/// C.
bool isKnownToHaveBooleanValue() const;
-
+
/// isIntegerConstantExpr - Return true if this expression is a valid integer
/// constant expression, and, if so, return its value in Result. If not a
/// valid i-c-e, return false and fill in Loc (if specified) with the location
@@ -223,7 +223,7 @@
}
/// isConstantInitializer - Returns true if this expression is a constant
/// initializer, which can be emitted at compile-time.
- bool isConstantInitializer(ASTContext &Ctx) const;
+ bool isConstantInitializer(ASTContext &Ctx) const;
/// EvalResult is a struct with detailed info about an evaluated expression.
struct EvalResult {
@@ -269,11 +269,11 @@
bool isEvaluatable(ASTContext &Ctx) const;
/// HasSideEffects - This routine returns true for all those expressions
- /// which must be evaluated each time and must not be optimization away
+ /// which must be evaluated each time and must not be optimization away
/// or evaluated at compile time. Example is a function call, volatile
/// variable read.
bool HasSideEffects(ASTContext &Ctx) const;
-
+
/// EvaluateAsInt - Call Evaluate and return the folded integer. This
/// must be called on an expression that constant folds to an integer.
llvm::APSInt EvaluateAsInt(ASTContext &Ctx) const;
@@ -291,16 +291,16 @@
enum NullPointerConstantValueDependence {
/// \brief Specifies that the expression should never be value-dependent.
NPC_NeverValueDependent = 0,
-
+
/// \brief Specifies that a value-dependent expression of integral or
/// dependent type should be considered a null pointer constant.
NPC_ValueDependentIsNull,
-
+
/// \brief Specifies that a value-dependent expression should be considered
/// to never be a null pointer constant.
NPC_ValueDependentIsNotNull
};
-
+
/// isNullPointerConstant - C99 6.3.2.3p3 - Return true if this is either an
/// integer constant expression with the value zero, or if this is one that is
/// cast to void*.
@@ -329,12 +329,12 @@
/// \brief Determine whether this expression is a default function argument.
///
/// Default arguments are implicitly generated in the abstract syntax tree
- /// by semantic analysis for function calls, object constructions, etc. in
+ /// by semantic analysis for function calls, object constructions, etc. in
/// C++. Default arguments are represented by \c CXXDefaultArgExpr nodes;
/// this routine also looks through any implicit casts to determine whether
/// the expression is a default argument.
bool isDefaultArgument() const;
-
+
/// \brief Determine whether this expression directly creates a
/// temporary object (of class type).
bool isTemporaryObject() const { return getTemporaryObject() != 0; }
@@ -374,7 +374,7 @@
struct NameQualifier {
/// \brief The nested name specifier.
NestedNameSpecifier *NNS;
-
+
/// \brief The source range covered by the nested name specifier.
SourceRange Range;
};
@@ -384,20 +384,20 @@
struct ExplicitTemplateArgumentList {
/// \brief The source location of the left angle bracket ('<');
SourceLocation LAngleLoc;
-
+
/// \brief The source location of the right angle bracket ('>');
SourceLocation RAngleLoc;
-
+
/// \brief The number of template arguments in TemplateArgs.
/// The actual template arguments (if any) are stored after the
/// ExplicitTemplateArgumentList structure.
unsigned NumTemplateArgs;
-
+
/// \brief Retrieve the template arguments
TemplateArgumentLoc *getTemplateArgs() {
return reinterpret_cast<TemplateArgumentLoc *> (this + 1);
}
-
+
/// \brief Retrieve the template arguments
const TemplateArgumentLoc *getTemplateArgs() const {
return reinterpret_cast<const TemplateArgumentLoc *> (this + 1);
@@ -407,25 +407,25 @@
void copyInto(TemplateArgumentListInfo &List) const;
static std::size_t sizeFor(const TemplateArgumentListInfo &List);
};
-
+
/// DeclRefExpr - [C99 6.5.1p2] - A reference to a declared variable, function,
/// enum, etc.
class DeclRefExpr : public Expr {
enum {
- // Flag on DecoratedD that specifies when this declaration reference
+ // Flag on DecoratedD that specifies when this declaration reference
// expression has a C++ nested-name-specifier.
HasQualifierFlag = 0x01,
- // Flag on DecoratedD that specifies when this declaration reference
+ // Flag on DecoratedD that specifies when this declaration reference
// expression has an explicit C++ template argument list.
HasExplicitTemplateArgumentListFlag = 0x02
};
-
- // DecoratedD - The declaration that we are referencing, plus two bits to
+
+ // DecoratedD - The declaration that we are referencing, plus two bits to
// indicate whether (1) the declaration's name was explicitly qualified and
- // (2) the declaration's name was followed by an explicit template
+ // (2) the declaration's name was followed by an explicit template
// argument list.
llvm::PointerIntPair<ValueDecl *, 2> DecoratedD;
-
+
// Loc - The location of the declaration name itself.
SourceLocation Loc;
@@ -433,39 +433,39 @@
NameQualifier *getNameQualifier() {
if ((DecoratedD.getInt() & HasQualifierFlag) == 0)
return 0;
-
+
return reinterpret_cast<NameQualifier *> (this + 1);
}
-
+
/// \brief Retrieve the qualifier that preceded the member name, if any.
const NameQualifier *getNameQualifier() const {
return const_cast<DeclRefExpr *>(this)->getNameQualifier();
}
-
+
/// \brief Retrieve the explicit template argument list that followed the
/// member template name, if any.
ExplicitTemplateArgumentList *getExplicitTemplateArgumentList() {
if ((DecoratedD.getInt() & HasExplicitTemplateArgumentListFlag) == 0)
return 0;
-
+
if ((DecoratedD.getInt() & HasQualifierFlag) == 0)
return reinterpret_cast<ExplicitTemplateArgumentList *>(this + 1);
-
+
return reinterpret_cast<ExplicitTemplateArgumentList *>(
getNameQualifier() + 1);
}
-
+
/// \brief Retrieve the explicit template argument list that followed the
/// member template name, if any.
const ExplicitTemplateArgumentList *getExplicitTemplateArgumentList() const {
return const_cast<DeclRefExpr *>(this)->getExplicitTemplateArgumentList();
}
-
+
DeclRefExpr(NestedNameSpecifier *Qualifier, SourceRange QualifierRange,
ValueDecl *D, SourceLocation NameLoc,
const TemplateArgumentListInfo *TemplateArgs,
QualType T);
-
+
protected:
/// \brief Computes the type- and value-dependence flags for this
/// declaration reference expression.
@@ -493,7 +493,7 @@
SourceLocation NameLoc,
QualType T,
const TemplateArgumentListInfo *TemplateArgs = 0);
-
+
ValueDecl *getDecl() { return DecoratedD.getPointer(); }
const ValueDecl *getDecl() const { return DecoratedD.getPointer(); }
void setDecl(ValueDecl *NewD) { DecoratedD.setPointer(NewD); }
@@ -505,26 +505,26 @@
/// \brief Determine whether this declaration reference was preceded by a
/// C++ nested-name-specifier, e.g., \c N::foo.
bool hasQualifier() const { return DecoratedD.getInt() & HasQualifierFlag; }
-
+
/// \brief If the name was qualified, retrieves the source range of
/// the nested-name-specifier that precedes the name. Otherwise,
/// returns an empty source range.
SourceRange getQualifierRange() const {
if (!hasQualifier())
return SourceRange();
-
+
return getNameQualifier()->Range;
}
-
- /// \brief If the name was qualified, retrieves the nested-name-specifier
+
+ /// \brief If the name was qualified, retrieves the nested-name-specifier
/// that precedes the name. Otherwise, returns NULL.
NestedNameSpecifier *getQualifier() const {
if (!hasQualifier())
return 0;
-
+
return getNameQualifier()->NNS;
}
-
+
/// \brief Determines whether this member expression actually had a C++
/// template argument list explicitly specified, e.g., x.f<int>.
bool hasExplicitTemplateArgumentList() const {
@@ -537,43 +537,43 @@
if (hasExplicitTemplateArgumentList())
getExplicitTemplateArgumentList()->copyInto(List);
}
-
+
/// \brief Retrieve the location of the left angle bracket following the
/// member name ('<'), if any.
SourceLocation getLAngleLoc() const {
if (!hasExplicitTemplateArgumentList())
return SourceLocation();
-
+
return getExplicitTemplateArgumentList()->LAngleLoc;
}
-
+
/// \brief Retrieve the template arguments provided as part of this
/// template-id.
const TemplateArgumentLoc *getTemplateArgs() const {
if (!hasExplicitTemplateArgumentList())
return 0;
-
+
return getExplicitTemplateArgumentList()->getTemplateArgs();
}
-
+
/// \brief Retrieve the number of template arguments provided as part of this
/// template-id.
unsigned getNumTemplateArgs() const {
if (!hasExplicitTemplateArgumentList())
return 0;
-
+
return getExplicitTemplateArgumentList()->NumTemplateArgs;
}
-
+
/// \brief Retrieve the location of the right angle bracket following the
/// template arguments ('>').
SourceLocation getRAngleLoc() const {
if (!hasExplicitTemplateArgumentList())
return SourceLocation();
-
+
return getExplicitTemplateArgumentList()->RAngleLoc;
}
-
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == DeclRefExprClass;
}
@@ -601,7 +601,7 @@
IdentType Type;
public:
PredefinedExpr(SourceLocation l, QualType type, IdentType IT)
- : Expr(PredefinedExprClass, type, type->isDependentType(),
+ : Expr(PredefinedExprClass, type, type->isDependentType(),
type->isDependentType()), Loc(l), Type(IT) {}
/// \brief Construct an empty predefined expression.
@@ -1008,14 +1008,14 @@
/// @code
/// struct S {
/// float f;
-/// double d;
+/// double d;
/// };
/// struct T {
/// int i;
/// struct S s[10];
/// };
/// @endcode
-/// we can represent and evaluate the expression @c offsetof(struct T, s[2].d).
+/// we can represent and evaluate the expression @c offsetof(struct T, s[2].d).
class OffsetOfExpr : public Expr {
public:
@@ -1037,48 +1037,48 @@
private:
enum { MaskBits = 2, Mask = 0x03 };
-
+
/// \brief The source range that covers this part of the designator.
SourceRange Range;
-
+
/// \brief The data describing the designator, which comes in three
/// different forms, depending on the lower two bits.
- /// - An unsigned index into the array of Expr*'s stored after this node
+ /// - An unsigned index into the array of Expr*'s stored after this node
/// in memory, for [constant-expression] designators.
/// - A FieldDecl*, for references to a known field.
/// - An IdentifierInfo*, for references to a field with a given name
/// when the class type is dependent.
- /// - A CXXBaseSpecifier*, for references that look at a field in a
+ /// - A CXXBaseSpecifier*, for references that look at a field in a
/// base class.
uintptr_t Data;
-
+
public:
/// \brief Create an offsetof node that refers to an array element.
- OffsetOfNode(SourceLocation LBracketLoc, unsigned Index,
+ OffsetOfNode(SourceLocation LBracketLoc, unsigned Index,
SourceLocation RBracketLoc)
: Range(LBracketLoc, RBracketLoc), Data((Index << 2) | Array) { }
-
+
/// \brief Create an offsetof node that refers to a field.
- OffsetOfNode(SourceLocation DotLoc, FieldDecl *Field,
+ OffsetOfNode(SourceLocation DotLoc, FieldDecl *Field,
SourceLocation NameLoc)
- : Range(DotLoc.isValid()? DotLoc : NameLoc, NameLoc),
+ : Range(DotLoc.isValid()? DotLoc : NameLoc, NameLoc),
Data(reinterpret_cast<uintptr_t>(Field) | OffsetOfNode::Field) { }
-
+
/// \brief Create an offsetof node that refers to an identifier.
OffsetOfNode(SourceLocation DotLoc, IdentifierInfo *Name,
SourceLocation NameLoc)
- : Range(DotLoc.isValid()? DotLoc : NameLoc, NameLoc),
+ : Range(DotLoc.isValid()? DotLoc : NameLoc, NameLoc),
Data(reinterpret_cast<uintptr_t>(Name) | Identifier) { }
/// \brief Create an offsetof node that refers into a C++ base class.
explicit OffsetOfNode(const CXXBaseSpecifier *Base)
: Range(), Data(reinterpret_cast<uintptr_t>(Base) | OffsetOfNode::Base) {}
-
+
/// \brief Determine what kind of offsetof node this is.
- Kind getKind() const {
+ Kind getKind() const {
return static_cast<Kind>(Data & Mask);
}
-
+
/// \brief For an array element node, returns the index into the array
/// of expressions.
unsigned getArrayExprIndex() const {
@@ -1091,28 +1091,28 @@
assert(getKind() == Field);
return reinterpret_cast<FieldDecl *>(Data & ~(uintptr_t)Mask);
}
-
+
/// \brief For a field or identifier offsetof node, returns the name of
/// the field.
IdentifierInfo *getFieldName() const;
-
+
/// \brief For a base class node, returns the base specifier.
CXXBaseSpecifier *getBase() const {
assert(getKind() == Base);
- return reinterpret_cast<CXXBaseSpecifier *>(Data & ~(uintptr_t)Mask);
+ return reinterpret_cast<CXXBaseSpecifier *>(Data & ~(uintptr_t)Mask);
}
-
+
/// \brief Retrieve the source range that covers this offsetof node.
///
/// For an array element node, the source range contains the locations of
/// the square brackets. For a field or identifier node, the source range
- /// contains the location of the period (if there is one) and the
+ /// contains the location of the period (if there is one) and the
/// identifier.
SourceRange getRange() const { return Range; }
};
private:
-
+
SourceLocation OperatorLoc, RParenLoc;
// Base type;
TypeSourceInfo *TSInfo;
@@ -1120,26 +1120,26 @@
unsigned NumComps;
// Number of sub-expressions (i.e. array subscript expressions).
unsigned NumExprs;
-
- OffsetOfExpr(ASTContext &C, QualType type,
+
+ OffsetOfExpr(ASTContext &C, QualType type,
SourceLocation OperatorLoc, TypeSourceInfo *tsi,
- OffsetOfNode* compsPtr, unsigned numComps,
+ OffsetOfNode* compsPtr, unsigned numComps,
Expr** exprsPtr, unsigned numExprs,
SourceLocation RParenLoc);
explicit OffsetOfExpr(unsigned numComps, unsigned numExprs)
: Expr(OffsetOfExprClass, EmptyShell()),
- TSInfo(0), NumComps(numComps), NumExprs(numExprs) {}
+ TSInfo(0), NumComps(numComps), NumExprs(numExprs) {}
public:
-
- static OffsetOfExpr *Create(ASTContext &C, QualType type,
- SourceLocation OperatorLoc, TypeSourceInfo *tsi,
- OffsetOfNode* compsPtr, unsigned numComps,
+
+ static OffsetOfExpr *Create(ASTContext &C, QualType type,
+ SourceLocation OperatorLoc, TypeSourceInfo *tsi,
+ OffsetOfNode* compsPtr, unsigned numComps,
Expr** exprsPtr, unsigned numExprs,
SourceLocation RParenLoc);
- static OffsetOfExpr *CreateEmpty(ASTContext &C,
+ static OffsetOfExpr *CreateEmpty(ASTContext &C,
unsigned NumComps, unsigned NumExprs);
/// getOperatorLoc - Return the location of the operator.
@@ -1149,14 +1149,14 @@
/// \brief Return the location of the right parentheses.
SourceLocation getRParenLoc() const { return RParenLoc; }
void setRParenLoc(SourceLocation R) { RParenLoc = R; }
-
+
TypeSourceInfo *getTypeSourceInfo() const {
return TSInfo;
}
void setTypeSourceInfo(TypeSourceInfo *tsi) {
TSInfo = tsi;
}
-
+
const OffsetOfNode &getComponent(unsigned Idx) {
assert(Idx < NumComps && "Subscript out of range");
return reinterpret_cast<OffsetOfNode *> (this + 1)[Idx];
@@ -1166,7 +1166,7 @@
assert(Idx < NumComps && "Subscript out of range");
reinterpret_cast<OffsetOfNode *> (this + 1)[Idx] = ON;
}
-
+
unsigned getNumComponents() const {
return NumComps;
}
@@ -1182,7 +1182,7 @@
reinterpret_cast<Expr **>(
reinterpret_cast<OffsetOfNode *>(this+1) + NumComps)[Idx] = E;
}
-
+
unsigned getNumExpressions() const {
return NumExprs;
}
@@ -1468,10 +1468,13 @@
}
static bool classof(const Stmt *T) {
- return T->getStmtClass() >= firstCallExprConstant &&
- T->getStmtClass() <= lastCallExprConstant;
+ return T->getStmtClass() == CallExprClass ||
+ T->getStmtClass() == CXXOperatorCallExprClass ||
+ T->getStmtClass() == CXXMemberCallExprClass;
}
static bool classof(const CallExpr *) { return true; }
+ static bool classof(const CXXOperatorCallExpr *) { return true; }
+ static bool classof(const CXXMemberCallExpr *) { return true; }
// Iterators
virtual child_iterator child_begin();
@@ -1618,7 +1621,7 @@
if (hasExplicitTemplateArgumentList())
getExplicitTemplateArgumentList()->copyInto(List);
}
-
+
/// \brief Retrieve the location of the left angle bracket following the
/// member name ('<'), if any.
SourceLocation getLAngleLoc() const {
@@ -1797,47 +1800,47 @@
/// CK_DerivedToBaseMemberPointer - Member pointer in derived class to
/// member pointer in base class.
CK_DerivedToBaseMemberPointer,
-
+
/// CK_UserDefinedConversion - Conversion using a user defined type
/// conversion function.
CK_UserDefinedConversion,
/// CK_ConstructorConversion - Conversion by constructor
CK_ConstructorConversion,
-
+
/// CK_IntegralToPointer - Integral to pointer
CK_IntegralToPointer,
-
+
/// CK_PointerToIntegral - Pointer to integral
CK_PointerToIntegral,
-
+
/// CK_ToVoid - Cast to void.
CK_ToVoid,
-
+
/// CK_VectorSplat - Casting from an integer/floating type to an extended
- /// vector type with the same element type as the src type. Splats the
+ /// vector type with the same element type as the src type. Splats the
/// src expression into the destination expression.
CK_VectorSplat,
-
+
/// CK_IntegralCast - Casting between integral types of different size.
CK_IntegralCast,
/// CK_IntegralToFloating - Integral to floating point.
CK_IntegralToFloating,
-
+
/// CK_FloatingToIntegral - Floating point to integral.
CK_FloatingToIntegral,
-
+
/// CK_FloatingCast - Casting between floating types of different size.
CK_FloatingCast,
-
+
/// CK_MemberPointerToBoolean - Member pointer to boolean
CK_MemberPointerToBoolean,
- /// CK_AnyPointerToObjCPointerCast - Casting any pointer to objective-c
+ /// CK_AnyPointerToObjCPointerCast - Casting any pointer to objective-c
/// pointer
CK_AnyPointerToObjCPointerCast,
- /// CK_AnyPointerToBlockPointerCast - Casting any pointer to block
+ /// CK_AnyPointerToBlockPointerCast - Casting any pointer to block
/// pointer
CK_AnyPointerToBlockPointerCast
@@ -1930,8 +1933,14 @@
const CXXBaseSpecifierArray& getBasePath() const { return BasePath; }
static bool classof(const Stmt *T) {
- return T->getStmtClass() >= firstCastExprConstant &&
- T->getStmtClass() <= lastCastExprConstant;
+ StmtClass SC = T->getStmtClass();
+ if (SC >= CXXStaticCastExprClass && SC <= CXXFunctionalCastExprClass)
+ return true;
+
+ if (SC >= ImplicitCastExprClass && SC <= CStyleCastExprClass)
+ return true;
+
+ return false;
}
static bool classof(const CastExpr *) { return true; }
@@ -1961,9 +1970,9 @@
bool LvalueCast;
public:
- ImplicitCastExpr(QualType ty, CastKind kind, Expr *op,
+ ImplicitCastExpr(QualType ty, CastKind kind, Expr *op,
CXXBaseSpecifierArray BasePath, bool Lvalue)
- : CastExpr(ImplicitCastExprClass, ty, kind, op, BasePath),
+ : CastExpr(ImplicitCastExprClass, ty, kind, op, BasePath),
LvalueCast(Lvalue) { }
/// \brief Construct an empty implicit cast.
@@ -2028,8 +2037,13 @@
QualType getTypeAsWritten() const { return TInfo->getType(); }
static bool classof(const Stmt *T) {
- return T->getStmtClass() >= firstExplicitCastExprConstant &&
- T->getStmtClass() <= lastExplicitCastExprConstant;
+ StmtClass SC = T->getStmtClass();
+ if (SC >= CStyleCastExprClass && SC <= CStyleCastExprClass)
+ return true;
+ if (SC >= CXXStaticCastExprClass && SC <= CXXFunctionalCastExprClass)
+ return true;
+
+ return false;
}
static bool classof(const ExplicitCastExpr *) { return true; }
};
@@ -2184,8 +2198,8 @@
bool isShiftAssignOp() const { return Opc == ShlAssign || Opc == ShrAssign; }
static bool classof(const Stmt *S) {
- return S->getStmtClass() >= firstBinaryOperatorConstant &&
- S->getStmtClass() <= lastBinaryOperatorConstant;
+ return S->getStmtClass() == BinaryOperatorClass ||
+ S->getStmtClass() == CompoundAssignOperatorClass;
}
static bool classof(const BinaryOperator *) { return true; }
@@ -2866,7 +2880,7 @@
virtual void DoDestroy(ASTContext &C);
void DestroyDesignators(ASTContext &C);
-
+
public:
/// A field designator, e.g., ".x".
struct FieldDesignator {
@@ -3034,7 +3048,7 @@
Designator *getDesignator(unsigned Idx) { return &designators_begin()[Idx]; }
- void setDesignators(ASTContext &C, const Designator *Desigs,
+ void setDesignators(ASTContext &C, const Designator *Desigs,
unsigned NumDesigs);
Expr *getArrayIndex(const Designator& D);
Removed: cfe/trunk/include/clang/AST/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Makefile?rev=103085&view=auto
==============================================================================
--- cfe/trunk/include/clang/AST/Makefile (original)
+++ cfe/trunk/include/clang/AST/Makefile (removed)
@@ -1,13 +0,0 @@
-LEVEL = ../../../../..
-BUILT_SOURCES = StmtNodes.inc
-
-TABLEGEN_INC_FILES_COMMON = 1
-
-include $(LEVEL)/Makefile.common
-
-INPUT_TDS = $(PROJ_SRC_DIR)/StmtNodes.td
-
-$(ObjDir)/StmtNodes.inc.tmp : StmtNodes.td $(TBLGEN) $(ObjDir)/.dir
- $(Echo) "Building Clang statement node tables with tblgen"
- $(Verb) $(TableGen) -gen-clang-stmt-nodes -o $(call SYSPATH, $@) $<
-
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=103086&r1=103085&r2=103086&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Wed May 5 10:23:54 2010
@@ -99,24 +99,11 @@
NoStmtClass = 0,
#define STMT(CLASS, PARENT) CLASS##Class,
#define FIRST_STMT(CLASS) firstStmtConstant = CLASS##Class,
-// LAST_STMT will always come last
-#define LAST_STMT(CLASS) lastStmtConstant = CLASS##Class
+#define LAST_STMT(CLASS) lastStmtConstant = CLASS##Class,
#define FIRST_EXPR(CLASS) firstExprConstant = CLASS##Class,
-#define LAST_EXPR(CLASS) lastExprConstant = CLASS##Class,
-#define FIRST_CALLEXPR(CLASS) firstCallExprConstant = CLASS##Class,
-#define LAST_CALLEXPR(CLASS) lastCallExprConstant = CLASS##Class,
-#define FIRST_CASTEXPR(CLASS) firstCastExprConstant = CLASS##Class,
-#define LAST_CASTEXPR(CLASS) lastCastExprConstant = CLASS##Class,
-#define FIRST_EXPLICITCASTEXPR(CLASS) firstExplicitCastExprConstant = \
- CLASS##Class,
-#define LAST_EXPLICITCASTEXPR(CLASS) lastExplicitCastExprConstant = \
- CLASS##Class,
-#define FIRST_BINARYOPERATOR(CLASS) firstBinaryOperatorConstant = \
- CLASS##Class,
-#define LAST_BINARYOPERATOR(CLASS) lastBinaryOperatorConstant = \
- CLASS##Class,
-#define ABSTRACT(STMT)
-#include "clang/AST/StmtNodes.inc"
+#define LAST_EXPR(CLASS) lastExprConstant = CLASS##Class
+#define ABSTRACT_EXPR(CLASS, PARENT)
+#include "clang/AST/StmtNodes.def"
};
private:
/// \brief The statement class.
@@ -211,9 +198,9 @@
return this;
}
- StmtClass getStmtClass() const {
+ StmtClass getStmtClass() const {
assert(RefCount >= 1 && "Referencing already-destroyed statement!");
- return (StmtClass)sClass;
+ return (StmtClass)sClass;
}
const char *getStmtClassName() const;
@@ -633,10 +620,10 @@
/// \brief If non-NULL, the declaration in the "if" statement.
VarDecl *Var;
-
+
SourceLocation IfLoc;
SourceLocation ElseLoc;
-
+
public:
IfStmt(SourceLocation IL, VarDecl *var, Expr *cond, Stmt *then,
SourceLocation EL = SourceLocation(), Stmt *elsev = 0)
@@ -659,7 +646,7 @@
/// \endcode
VarDecl *getConditionVariable() const { return Var; }
void setConditionVariable(VarDecl *V) { Var = V; }
-
+
const Expr *getCond() const { return reinterpret_cast<Expr*>(SubExprs[COND]);}
void setCond(Expr *E) { SubExprs[COND] = reinterpret_cast<Stmt *>(E); }
const Stmt *getThen() const { return SubExprs[THEN]; }
@@ -711,8 +698,8 @@
virtual void DoDestroy(ASTContext &Ctx);
public:
- SwitchStmt(VarDecl *Var, Expr *cond)
- : Stmt(SwitchStmtClass), Var(Var), FirstCase(0)
+ SwitchStmt(VarDecl *Var, Expr *cond)
+ : Stmt(SwitchStmtClass), Var(Var), FirstCase(0)
{
SubExprs[COND] = reinterpret_cast<Stmt*>(cond);
SubExprs[BODY] = NULL;
@@ -785,7 +772,7 @@
SourceLocation WhileLoc;
public:
WhileStmt(VarDecl *Var, Expr *cond, Stmt *body, SourceLocation WL)
- : Stmt(WhileStmtClass), Var(Var)
+ : Stmt(WhileStmtClass), Var(Var)
{
SubExprs[COND] = reinterpret_cast<Stmt*>(cond);
SubExprs[BODY] = body;
@@ -827,7 +814,7 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
-
+
protected:
virtual void DoDestroy(ASTContext &Ctx);
};
@@ -893,10 +880,10 @@
SourceLocation LParenLoc, RParenLoc;
public:
- ForStmt(Stmt *Init, Expr *Cond, VarDecl *condVar, Expr *Inc, Stmt *Body,
+ ForStmt(Stmt *Init, Expr *Cond, VarDecl *condVar, Expr *Inc, Stmt *Body,
SourceLocation FL, SourceLocation LP, SourceLocation RP)
- : Stmt(ForStmtClass), CondVar(condVar), ForLoc(FL), LParenLoc(LP),
- RParenLoc(RP)
+ : Stmt(ForStmtClass), CondVar(condVar), ForLoc(FL), LParenLoc(LP),
+ RParenLoc(RP)
{
SubExprs[INIT] = Init;
SubExprs[COND] = reinterpret_cast<Stmt*>(Cond);
@@ -908,7 +895,7 @@
explicit ForStmt(EmptyShell Empty) : Stmt(ForStmtClass, Empty) { }
Stmt *getInit() { return SubExprs[INIT]; }
-
+
/// \brief Retrieve the variable declared in this "for" statement, if any.
///
/// In the following example, "y" is the condition variable.
@@ -919,7 +906,7 @@
/// \endcode
VarDecl *getConditionVariable() const { return CondVar; }
void setConditionVariable(VarDecl *V) { CondVar = V; }
-
+
Expr *getCond() { return reinterpret_cast<Expr*>(SubExprs[COND]); }
Expr *getInc() { return reinterpret_cast<Expr*>(SubExprs[INC]); }
Stmt *getBody() { return SubExprs[BODY]; }
@@ -952,7 +939,7 @@
// Iterators
virtual child_iterator child_begin();
virtual child_iterator child_end();
-
+
protected:
virtual void DoDestroy(ASTContext &Ctx);
};
@@ -1144,16 +1131,16 @@
protected:
virtual void DoDestroy(ASTContext &Ctx);
-
+
public:
- AsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple, bool isvolatile,
+ AsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple, bool isvolatile,
bool msasm, unsigned numoutputs, unsigned numinputs,
IdentifierInfo **names, StringLiteral **constraints,
Expr **exprs, StringLiteral *asmstr, unsigned numclobbers,
StringLiteral **clobbers, SourceLocation rparenloc);
/// \brief Build an empty inline-assembly statement.
- explicit AsmStmt(EmptyShell Empty) : Stmt(AsmStmtClass, Empty),
+ explicit AsmStmt(EmptyShell Empty) : Stmt(AsmStmtClass, Empty),
Names(0), Constraints(0), Exprs(0), Clobbers(0) { }
SourceLocation getAsmLoc() const { return AsmLoc; }
@@ -1235,7 +1222,7 @@
llvm::StringRef getOutputName(unsigned i) const {
if (IdentifierInfo *II = getOutputIdentifier(i))
return II->getName();
-
+
return llvm::StringRef();
}
@@ -1305,7 +1292,7 @@
StringLiteral **Constraints,
Stmt **Exprs,
unsigned NumOutputs,
- unsigned NumInputs,
+ unsigned NumInputs,
StringLiteral **Clobbers,
unsigned NumClobbers);
Added: cfe/trunk/include/clang/AST/StmtNodes.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtNodes.def?rev=103086&view=auto
==============================================================================
--- cfe/trunk/include/clang/AST/StmtNodes.def (added)
+++ cfe/trunk/include/clang/AST/StmtNodes.def Wed May 5 10:23:54 2010
@@ -0,0 +1,165 @@
+//===-- StmtNodes.def - Metadata about Stmt AST nodes -----------*- 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 AST Node info database.
+//
+//===---------------------------------------------------------------------===//
+
+#ifndef FIRST_STMT
+#define FIRST_STMT(CLASS)
+#define LAST_STMT(CLASS)
+#endif
+
+#ifndef FIRST_EXPR
+#define FIRST_EXPR(CLASS)
+#define LAST_EXPR(CLASS)
+#endif
+
+#ifndef EXPR
+# define EXPR(Type, Base) STMT(Type, Base)
+#endif
+
+#ifndef ABSTRACT_EXPR
+# define ABSTRACT_EXPR(Type, Base) EXPR(Type, Base)
+#endif
+
+// Normal Statements.
+STMT(NullStmt , Stmt)
+FIRST_STMT(NullStmt)
+STMT(CompoundStmt , Stmt)
+STMT(CaseStmt , SwitchCase)
+STMT(DefaultStmt , SwitchCase)
+STMT(LabelStmt , Stmt)
+STMT(IfStmt , Stmt)
+STMT(SwitchStmt , Stmt)
+STMT(WhileStmt , Stmt)
+STMT(DoStmt , Stmt)
+STMT(ForStmt , Stmt)
+STMT(GotoStmt , Stmt)
+STMT(IndirectGotoStmt, Stmt)
+STMT(ContinueStmt , Stmt)
+STMT(BreakStmt , Stmt)
+STMT(ReturnStmt , Stmt)
+STMT(DeclStmt , Stmt)
+STMT(SwitchCase , Stmt)
+
+// GNU Stmt Extensions
+STMT(AsmStmt , Stmt)
+
+// Obj-C statements
+STMT(ObjCAtTryStmt , Stmt)
+STMT(ObjCAtCatchStmt , Stmt)
+STMT(ObjCAtFinallyStmt , Stmt)
+STMT(ObjCAtThrowStmt , Stmt)
+STMT(ObjCAtSynchronizedStmt , Stmt)
+// Obj-C2 statements
+STMT(ObjCForCollectionStmt, Stmt)
+
+// C++ statements
+STMT(CXXCatchStmt, Stmt)
+STMT(CXXTryStmt , Stmt)
+
+LAST_STMT(CXXTryStmt)
+
+// Expressions.
+ABSTRACT_EXPR(Expr , Stmt)
+EXPR(PredefinedExpr , Expr)
+EXPR(DeclRefExpr , Expr)
+EXPR(IntegerLiteral , Expr)
+EXPR(FloatingLiteral , Expr)
+EXPR(ImaginaryLiteral , Expr)
+EXPR(StringLiteral , Expr)
+EXPR(CharacterLiteral , Expr)
+EXPR(ParenExpr , Expr)
+EXPR(UnaryOperator , Expr)
+EXPR(OffsetOfExpr , Expr)
+EXPR(SizeOfAlignOfExpr , Expr)
+EXPR(ArraySubscriptExpr , Expr)
+EXPR(CallExpr , Expr)
+EXPR(MemberExpr , Expr)
+ABSTRACT_EXPR(CastExpr , Expr)
+EXPR(BinaryOperator , Expr)
+EXPR(CompoundAssignOperator, BinaryOperator)
+EXPR(ConditionalOperator , Expr)
+EXPR(ImplicitCastExpr , CastExpr)
+ABSTRACT_EXPR(ExplicitCastExpr, CastExpr)
+EXPR(CStyleCastExpr , ExplicitCastExpr)
+EXPR(CompoundLiteralExpr , Expr)
+EXPR(ExtVectorElementExpr , Expr)
+EXPR(InitListExpr , Expr)
+EXPR(DesignatedInitExpr , Expr)
+EXPR(ImplicitValueInitExpr , Expr)
+EXPR(ParenListExpr , Expr)
+EXPR(VAArgExpr , Expr)
+
+// GNU Extensions.
+EXPR(AddrLabelExpr , Expr)
+EXPR(StmtExpr , Expr)
+EXPR(TypesCompatibleExpr , Expr)
+EXPR(ChooseExpr , Expr)
+EXPR(GNUNullExpr , Expr)
+
+// C++ Expressions.
+EXPR(CXXOperatorCallExpr , CallExpr)
+EXPR(CXXMemberCallExpr , CallExpr)
+ABSTRACT_EXPR(CXXNamedCastExpr , ExplicitCastExpr)
+EXPR(CXXStaticCastExpr , CXXNamedCastExpr)
+EXPR(CXXDynamicCastExpr , CXXNamedCastExpr)
+EXPR(CXXReinterpretCastExpr , CXXNamedCastExpr)
+EXPR(CXXConstCastExpr , CXXNamedCastExpr)
+EXPR(CXXFunctionalCastExpr , ExplicitCastExpr)
+EXPR(CXXTypeidExpr , Expr)
+EXPR(CXXBoolLiteralExpr , Expr)
+EXPR(CXXNullPtrLiteralExpr , Expr)
+EXPR(CXXThisExpr , Expr)
+EXPR(CXXThrowExpr , Expr)
+EXPR(CXXDefaultArgExpr , Expr)
+EXPR(CXXZeroInitValueExpr , Expr)
+EXPR(CXXNewExpr , Expr)
+EXPR(CXXDeleteExpr , Expr)
+EXPR(CXXPseudoDestructorExpr, Expr)
+EXPR(UnresolvedLookupExpr , Expr)
+EXPR(UnaryTypeTraitExpr , Expr)
+EXPR(DependentScopeDeclRefExpr , Expr)
+EXPR(CXXConstructExpr , Expr)
+EXPR(CXXBindTemporaryExpr , Expr)
+EXPR(CXXBindReferenceExpr , Expr)
+EXPR(CXXExprWithTemporaries , Expr)
+EXPR(CXXTemporaryObjectExpr , CXXConstructExpr)
+EXPR(CXXUnresolvedConstructExpr, Expr)
+EXPR(CXXDependentScopeMemberExpr, Expr)
+EXPR(UnresolvedMemberExpr , Expr)
+
+// Obj-C Expressions.
+EXPR(ObjCStringLiteral , Expr)
+EXPR(ObjCEncodeExpr , Expr)
+EXPR(ObjCMessageExpr , Expr)
+EXPR(ObjCSelectorExpr , Expr)
+EXPR(ObjCProtocolExpr , Expr)
+EXPR(ObjCIvarRefExpr , Expr)
+EXPR(ObjCPropertyRefExpr , Expr)
+EXPR(ObjCImplicitSetterGetterRefExpr , Expr)
+EXPR(ObjCSuperExpr , Expr)
+EXPR(ObjCIsaExpr , Expr)
+
+// Clang Extensions.
+EXPR(ShuffleVectorExpr , Expr)
+EXPR(BlockExpr , Expr)
+EXPR(BlockDeclRefExpr , Expr)
+
+FIRST_EXPR(PredefinedExpr)
+LAST_EXPR(BlockDeclRefExpr)
+
+#undef ABSTRACT_EXPR
+#undef EXPR
+#undef STMT
+#undef FIRST_STMT
+#undef LAST_STMT
+#undef FIRST_EXPR
+#undef LAST_EXPR
Removed: cfe/trunk/include/clang/AST/StmtNodes.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtNodes.td?rev=103085&view=auto
==============================================================================
--- cfe/trunk/include/clang/AST/StmtNodes.td (original)
+++ cfe/trunk/include/clang/AST/StmtNodes.td (removed)
@@ -1,127 +0,0 @@
-class Stmt<bit abstract = 0> {
- bit Abstract = abstract;
-}
-
-class DStmt<Stmt base, bit abstract = 0> : Stmt<abstract> {
- Stmt Base = base;
-}
-
-// Statements
-def NullStmt : Stmt;
-def CompoundStmt : Stmt;
-def LabelStmt : Stmt;
-def IfStmt : Stmt;
-def SwitchStmt : Stmt;
-def WhileStmt : Stmt;
-def DoStmt : Stmt;
-def ForStmt : Stmt;
-def GotoStmt : Stmt;
-def IndirectGotoStmt : Stmt;
-def ContinueStmt : Stmt;
-def BreakStmt : Stmt;
-def ReturnStmt : Stmt;
-def DeclStmt : Stmt;
-def SwitchCase : Stmt;
-def CaseStmt : DStmt<SwitchCase>;
-def DefaultStmt : DStmt<SwitchCase>;
-
-// GNU Extensions
-def AsmStmt : Stmt;
-
-// Obj-C statements
-def ObjCAtTryStmt : Stmt;
-def ObjCAtCatchStmt : Stmt;
-def ObjCAtFinallyStmt : Stmt;
-def ObjCAtThrowStmt : Stmt;
-def ObjCAtSynchronizedStmt : Stmt;
-def ObjCForCollectionStmt : Stmt;
-
-// C++ statments
-def CXXCatchStmt : Stmt;
-def CXXTryStmt : Stmt;
-
-// Expressions
-def Expr : Stmt<1>;
-def PredefinedExpr : DStmt<Expr>;
-def DeclRefExpr : DStmt<Expr>;
-def IntegerLiteral : DStmt<Expr>;
-def FloatingLiteral : DStmt<Expr>;
-def ImaginaryLiteral : DStmt<Expr>;
-def StringLiteral : DStmt<Expr>;
-def CharacterLiteral : DStmt<Expr>;
-def ParenExpr : DStmt<Expr>;
-def UnaryOperator : DStmt<Expr>;
-def OffsetOfExpr : DStmt<Expr>;
-def SizeOfAlignOfExpr : DStmt<Expr>;
-def ArraySubscriptExpr : DStmt<Expr>;
-def CallExpr : DStmt<Expr>;
-def MemberExpr : DStmt<Expr>;
-def CastExpr : DStmt<Expr, 1>;
-def BinaryOperator : DStmt<Expr>;
-def CompoundAssignOperator : DStmt<BinaryOperator>;
-def ConditionalOperator : DStmt<Expr>;
-def ImplicitCastExpr : DStmt<CastExpr>;
-def ExplicitCastExpr : DStmt<CastExpr, 1>;
-def CStyleCastExpr : DStmt<ExplicitCastExpr>;
-def CompoundLiteralExpr : DStmt<Expr>;
-def ExtVectorElementExpr : DStmt<Expr>;
-def InitListExpr : DStmt<Expr>;
-def DesignatedInitExpr : DStmt<Expr>;
-def ImplicitValueInitExpr : DStmt<Expr>;
-def ParenListExpr : DStmt<Expr>;
-def VAArgExpr : DStmt<Expr>;
-
-// GNU Extensions.
-def AddrLabelExpr : DStmt<Expr>;
-def StmtExpr : DStmt<Expr>;
-def TypesCompatibleExpr : DStmt<Expr>;
-def ChooseExpr : DStmt<Expr>;
-def GNUNullExpr : DStmt<Expr>;
-
-// C++ Expressions.
-def CXXOperatorCallExpr : DStmt<CallExpr>;
-def CXXMemberCallExpr : DStmt<CallExpr>;
-def CXXNamedCastExpr : DStmt<ExplicitCastExpr, 1>;
-def CXXStaticCastExpr : DStmt<CXXNamedCastExpr>;
-def CXXDynamicCastExpr : DStmt<CXXNamedCastExpr>;
-def CXXReinterpretCastExpr : DStmt<CXXNamedCastExpr>;
-def CXXConstCastExpr : DStmt<CXXNamedCastExpr>;
-def CXXFunctionalCastExpr : DStmt<ExplicitCastExpr>;
-def CXXTypeidExpr : DStmt<Expr>;
-def CXXBoolLiteralExpr : DStmt<Expr>;
-def CXXNullPtrLiteralExpr : DStmt<Expr>;
-def CXXThisExpr : DStmt<Expr>;
-def CXXThrowExpr : DStmt<Expr>;
-def CXXDefaultArgExpr : DStmt<Expr>;
-def CXXZeroInitValueExpr : DStmt<Expr>;
-def CXXNewExpr : DStmt<Expr>;
-def CXXDeleteExpr : DStmt<Expr>;
-def CXXPseudoDestructorExpr : DStmt<Expr>;
-def UnresolvedLookupExpr : DStmt<Expr>;
-def UnaryTypeTraitExpr : DStmt<Expr>;
-def DependentScopeDeclRefExpr : DStmt<Expr>;
-def CXXConstructExpr : DStmt<Expr>;
-def CXXBindTemporaryExpr : DStmt<Expr>;
-def CXXBindReferenceExpr : DStmt<Expr>;
-def CXXExprWithTemporaries : DStmt<Expr>;
-def CXXTemporaryObjectExpr : DStmt<CXXConstructExpr>;
-def CXXUnresolvedConstructExpr : DStmt<Expr>;
-def CXXDependentScopeMemberExpr : DStmt<Expr>;
-def UnresolvedMemberExpr : DStmt<Expr>;
-
-// Obj-C Expressions.
-def ObjCStringLiteral : DStmt<Expr>;
-def ObjCEncodeExpr : DStmt<Expr>;
-def ObjCMessageExpr : DStmt<Expr>;
-def ObjCSelectorExpr : DStmt<Expr>;
-def ObjCProtocolExpr : DStmt<Expr>;
-def ObjCIvarRefExpr : DStmt<Expr>;
-def ObjCPropertyRefExpr : DStmt<Expr>;
-def ObjCImplicitSetterGetterRefExpr : DStmt<Expr>;
-def ObjCSuperExpr : DStmt<Expr>;
-def ObjCIsaExpr : DStmt<Expr>;
-
-// Clang Extensions.
-def ShuffleVectorExpr : DStmt<Expr>;
-def BlockExpr : DStmt<Expr>;
-def BlockDeclRefExpr : DStmt<Expr>;
Modified: cfe/trunk/include/clang/AST/StmtVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtVisitor.h?rev=103086&r1=103085&r2=103086&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/StmtVisitor.h (original)
+++ cfe/trunk/include/clang/AST/StmtVisitor.h Wed May 5 10:23:54 2010
@@ -105,10 +105,10 @@
// Top switch stmt: dispatch to VisitFooStmt for each FooStmt.
switch (S->getStmtClass()) {
default: assert(0 && "Unknown stmt kind!");
-#define ABSTRACT(STMT)
+#define ABSTRACT_EXPR(CLASS, PARENT)
#define STMT(CLASS, PARENT) \
case Stmt::CLASS ## Class: DISPATCH(CLASS, CLASS);
-#include "clang/AST/StmtNodes.inc"
+#include "clang/AST/StmtNodes.def"
}
}
@@ -116,7 +116,7 @@
// back on VisitExpr or whatever else is the superclass.
#define STMT(CLASS, PARENT) \
RetTy Visit ## CLASS(CLASS *S) { DISPATCH(PARENT, PARENT); }
-#include "clang/AST/StmtNodes.inc"
+#include "clang/AST/StmtNodes.def"
// If the implementation doesn't implement binary operator methods, fall back
// on VisitBinaryOperator.
Modified: cfe/trunk/include/clang/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/CMakeLists.txt?rev=103086&r1=103085&r2=103086&view=diff
==============================================================================
--- cfe/trunk/include/clang/CMakeLists.txt (original)
+++ cfe/trunk/include/clang/CMakeLists.txt Wed May 5 10:23:54 2010
@@ -1,3 +1,2 @@
-add_subdirectory(AST)
add_subdirectory(Basic)
add_subdirectory(Driver)
Modified: cfe/trunk/include/clang/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Makefile?rev=103086&r1=103085&r2=103086&view=diff
==============================================================================
--- cfe/trunk/include/clang/Makefile (original)
+++ cfe/trunk/include/clang/Makefile Wed May 5 10:23:54 2010
@@ -1,5 +1,5 @@
LEVEL = ../../../..
-DIRS := AST Basic Driver
+DIRS := Basic Driver
include $(LEVEL)/Makefile.common
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=103086&r1=103085&r2=103086&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Wed May 5 10:23:54 2010
@@ -34,12 +34,12 @@
bool Expr::isKnownToHaveBooleanValue() const {
// If this value has _Bool type, it is obvious 0/1.
if (getType()->isBooleanType()) return true;
- // If this is a non-scalar-integer type, we don't care enough to try.
+ // If this is a non-scalar-integer type, we don't care enough to try.
if (!getType()->isIntegralType()) return false;
-
+
if (const ParenExpr *PE = dyn_cast<ParenExpr>(this))
return PE->getSubExpr()->isKnownToHaveBooleanValue();
-
+
if (const UnaryOperator *UO = dyn_cast<UnaryOperator>(this)) {
switch (UO->getOpcode()) {
case UnaryOperator::Plus:
@@ -49,10 +49,10 @@
return false;
}
}
-
+
if (const CastExpr *CE = dyn_cast<CastExpr>(this))
return CE->getSubExpr()->isKnownToHaveBooleanValue();
-
+
if (const BinaryOperator *BO = dyn_cast<BinaryOperator>(this)) {
switch (BO->getOpcode()) {
default: return false;
@@ -65,24 +65,24 @@
case BinaryOperator::LAnd: // AND operator.
case BinaryOperator::LOr: // Logical OR operator.
return true;
-
+
case BinaryOperator::And: // Bitwise AND operator.
case BinaryOperator::Xor: // Bitwise XOR operator.
case BinaryOperator::Or: // Bitwise OR operator.
// Handle things like (x==2)|(y==12).
return BO->getLHS()->isKnownToHaveBooleanValue() &&
BO->getRHS()->isKnownToHaveBooleanValue();
-
+
case BinaryOperator::Comma:
case BinaryOperator::Assign:
return BO->getRHS()->isKnownToHaveBooleanValue();
}
}
-
+
if (const ConditionalOperator *CO = dyn_cast<ConditionalOperator>(this))
return CO->getTrueExpr()->isKnownToHaveBooleanValue() &&
CO->getFalseExpr()->isKnownToHaveBooleanValue();
-
+
return false;
}
@@ -118,13 +118,13 @@
void DeclRefExpr::computeDependence() {
TypeDependent = false;
ValueDependent = false;
-
+
NamedDecl *D = getDecl();
// (TD) C++ [temp.dep.expr]p3:
// An id-expression is type-dependent if it contains:
//
- // and
+ // and
//
// (VD) C++ [temp.dep.constexpr]p2:
// An identifier is value-dependent if it is:
@@ -136,16 +136,16 @@
ValueDependent = true;
}
// (TD) - a conversion-function-id that specifies a dependent type
- else if (D->getDeclName().getNameKind()
+ else if (D->getDeclName().getNameKind()
== DeclarationName::CXXConversionFunctionName &&
D->getDeclName().getCXXNameType()->isDependentType()) {
TypeDependent = true;
ValueDependent = true;
}
// (TD) - a template-id that is dependent,
- else if (hasExplicitTemplateArgumentList() &&
+ else if (hasExplicitTemplateArgumentList() &&
TemplateSpecializationType::anyDependentTemplateArguments(
- getTemplateArgs(),
+ getTemplateArgs(),
getNumTemplateArgs())) {
TypeDependent = true;
ValueDependent = true;
@@ -168,7 +168,7 @@
// (handled by DependentScopeDeclRefExpr)
}
-DeclRefExpr::DeclRefExpr(NestedNameSpecifier *Qualifier,
+DeclRefExpr::DeclRefExpr(NestedNameSpecifier *Qualifier,
SourceRange QualifierRange,
ValueDecl *D, SourceLocation NameLoc,
const TemplateArgumentListInfo *TemplateArgs,
@@ -183,7 +183,7 @@
NQ->NNS = Qualifier;
NQ->Range = QualifierRange;
}
-
+
if (TemplateArgs)
getExplicitTemplateArgumentList()->initializeFrom(*TemplateArgs);
@@ -200,10 +200,10 @@
std::size_t Size = sizeof(DeclRefExpr);
if (Qualifier != 0)
Size += sizeof(NameQualifier);
-
+
if (TemplateArgs)
Size += ExplicitTemplateArgumentList::sizeFor(*TemplateArgs);
-
+
void *Mem = Context.Allocate(Size, llvm::alignof<DeclRefExpr>());
return new (Mem) DeclRefExpr(Qualifier, QualifierRange, D, NameLoc,
TemplateArgs, T);
@@ -212,7 +212,7 @@
SourceRange DeclRefExpr::getSourceRange() const {
// FIXME: Does not handle multi-token names well, e.g., operator[].
SourceRange R(Loc);
-
+
if (hasQualifier())
R.setBegin(getQualifierRange().getBegin());
if (hasExplicitTemplateArgumentList())
@@ -549,14 +549,14 @@
return FnType->getResultType();
}
-OffsetOfExpr *OffsetOfExpr::Create(ASTContext &C, QualType type,
+OffsetOfExpr *OffsetOfExpr::Create(ASTContext &C, QualType type,
SourceLocation OperatorLoc,
- TypeSourceInfo *tsi,
- OffsetOfNode* compsPtr, unsigned numComps,
+ TypeSourceInfo *tsi,
+ OffsetOfNode* compsPtr, unsigned numComps,
Expr** exprsPtr, unsigned numExprs,
SourceLocation RParenLoc) {
void *Mem = C.Allocate(sizeof(OffsetOfExpr) +
- sizeof(OffsetOfNode) * numComps +
+ sizeof(OffsetOfNode) * numComps +
sizeof(Expr*) * numExprs);
return new (Mem) OffsetOfExpr(C, type, OperatorLoc, tsi, compsPtr, numComps,
@@ -571,22 +571,22 @@
return new (Mem) OffsetOfExpr(numComps, numExprs);
}
-OffsetOfExpr::OffsetOfExpr(ASTContext &C, QualType type,
+OffsetOfExpr::OffsetOfExpr(ASTContext &C, QualType type,
SourceLocation OperatorLoc, TypeSourceInfo *tsi,
- OffsetOfNode* compsPtr, unsigned numComps,
+ OffsetOfNode* compsPtr, unsigned numComps,
Expr** exprsPtr, unsigned numExprs,
SourceLocation RParenLoc)
- : Expr(OffsetOfExprClass, type, /*TypeDependent=*/false,
+ : Expr(OffsetOfExprClass, type, /*TypeDependent=*/false,
/*ValueDependent=*/tsi->getType()->isDependentType() ||
hasAnyTypeDependentArguments(exprsPtr, numExprs) ||
hasAnyValueDependentArguments(exprsPtr, numExprs)),
- OperatorLoc(OperatorLoc), RParenLoc(RParenLoc), TSInfo(tsi),
- NumComps(numComps), NumExprs(numExprs)
+ OperatorLoc(OperatorLoc), RParenLoc(RParenLoc), TSInfo(tsi),
+ NumComps(numComps), NumExprs(numExprs)
{
for(unsigned i = 0; i < numComps; ++i) {
setComponent(i, compsPtr[i]);
}
-
+
for(unsigned i = 0; i < numExprs; ++i) {
setIndexExpr(i, exprsPtr[i]);
}
@@ -596,7 +596,7 @@
assert(getKind() == Field || getKind() == Identifier);
if (getKind() == Field)
return getField()->getIdentifier();
-
+
return reinterpret_cast<IdentifierInfo *> (Data & ~(uintptr_t)Mask);
}
@@ -714,22 +714,22 @@
CastExpr *E = this;
do {
SubExpr = E->getSubExpr();
-
+
// Skip any temporary bindings; they're implicit.
if (CXXBindTemporaryExpr *Binder = dyn_cast<CXXBindTemporaryExpr>(SubExpr))
SubExpr = Binder->getSubExpr();
-
+
// Conversions by constructor and conversion functions have a
// subexpression describing the call; strip it off.
if (E->getCastKind() == CastExpr::CK_ConstructorConversion)
SubExpr = cast<CXXConstructExpr>(SubExpr)->getArg(0);
else if (E->getCastKind() == CastExpr::CK_UserDefinedConversion)
SubExpr = cast<CXXMemberCallExpr>(SubExpr)->getImplicitObjectArgument();
-
+
// If the subexpression we're left with is an implicit cast, look
// through that, too.
- } while ((E = dyn_cast<ImplicitCastExpr>(SubExpr)));
-
+ } while ((E = dyn_cast<ImplicitCastExpr>(SubExpr)));
+
return SubExpr;
}
@@ -842,15 +842,15 @@
: Expr(InitListExprClass, QualType(), false, false),
InitExprs(C, numInits),
LBraceLoc(lbraceloc), RBraceLoc(rbraceloc), SyntacticForm(0),
- UnionFieldInit(0), HadArrayRangeDesignator(false)
-{
+ UnionFieldInit(0), HadArrayRangeDesignator(false)
+{
for (unsigned I = 0; I != numInits; ++I) {
if (initExprs[I]->isTypeDependent())
TypeDependent = true;
if (initExprs[I]->isValueDependent())
ValueDependent = true;
}
-
+
InitExprs.insert(C, InitExprs.end(), initExprs, initExprs+numInits);
}
@@ -1091,7 +1091,7 @@
if (getType()->isVoidType())
return false;
const CastExpr *CE = cast<CastExpr>(this);
-
+
// If this is a cast to void or a constructor conversion, check the operand.
// Otherwise, the result of the cast is unused.
if (CE->getCastKind() == CastExpr::CK_ToVoid ||
@@ -1234,7 +1234,7 @@
// Not an lvalue.
return LV_InvalidExpression;
}
-
+
// C99 6.5.2.3p4
if (m->isArrow())
return LV_Valid;
@@ -1242,8 +1242,8 @@
if (BaseExp->getStmtClass() == ObjCPropertyRefExprClass ||
BaseExp->getStmtClass() == ObjCImplicitSetterGetterRefExprClass)
return LV_SubObjCPropertySetting;
- return
- BaseExp->isLvalue(Ctx);
+ return
+ BaseExp->isLvalue(Ctx);
}
case UnaryOperatorClass:
if (cast<UnaryOperator>(this)->getOpcode() == UnaryOperator::Deref)
@@ -1280,13 +1280,13 @@
return BinOp->getRHS()->isLvalue(Ctx);
// C++ [expr.mptr.oper]p6
- // The result of a .* expression is an lvalue only if its first operand is
- // an lvalue and its second operand is a pointer to data member.
+ // The result of a .* expression is an lvalue only if its first operand is
+ // an lvalue and its second operand is a pointer to data member.
if (BinOp->getOpcode() == BinaryOperator::PtrMemD &&
!BinOp->getType()->isFunctionType())
return BinOp->getLHS()->isLvalue(Ctx);
- // The result of an ->* expression is an lvalue only if its second operand
+ // The result of an ->* expression is an lvalue only if its second operand
// is a pointer to data member.
if (BinOp->getOpcode() == BinaryOperator::PtrMemI &&
!BinOp->getType()->isFunctionType()) {
@@ -1294,7 +1294,7 @@
if (Ty->isMemberPointerType() && !Ty->isMemberFunctionPointerType())
return LV_Valid;
}
-
+
if (!BinOp->isAssignmentOp())
return LV_InvalidExpression;
@@ -1365,7 +1365,7 @@
// If this is a conversion to a class temporary, make a note of
// that.
- if (Ctx.getLangOptions().CPlusPlus &&
+ if (Ctx.getLangOptions().CPlusPlus &&
cast<ExplicitCastExpr>(this)->getTypeAsWritten()->isRecordType())
return LV_ClassTemporary;
@@ -1594,7 +1594,7 @@
const Expr *E = this;
while (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(E))
E = ICE->getSubExprAsWritten();
-
+
return isa<CXXDefaultArgExpr>(E);
}
@@ -1617,7 +1617,7 @@
else
break;
}
-
+
return E;
}
@@ -1745,13 +1745,13 @@
// cast-to-union extension.
if (getType()->isRecordType())
return cast<CastExpr>(this)->getSubExpr()->isConstantInitializer(Ctx);
-
+
// Integer->integer casts can be handled here, which is important for
// things like (int)(&&x-&&y). Scary but true.
if (getType()->isIntegerType() &&
cast<CastExpr>(this)->getSubExpr()->getType()->isIntegerType())
return cast<CastExpr>(this)->getSubExpr()->isConstantInitializer(Ctx);
-
+
break;
}
return isEvaluatable(Ctx);
@@ -1810,7 +1810,7 @@
switch (E->getStmtClass()) {
#define STMT(Node, Base) case Expr::Node##Class:
#define EXPR(Node, Base)
-#include "clang/AST/StmtNodes.inc"
+#include "clang/AST/StmtNodes.def"
case Expr::PredefinedExprClass:
case Expr::FloatingLiteralClass:
case Expr::ImaginaryLiteralClass:
@@ -1902,7 +1902,7 @@
Qualifiers Quals = Ctx.getCanonicalType(Dcl->getType()).getQualifiers();
if (Quals.hasVolatile() || !Quals.hasConst())
return ICEDiag(2, cast<DeclRefExpr>(E)->getLocation());
-
+
// Look for a declaration of this variable that has an initializer.
const VarDecl *ID = 0;
const Expr *Init = Dcl->getAnyInitializer(ID);
@@ -2146,10 +2146,10 @@
case NPC_NeverValueDependent:
assert(false && "Unexpected value dependent expression!");
// If the unthinkable happens, fall through to the safest alternative.
-
+
case NPC_ValueDependentIsNull:
return isTypeDependent() || getType()->isIntegralType();
-
+
case NPC_ValueDependentIsNotNull:
return false;
}
@@ -2188,7 +2188,7 @@
return true;
// This expression must be an integer type.
- if (!getType()->isIntegerType() ||
+ if (!getType()->isIntegerType() ||
(Ctx.getLangOptions().CPlusPlus && getType()->isEnumeralType()))
return false;
@@ -2222,14 +2222,14 @@
bool Expr::refersToVectorElement() const {
const Expr *E = this->IgnoreParens();
-
+
while (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(E)) {
if (ICE->isLvalueCast() && ICE->getCastKind() == CastExpr::CK_NoOp)
E = ICE->getSubExpr()->IgnoreParens();
else
break;
}
-
+
if (const ArraySubscriptExpr *ASE = dyn_cast<ArraySubscriptExpr>(E))
return ASE->getBase()->getType()->isVectorType();
@@ -2307,7 +2307,7 @@
SourceLocation SuperLoc,
bool IsInstanceSuper,
QualType SuperType,
- Selector Sel,
+ Selector Sel,
ObjCMethodDecl *Method,
Expr **Args, unsigned NumArgs,
SourceLocation RBracLoc)
@@ -2317,7 +2317,7 @@
HasMethod(Method != 0), SuperLoc(SuperLoc),
SelectorOrMethod(reinterpret_cast<uintptr_t>(Method? Method
: Sel.getAsOpaquePtr())),
- LBracLoc(LBracLoc), RBracLoc(RBracLoc)
+ LBracLoc(LBracLoc), RBracLoc(RBracLoc)
{
setReceiverPointer(SuperType.getAsOpaquePtr());
if (NumArgs)
@@ -2327,17 +2327,17 @@
ObjCMessageExpr::ObjCMessageExpr(QualType T,
SourceLocation LBracLoc,
TypeSourceInfo *Receiver,
- Selector Sel,
+ Selector Sel,
ObjCMethodDecl *Method,
Expr **Args, unsigned NumArgs,
SourceLocation RBracLoc)
: Expr(ObjCMessageExprClass, T, T->isDependentType(),
- (T->isDependentType() ||
+ (T->isDependentType() ||
hasAnyValueDependentArguments(Args, NumArgs))),
NumArgs(NumArgs), Kind(Class), HasMethod(Method != 0),
SelectorOrMethod(reinterpret_cast<uintptr_t>(Method? Method
: Sel.getAsOpaquePtr())),
- LBracLoc(LBracLoc), RBracLoc(RBracLoc)
+ LBracLoc(LBracLoc), RBracLoc(RBracLoc)
{
setReceiverPointer(Receiver);
if (NumArgs)
@@ -2347,17 +2347,17 @@
ObjCMessageExpr::ObjCMessageExpr(QualType T,
SourceLocation LBracLoc,
Expr *Receiver,
- Selector Sel,
+ Selector Sel,
ObjCMethodDecl *Method,
Expr **Args, unsigned NumArgs,
SourceLocation RBracLoc)
: Expr(ObjCMessageExprClass, T, Receiver->isTypeDependent(),
- (Receiver->isTypeDependent() ||
+ (Receiver->isTypeDependent() ||
hasAnyValueDependentArguments(Args, NumArgs))),
NumArgs(NumArgs), Kind(Instance), HasMethod(Method != 0),
SelectorOrMethod(reinterpret_cast<uintptr_t>(Method? Method
: Sel.getAsOpaquePtr())),
- LBracLoc(LBracLoc), RBracLoc(RBracLoc)
+ LBracLoc(LBracLoc), RBracLoc(RBracLoc)
{
setReceiverPointer(Receiver);
if (NumArgs)
@@ -2369,59 +2369,59 @@
SourceLocation SuperLoc,
bool IsInstanceSuper,
QualType SuperType,
- Selector Sel,
+ Selector Sel,
ObjCMethodDecl *Method,
Expr **Args, unsigned NumArgs,
SourceLocation RBracLoc) {
- unsigned Size = sizeof(ObjCMessageExpr) + sizeof(void *) +
+ unsigned Size = sizeof(ObjCMessageExpr) + sizeof(void *) +
NumArgs * sizeof(Expr *);
void *Mem = Context.Allocate(Size, llvm::AlignOf<ObjCMessageExpr>::Alignment);
return new (Mem) ObjCMessageExpr(T, LBracLoc, SuperLoc, IsInstanceSuper,
- SuperType, Sel, Method, Args, NumArgs,
+ SuperType, Sel, Method, Args, NumArgs,
RBracLoc);
}
ObjCMessageExpr *ObjCMessageExpr::Create(ASTContext &Context, QualType T,
SourceLocation LBracLoc,
TypeSourceInfo *Receiver,
- Selector Sel,
+ Selector Sel,
ObjCMethodDecl *Method,
Expr **Args, unsigned NumArgs,
SourceLocation RBracLoc) {
- unsigned Size = sizeof(ObjCMessageExpr) + sizeof(void *) +
+ unsigned Size = sizeof(ObjCMessageExpr) + sizeof(void *) +
NumArgs * sizeof(Expr *);
void *Mem = Context.Allocate(Size, llvm::AlignOf<ObjCMessageExpr>::Alignment);
- return new (Mem) ObjCMessageExpr(T, LBracLoc, Receiver, Sel, Method, Args,
+ return new (Mem) ObjCMessageExpr(T, LBracLoc, Receiver, Sel, Method, Args,
NumArgs, RBracLoc);
}
ObjCMessageExpr *ObjCMessageExpr::Create(ASTContext &Context, QualType T,
SourceLocation LBracLoc,
Expr *Receiver,
- Selector Sel,
+ Selector Sel,
ObjCMethodDecl *Method,
Expr **Args, unsigned NumArgs,
SourceLocation RBracLoc) {
- unsigned Size = sizeof(ObjCMessageExpr) + sizeof(void *) +
+ unsigned Size = sizeof(ObjCMessageExpr) + sizeof(void *) +
NumArgs * sizeof(Expr *);
void *Mem = Context.Allocate(Size, llvm::AlignOf<ObjCMessageExpr>::Alignment);
- return new (Mem) ObjCMessageExpr(T, LBracLoc, Receiver, Sel, Method, Args,
+ return new (Mem) ObjCMessageExpr(T, LBracLoc, Receiver, Sel, Method, Args,
NumArgs, RBracLoc);
}
-ObjCMessageExpr *ObjCMessageExpr::CreateEmpty(ASTContext &Context,
+ObjCMessageExpr *ObjCMessageExpr::CreateEmpty(ASTContext &Context,
unsigned NumArgs) {
- unsigned Size = sizeof(ObjCMessageExpr) + sizeof(void *) +
+ unsigned Size = sizeof(ObjCMessageExpr) + sizeof(void *) +
NumArgs * sizeof(Expr *);
void *Mem = Context.Allocate(Size, llvm::AlignOf<ObjCMessageExpr>::Alignment);
return new (Mem) ObjCMessageExpr(EmptyShell(), NumArgs);
}
-
+
Selector ObjCMessageExpr::getSelector() const {
if (HasMethod)
return reinterpret_cast<const ObjCMethodDecl *>(SelectorOrMethod)
->getSelector();
- return Selector(SelectorOrMethod);
+ return Selector(SelectorOrMethod);
}
ObjCInterfaceDecl *ObjCMessageExpr::getReceiverInterface() const {
@@ -2500,7 +2500,7 @@
return getField()->getIdentifier();
}
-DesignatedInitExpr::DesignatedInitExpr(ASTContext &C, QualType Ty,
+DesignatedInitExpr::DesignatedInitExpr(ASTContext &C, QualType Ty,
unsigned NumDesignators,
const Designator *Designators,
SourceLocation EqualOrColonLoc,
Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=103086&r1=103085&r2=103086&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Wed May 5 10:23:54 2010
@@ -27,7 +27,7 @@
const char *Name;
unsigned Counter;
unsigned Size;
-} StmtClassInfo[Stmt::lastStmtConstant+1];
+} StmtClassInfo[Stmt::lastExprConstant+1];
static StmtClassNameTable &getStmtInfoTableEntry(Stmt::StmtClass E) {
static bool Initialized = false;
@@ -36,11 +36,11 @@
// Intialize the table on the first use.
Initialized = true;
-#define ABSTRACT(STMT)
+#define ABSTRACT_EXPR(CLASS, PARENT)
#define STMT(CLASS, PARENT) \
StmtClassInfo[(unsigned)Stmt::CLASS##Class].Name = #CLASS; \
StmtClassInfo[(unsigned)Stmt::CLASS##Class].Size = sizeof(CLASS);
-#include "clang/AST/StmtNodes.inc"
+#include "clang/AST/StmtNodes.def"
return StmtClassInfo[E];
}
@@ -55,13 +55,13 @@
unsigned sum = 0;
fprintf(stderr, "*** Stmt/Expr Stats:\n");
- for (int i = 0; i != Stmt::lastStmtConstant+1; i++) {
+ for (int i = 0; i != Stmt::lastExprConstant+1; i++) {
if (StmtClassInfo[i].Name == 0) continue;
sum += StmtClassInfo[i].Counter;
}
fprintf(stderr, " %d stmts/exprs total.\n", sum);
sum = 0;
- for (int i = 0; i != Stmt::lastStmtConstant+1; i++) {
+ for (int i = 0; i != Stmt::lastExprConstant+1; i++) {
if (StmtClassInfo[i].Name == 0) continue;
if (StmtClassInfo[i].Counter == 0) continue;
fprintf(stderr, " %d %s, %d each (%d bytes)\n",
@@ -164,7 +164,7 @@
StringLiteral **Constraints,
Stmt **Exprs,
unsigned NumOutputs,
- unsigned NumInputs,
+ unsigned NumInputs,
StringLiteral **Clobbers,
unsigned NumClobbers) {
this->NumOutputs = NumOutputs;
@@ -172,19 +172,19 @@
this->NumClobbers = NumClobbers;
unsigned NumExprs = NumOutputs + NumInputs;
-
+
C.Deallocate(this->Names);
this->Names = new (C) IdentifierInfo*[NumExprs];
std::copy(Names, Names + NumExprs, this->Names);
-
+
C.Deallocate(this->Exprs);
this->Exprs = new (C) Stmt*[NumExprs];
std::copy(Exprs, Exprs + NumExprs, this->Exprs);
-
+
C.Deallocate(this->Constraints);
this->Constraints = new (C) StringLiteral*[NumExprs];
std::copy(Constraints, Constraints + NumExprs, this->Constraints);
-
+
C.Deallocate(this->Clobbers);
this->Clobbers = new (C) StringLiteral*[NumClobbers];
std::copy(Clobbers, Clobbers + NumClobbers, this->Clobbers);
@@ -242,7 +242,7 @@
std::string CurStringPiece;
bool HasVariants = !C.Target.hasNoAsmVariants();
-
+
while (1) {
// Done with the string?
if (CurPtr == StrEnd) {
@@ -263,7 +263,7 @@
CurStringPiece += CurChar;
continue;
}
-
+
// Escaped "%" character in asm string.
if (CurPtr == StrEnd) {
// % at end of string is invalid (no escape).
@@ -356,8 +356,8 @@
// Constructors
//===----------------------------------------------------------------------===//
-AsmStmt::AsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple,
- bool isvolatile, bool msasm,
+AsmStmt::AsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple,
+ bool isvolatile, bool msasm,
unsigned numoutputs, unsigned numinputs,
IdentifierInfo **names, StringLiteral **constraints,
Expr **exprs, StringLiteral *asmstr, unsigned numclobbers,
@@ -367,7 +367,7 @@
, NumOutputs(numoutputs), NumInputs(numinputs), NumClobbers(numclobbers) {
unsigned NumExprs = NumOutputs +NumInputs;
-
+
Names = new (C) IdentifierInfo*[NumExprs];
std::copy(names, names + NumExprs, Names);
@@ -402,31 +402,31 @@
Stmts[0] = atTryStmt;
for (unsigned I = 0; I != NumCatchStmts; ++I)
Stmts[I + 1] = CatchStmts[I];
-
+
if (HasFinally)
Stmts[NumCatchStmts + 1] = atFinallyStmt;
}
-ObjCAtTryStmt *ObjCAtTryStmt::Create(ASTContext &Context,
- SourceLocation atTryLoc,
+ObjCAtTryStmt *ObjCAtTryStmt::Create(ASTContext &Context,
+ SourceLocation atTryLoc,
Stmt *atTryStmt,
- Stmt **CatchStmts,
+ Stmt **CatchStmts,
unsigned NumCatchStmts,
Stmt *atFinallyStmt) {
- unsigned Size = sizeof(ObjCAtTryStmt) +
+ unsigned Size = sizeof(ObjCAtTryStmt) +
(1 + NumCatchStmts + (atFinallyStmt != 0)) * sizeof(Stmt *);
void *Mem = Context.Allocate(Size, llvm::alignof<ObjCAtTryStmt>());
return new (Mem) ObjCAtTryStmt(atTryLoc, atTryStmt, CatchStmts, NumCatchStmts,
atFinallyStmt);
}
-ObjCAtTryStmt *ObjCAtTryStmt::CreateEmpty(ASTContext &Context,
+ObjCAtTryStmt *ObjCAtTryStmt::CreateEmpty(ASTContext &Context,
unsigned NumCatchStmts,
bool HasFinally) {
- unsigned Size = sizeof(ObjCAtTryStmt) +
+ unsigned Size = sizeof(ObjCAtTryStmt) +
(1 + NumCatchStmts + HasFinally) * sizeof(Stmt *);
void *Mem = Context.Allocate(Size, llvm::alignof<ObjCAtTryStmt>());
- return new (Mem) ObjCAtTryStmt(EmptyShell(), NumCatchStmts, HasFinally);
+ return new (Mem) ObjCAtTryStmt(EmptyShell(), NumCatchStmts, HasFinally);
}
SourceRange ObjCAtTryStmt::getSourceRange() const {
@@ -437,12 +437,12 @@
EndLoc = getCatchStmt(NumCatchStmts - 1)->getLocEnd();
else
EndLoc = getTryBody()->getLocEnd();
-
+
return SourceRange(AtTryLoc, EndLoc);
}
CXXTryStmt *CXXTryStmt::Create(ASTContext &C, SourceLocation tryLoc,
- Stmt *tryBlock, Stmt **handlers,
+ Stmt *tryBlock, Stmt **handlers,
unsigned numHandlers) {
std::size_t Size = sizeof(CXXTryStmt);
Size += ((numHandlers + 1) * sizeof(Stmt));
@@ -474,7 +474,7 @@
// the expressions referenced by the condition variable.
for (Stmt **I = SubExprs, **E = SubExprs + NumExprs; I != E; ++I)
if (Stmt *Child = *I) Child->Destroy(C);
-
+
S->~Stmt();
C.Deallocate((void *) S);
}
@@ -517,7 +517,7 @@
SC->Destroy(C);
SC = Next;
}
-
+
BranchDestroy(C, this, SubExprs, END_EXPR);
}
@@ -527,12 +527,12 @@
void AsmStmt::DoDestroy(ASTContext &C) {
DestroyChildren(C);
-
+
C.Deallocate(Names);
C.Deallocate(Constraints);
C.Deallocate(Exprs);
C.Deallocate(Clobbers);
-
+
this->~AsmStmt();
C.Deallocate((void *)this);
}
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=103086&r1=103085&r2=103086&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Wed May 5 10:23:54 2010
@@ -89,7 +89,7 @@
void VisitStmt(Stmt *Node);
#define STMT(CLASS, PARENT) \
void Visit##CLASS(CLASS *Node);
-#include "clang/AST/StmtNodes.inc"
+#include "clang/AST/StmtNodes.def"
};
}
@@ -477,7 +477,7 @@
OS << TemplateSpecializationType::PrintTemplateArgumentList(
Node->getTemplateArgs(),
Node->getNumTemplateArgs(),
- Policy);
+ Policy);
}
void StmtPrinter::VisitDependentScopeDeclRefExpr(
@@ -727,12 +727,12 @@
IdentifierInfo *Id = ON.getFieldName();
if (!Id)
continue;
-
+
if (PrintedSomething)
OS << ".";
else
PrintedSomething = true;
- OS << Id->getName();
+ OS << Id->getName();
}
OS << ")";
}
Modified: cfe/trunk/lib/AST/StmtProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=103086&r1=103085&r2=103086&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtProfile.cpp (original)
+++ cfe/trunk/lib/AST/StmtProfile.cpp Wed May 5 10:23:54 2010
@@ -36,7 +36,7 @@
void VisitStmt(Stmt *S);
#define STMT(Node, Base) void Visit##Node(Node *S);
-#include "clang/AST/StmtNodes.inc"
+#include "clang/AST/StmtNodes.def"
/// \brief Visit a declaration that is referenced within an expression
/// or statement.
@@ -279,13 +279,13 @@
case OffsetOfExpr::OffsetOfNode::Identifier:
ID.AddPointer(ON.getFieldName());
break;
-
+
case OffsetOfExpr::OffsetOfNode::Base:
// These nodes are implicit, and therefore don't need profiling.
break;
}
}
-
+
VisitExpr(S);
}
@@ -740,7 +740,7 @@
case TemplateArgument::Template:
VisitTemplateName(Arg.getAsTemplate());
break;
-
+
case TemplateArgument::Declaration:
VisitDecl(Arg.getAsDecl());
break;
Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=103086&r1=103085&r2=103086&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Wed May 5 10:23:54 2010
@@ -178,7 +178,7 @@
void mangleTemplateArgs(TemplateName Template,
const TemplateArgument *TemplateArgs,
- unsigned NumTemplateArgs);
+ unsigned NumTemplateArgs);
void mangleTemplateArgs(const TemplateParameterList &PL,
const TemplateArgument *TemplateArgs,
unsigned NumTemplateArgs);
@@ -439,7 +439,7 @@
// ::= <substitution>
if (TemplateDecl *TD = Template.getAsTemplateDecl())
return mangleUnscopedTemplateName(TD);
-
+
if (mangleSubstitution(Template))
return;
@@ -454,7 +454,7 @@
Diags.Report(FullSourceLoc(), DiagID);
return;
}
-
+
mangleSourceName(Dependent->getIdentifier());
addSubstitution(Template);
}
@@ -506,7 +506,7 @@
dyn_cast<TemplateSpecializationType>(QTy)) {
if (!mangleSubstitution(QualType(TST, 0))) {
mangleTemplatePrefix(TST->getTemplateName());
-
+
// FIXME: GCC does not appear to mangle the template arguments when
// the template in question is a dependent template name. Should we
// emulate that badness?
@@ -781,14 +781,14 @@
if (QualifiedTemplateName *Qualified = Template.getAsQualifiedTemplateName())
mangleUnresolvedScope(Qualified->getQualifier());
-
+
if (OverloadedTemplateStorage *Overloaded
= Template.getAsOverloadedTemplate()) {
- mangleUnqualifiedName(0, (*Overloaded->begin())->getDeclName(),
+ mangleUnqualifiedName(0, (*Overloaded->begin())->getDeclName(),
UnknownArity);
return;
}
-
+
DependentTemplateName *Dependent = Template.getAsDependentTemplateName();
assert(Dependent && "Unknown template name kind?");
mangleUnresolvedScope(Dependent->getQualifier());
@@ -1224,9 +1224,9 @@
} else {
if (mangleSubstitution(QualType(T, 0)))
return;
-
+
mangleTemplatePrefix(T->getTemplateName());
-
+
// FIXME: GCC does not appear to mangle the template arguments when
// the template in question is a dependent template name. Should we
// emulate that badness?
@@ -1245,16 +1245,16 @@
const TemplateSpecializationType *TST = T->getTemplateId();
if (!mangleSubstitution(QualType(TST, 0))) {
mangleTemplatePrefix(TST->getTemplateName());
-
+
// FIXME: GCC does not appear to mangle the template arguments when
// the template in question is a dependent template name. Should we
// emulate that badness?
mangleTemplateArgs(TST->getTemplateName(), TST->getArgs(),
- TST->getNumArgs());
+ TST->getNumArgs());
addSubstitution(QualType(TST, 0));
}
}
-
+
Out << 'E';
}
@@ -1369,7 +1369,7 @@
#define EXPR(Type, Base)
#define STMT(Type, Base) \
case Expr::Type##Class:
-#include "clang/AST/StmtNodes.inc"
+#include "clang/AST/StmtNodes.def"
llvm_unreachable("unexpected statement kind");
break;
@@ -1668,7 +1668,7 @@
if (TemplateDecl *TD = Template.getAsTemplateDecl())
return mangleTemplateArgs(*TD->getTemplateParameters(), TemplateArgs,
NumTemplateArgs);
-
+
// <template-args> ::= I <template-arg>+ E
Out << 'I';
for (unsigned i = 0; i != NumTemplateArgs; ++i)
@@ -1791,7 +1791,7 @@
bool CXXNameMangler::mangleSubstitution(TemplateName Template) {
if (TemplateDecl *TD = Template.getAsTemplateDecl())
return mangleSubstitution(TD);
-
+
Template = Context.getASTContext().getCanonicalTemplateName(Template);
return mangleSubstitution(
reinterpret_cast<uintptr_t>(Template.getAsVoidPointer()));
@@ -1978,7 +1978,7 @@
void CXXNameMangler::addSubstitution(TemplateName Template) {
if (TemplateDecl *TD = Template.getAsTemplateDecl())
return addSubstitution(TD);
-
+
Template = Context.getASTContext().getCanonicalTemplateName(Template);
addSubstitution(reinterpret_cast<uintptr_t>(Template.getAsVoidPointer()));
}
@@ -2036,38 +2036,38 @@
// # base is the nominal target function of thunk
// # first call-offset is 'this' adjustment
// # second call-offset is result adjustment
-
+
assert(!isa<CXXDestructorDecl>(MD) &&
"Use mangleCXXDtor for destructor decls!");
-
+
CXXNameMangler Mangler(*this, Res);
Mangler.getStream() << "_ZT";
if (!Thunk.Return.isEmpty())
Mangler.getStream() << 'c';
-
+
// Mangle the 'this' pointer adjustment.
Mangler.mangleCallOffset(Thunk.This.NonVirtual, Thunk.This.VCallOffsetOffset);
-
+
// Mangle the return pointer adjustment if there is one.
if (!Thunk.Return.isEmpty())
Mangler.mangleCallOffset(Thunk.Return.NonVirtual,
Thunk.Return.VBaseOffsetOffset);
-
+
Mangler.mangleFunctionEncoding(MD);
}
-void
+void
MangleContext::mangleCXXDtorThunk(const CXXDestructorDecl *DD, CXXDtorType Type,
const ThisAdjustment &ThisAdjustment,
llvm::SmallVectorImpl<char> &Res) {
// <special-name> ::= T <call-offset> <base encoding>
// # base is the nominal target function of thunk
-
+
CXXNameMangler Mangler(*this, Res, DD, Type);
Mangler.getStream() << "_ZT";
// Mangle the 'this' pointer adjustment.
- Mangler.mangleCallOffset(ThisAdjustment.NonVirtual,
+ Mangler.mangleCallOffset(ThisAdjustment.NonVirtual,
ThisAdjustment.VCallOffsetOffset);
Mangler.mangleFunctionEncoding(DD);
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=103086&r1=103085&r2=103086&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Wed May 5 10:23:54 2010
@@ -96,7 +96,7 @@
typedef Sema::MultiExprArg MultiExprArg;
typedef Sema::MultiStmtArg MultiStmtArg;
typedef Sema::DeclPtrTy DeclPtrTy;
-
+
/// \brief Initializes a new tree transformer.
TreeTransform(Sema &SemaRef) : SemaRef(SemaRef) { }
@@ -181,7 +181,7 @@
bool DropCallArgument(Expr *E) {
return E->isDefaultArgument();
}
-
+
/// \brief Transforms the given type into another type.
///
/// By default, this routine transforms a type by creating a
@@ -201,14 +201,14 @@
/// may override this function (to take over all type
/// transformations) or some set of the TransformXXXType functions
/// to alter the transformation.
- TypeSourceInfo *TransformType(TypeSourceInfo *DI,
+ TypeSourceInfo *TransformType(TypeSourceInfo *DI,
QualType ObjectType = QualType());
/// \brief Transform the given type-with-location into a new
/// type, collecting location information in the given builder
/// as necessary.
///
- QualType TransformType(TypeLocBuilder &TLB, TypeLoc TL,
+ QualType TransformType(TypeLocBuilder &TLB, TypeLoc TL,
QualType ObjectType = QualType());
/// \brief Transform the given statement.
@@ -243,23 +243,23 @@
///
/// By default, invokes TransformDecl() to transform the declaration.
/// Subclasses may override this function to provide alternate behavior.
- Decl *TransformDefinition(SourceLocation Loc, Decl *D) {
- return getDerived().TransformDecl(Loc, D);
+ Decl *TransformDefinition(SourceLocation Loc, Decl *D) {
+ return getDerived().TransformDecl(Loc, D);
}
/// \brief Transform the given declaration, which was the first part of a
/// nested-name-specifier in a member access expression.
///
- /// This specific declaration transformation only applies to the first
+ /// This specific declaration transformation only applies to the first
/// identifier in a nested-name-specifier of a member access expression, e.g.,
/// the \c T in \c x->T::member
///
/// By default, invokes TransformDecl() to transform the declaration.
/// Subclasses may override this function to provide alternate behavior.
- NamedDecl *TransformFirstQualifierInScope(NamedDecl *D, SourceLocation Loc) {
- return cast_or_null<NamedDecl>(getDerived().TransformDecl(Loc, D));
+ NamedDecl *TransformFirstQualifierInScope(NamedDecl *D, SourceLocation Loc) {
+ return cast_or_null<NamedDecl>(getDerived().TransformDecl(Loc, D));
}
-
+
/// \brief Transform the given nested-name-specifier.
///
/// By default, transforms all of the types and declarations within the
@@ -330,10 +330,10 @@
/// on error.
ParmVarDecl *TransformFunctionTypeParam(ParmVarDecl *OldParm);
- QualType TransformReferenceType(TypeLocBuilder &TLB, ReferenceTypeLoc TL,
+ QualType TransformReferenceType(TypeLocBuilder &TLB, ReferenceTypeLoc TL,
QualType ObjectType);
- QualType
+ QualType
TransformTemplateSpecializationType(const TemplateSpecializationType *T,
QualType ObjectType);
@@ -344,8 +344,8 @@
OwningStmtResult Transform##Node(Node *S);
#define EXPR(Node, Parent) \
OwningExprResult Transform##Node(Node *E);
-#define ABSTRACT(Stmt)
-#include "clang/AST/StmtNodes.inc"
+#define ABSTRACT_EXPR(Node, Parent)
+#include "clang/AST/StmtNodes.def"
/// \brief Build a new pointer type given its pointee type.
///
@@ -534,7 +534,7 @@
/// \brief Build a new typename type that refers to a template-id.
///
- /// By default, builds a new DependentNameType type from the
+ /// By default, builds a new DependentNameType type from the
/// nested-name-specifier
/// and the given type. Subclasses may override this routine to provide
/// different behavior.
@@ -548,7 +548,7 @@
return SemaRef.Context.getDependentNameType(Keyword, NNS,
cast<TemplateSpecializationType>(T));
}
-
+
// FIXME: Handle elaborated-type-specifiers separately.
return SemaRef.Context.getQualifiedNameType(NNS, T);
}
@@ -558,13 +558,13 @@
/// By default, performs semantic analysis when building the typename type
/// (or qualified name type). Subclasses may override this routine to provide
/// different behavior.
- QualType RebuildDependentNameType(ElaboratedTypeKeyword Keyword,
+ QualType RebuildDependentNameType(ElaboratedTypeKeyword Keyword,
NestedNameSpecifier *NNS,
const IdentifierInfo *Id,
SourceRange SR) {
CXXScopeSpec SS;
SS.setScopeRep(NNS);
-
+
if (NNS->isDependent()) {
// If the name is still dependent, just build a new dependent name type.
if (!SemaRef.computeDeclContext(SS))
@@ -577,13 +577,13 @@
// Fall through.
case ETK_Typename:
return SemaRef.CheckTypenameType(Keyword, NNS, *Id, SR);
-
+
case ETK_Class: Kind = TagDecl::TK_class; break;
case ETK_Struct: Kind = TagDecl::TK_struct; break;
case ETK_Union: Kind = TagDecl::TK_union; break;
case ETK_Enum: Kind = TagDecl::TK_enum; break;
}
-
+
// We had a dependent elaborated-type-specifier that as been transformed
// into a non-dependent elaborated-type-specifier. Find the tag we're
// referring to.
@@ -598,16 +598,16 @@
case LookupResult::NotFound:
case LookupResult::NotFoundInCurrentInstantiation:
break;
-
+
case LookupResult::Found:
Tag = Result.getAsSingle<TagDecl>();
break;
-
+
case LookupResult::FoundOverloaded:
case LookupResult::FoundUnresolvedValue:
llvm_unreachable("Tag lookup cannot find non-tags");
return QualType();
-
+
case LookupResult::Ambiguous:
// Let the LookupResult structure handle ambiguities.
return QualType();
@@ -619,7 +619,7 @@
<< Kind << Id << DC;
return QualType();
}
-
+
// FIXME: Terrible location information
if (!SemaRef.isAcceptableTagRedeclaration(Tag, Kind, SR.getEnd(), *Id)) {
SemaRef.Diag(SR.getBegin(), diag::err_use_with_wrong_tag) << Id;
@@ -697,7 +697,7 @@
TemplateName RebuildTemplateName(NestedNameSpecifier *Qualifier,
OverloadedOperatorKind Operator,
QualType ObjectType);
-
+
/// \brief Build a new compound statement.
///
/// By default, performs semantic analysis to build the new statement.
@@ -759,9 +759,9 @@
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildIfStmt(SourceLocation IfLoc, Sema::FullExprArg Cond,
- VarDecl *CondVar, StmtArg Then,
+ VarDecl *CondVar, StmtArg Then,
SourceLocation ElseLoc, StmtArg Else) {
- return getSema().ActOnIfStmt(IfLoc, Cond, DeclPtrTy::make(CondVar),
+ return getSema().ActOnIfStmt(IfLoc, Cond, DeclPtrTy::make(CondVar),
move(Then), ElseLoc, move(Else));
}
@@ -769,7 +769,7 @@
///
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
- OwningStmtResult RebuildSwitchStmtStart(Sema::FullExprArg Cond,
+ OwningStmtResult RebuildSwitchStmtStart(Sema::FullExprArg Cond,
VarDecl *CondVar) {
return getSema().ActOnStartOfSwitchStmt(Cond, DeclPtrTy::make(CondVar));
}
@@ -815,10 +815,10 @@
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildForStmt(SourceLocation ForLoc,
SourceLocation LParenLoc,
- StmtArg Init, Sema::FullExprArg Cond,
+ StmtArg Init, Sema::FullExprArg Cond,
VarDecl *CondVar, Sema::FullExprArg Inc,
SourceLocation RParenLoc, StmtArg Body) {
- return getSema().ActOnForStmt(ForLoc, LParenLoc, move(Init), Cond,
+ return getSema().ActOnForStmt(ForLoc, LParenLoc, move(Init), Cond,
DeclPtrTy::make(CondVar),
Inc, RParenLoc, move(Body));
}
@@ -883,7 +883,7 @@
MultiExprArg Clobbers,
SourceLocation RParenLoc,
bool MSAsm) {
- return getSema().ActOnAsmStmt(AsmLoc, IsSimple, IsVolatile, NumOutputs,
+ return getSema().ActOnAsmStmt(AsmLoc, IsSimple, IsVolatile, NumOutputs,
NumInputs, Names, move(Constraints),
move(Exprs), move(AsmString), move(Clobbers),
RParenLoc, MSAsm);
@@ -907,11 +907,11 @@
/// Subclasses may override this routine to provide different behavior.
VarDecl *RebuildObjCExceptionDecl(VarDecl *ExceptionDecl,
TypeSourceInfo *TInfo, QualType T) {
- return getSema().BuildObjCExceptionDecl(TInfo, T,
- ExceptionDecl->getIdentifier(),
+ return getSema().BuildObjCExceptionDecl(TInfo, T,
+ ExceptionDecl->getIdentifier(),
ExceptionDecl->getLocation());
}
-
+
/// \brief Build a new Objective-C @catch statement.
///
/// By default, performs semantic analysis to build the new statement.
@@ -924,7 +924,7 @@
Sema::DeclPtrTy::make(Var),
move(Body));
}
-
+
/// \brief Build a new Objective-C @finally statement.
///
/// By default, performs semantic analysis to build the new statement.
@@ -933,7 +933,7 @@
StmtArg Body) {
return getSema().ActOnObjCAtFinallyStmt(AtLoc, move(Body));
}
-
+
/// \brief Build a new Objective-C @throw statement.
///
/// By default, performs semantic analysis to build the new statement.
@@ -942,7 +942,7 @@
ExprArg Operand) {
return getSema().BuildObjCAtThrowStmt(AtLoc, move(Operand));
}
-
+
/// \brief Build a new Objective-C @synchronized statement.
///
/// By default, performs semantic analysis to build the new statement.
@@ -965,12 +965,12 @@
SourceLocation RParenLoc,
StmtArg Body) {
return getSema().ActOnObjCForCollectionStmt(ForLoc, LParenLoc,
- move(Element),
+ move(Element),
move(Collection),
RParenLoc,
move(Body));
}
-
+
/// \brief Build a new C++ exception declaration.
///
/// By default, performs semantic analysis to build the new decaration.
@@ -1030,7 +1030,7 @@
SS.setRange(QualifierRange);
// FIXME: loses template args.
-
+
return getSema().BuildDeclarationNameExpr(SS, Loc, VD);
}
@@ -1079,7 +1079,7 @@
return getSema().BuildBuiltinOffsetOf(OperatorLoc, Type, Components,
NumComponents, RParenLoc);
}
-
+
/// \brief Build a new sizeof or alignof expression with a type argument.
///
/// By default, performs semantic analysis to build the new expression.
@@ -1189,7 +1189,7 @@
OwningExprResult RebuildBinaryOperator(SourceLocation OpLoc,
BinaryOperator::Opcode Opc,
ExprArg LHS, ExprArg RHS) {
- return getSema().BuildBinOp(/*Scope=*/0, OpLoc, Opc,
+ return getSema().BuildBinOp(/*Scope=*/0, OpLoc, Opc,
LHS.takeAs<Expr>(), RHS.takeAs<Expr>());
}
@@ -1261,7 +1261,7 @@
= SemaRef.ActOnInitList(LBraceLoc, move(Inits), RBraceLoc);
if (Result.isInvalid() || ResultTy->isDependentType())
return move(Result);
-
+
// Patch in the result type we were given, which may have been computed
// when the initial InitListExpr was built.
InitListExpr *ILE = cast<InitListExpr>((Expr *)Result.get());
@@ -1314,7 +1314,7 @@
OwningExprResult RebuildParenListExpr(SourceLocation LParenLoc,
MultiExprArg SubExprs,
SourceLocation RParenLoc) {
- return getSema().ActOnParenOrParenListExpr(LParenLoc, RParenLoc,
+ return getSema().ActOnParenOrParenListExpr(LParenLoc, RParenLoc,
move(SubExprs));
}
@@ -1516,7 +1516,7 @@
SourceLocation TypeidLoc,
TypeSourceInfo *Operand,
SourceLocation RParenLoc) {
- return getSema().BuildCXXTypeId(TypeInfoType, TypeidLoc, Operand,
+ return getSema().BuildCXXTypeId(TypeInfoType, TypeidLoc, Operand,
RParenLoc);
}
@@ -1558,7 +1558,7 @@
/// By default, builds a new default-argument expression, which does not
/// require any semantic analysis. Subclasses may override this routine to
/// provide different behavior.
- OwningExprResult RebuildCXXDefaultArgExpr(SourceLocation Loc,
+ OwningExprResult RebuildCXXDefaultArgExpr(SourceLocation Loc,
ParmVarDecl *Param) {
return getSema().Owned(CXXDefaultArgExpr::Create(getSema().Context, Loc,
Param));
@@ -1676,10 +1676,10 @@
bool IsElidable,
MultiExprArg Args) {
ASTOwningVector<&ActionBase::DeleteExpr> ConvertedArgs(SemaRef);
- if (getSema().CompleteConstructorCall(Constructor, move(Args), Loc,
+ if (getSema().CompleteConstructorCall(Constructor, move(Args), Loc,
ConvertedArgs))
return getSema().ExprError();
-
+
return getSema().BuildCXXConstructExpr(Loc, T, Constructor, IsElidable,
move_arg(ConvertedArgs));
}
@@ -1783,7 +1783,7 @@
OwningExprResult RebuildObjCMessageExpr(TypeSourceInfo *ReceiverTypeInfo,
Selector Sel,
ObjCMethodDecl *Method,
- SourceLocation LBracLoc,
+ SourceLocation LBracLoc,
MultiExprArg Args,
SourceLocation RBracLoc) {
return SemaRef.BuildClassMessage(ReceiverTypeInfo,
@@ -1797,7 +1797,7 @@
OwningExprResult RebuildObjCMessageExpr(ExprArg Receiver,
Selector Sel,
ObjCMethodDecl *Method,
- SourceLocation LBracLoc,
+ SourceLocation LBracLoc,
MultiExprArg Args,
SourceLocation RBracLoc) {
QualType ReceiverType = static_cast<Expr *>(Receiver.get())->getType();
@@ -1825,15 +1825,15 @@
SS, DeclPtrTy());
if (Result.isInvalid())
return getSema().ExprError();
-
+
if (Result.get())
return move(Result);
-
- return getSema().BuildMemberReferenceExpr(getSema().Owned(Base),
+
+ return getSema().BuildMemberReferenceExpr(getSema().Owned(Base),
Base->getType(),
- /*FIXME:*/IvarLoc, IsArrow, SS,
+ /*FIXME:*/IvarLoc, IsArrow, SS,
/*FirstQualifierInScope=*/0,
- R,
+ R,
/*TemplateArgs=*/0);
}
@@ -1841,7 +1841,7 @@
///
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildObjCPropertyRefExpr(ExprArg BaseArg,
+ OwningExprResult RebuildObjCPropertyRefExpr(ExprArg BaseArg,
ObjCPropertyDecl *Property,
SourceLocation PropertyLoc) {
CXXScopeSpec SS;
@@ -1854,24 +1854,24 @@
SS, DeclPtrTy());
if (Result.isInvalid())
return getSema().ExprError();
-
+
if (Result.get())
return move(Result);
-
- return getSema().BuildMemberReferenceExpr(getSema().Owned(Base),
+
+ return getSema().BuildMemberReferenceExpr(getSema().Owned(Base),
Base->getType(),
- /*FIXME:*/PropertyLoc, IsArrow,
- SS,
+ /*FIXME:*/PropertyLoc, IsArrow,
+ SS,
/*FirstQualifierInScope=*/0,
- R,
+ R,
/*TemplateArgs=*/0);
}
-
- /// \brief Build a new Objective-C implicit setter/getter reference
+
+ /// \brief Build a new Objective-C implicit setter/getter reference
/// expression.
///
/// By default, performs semantic analysis to build the new expression.
- /// Subclasses may override this routine to provide different behavior.
+ /// Subclasses may override this routine to provide different behavior.
OwningExprResult RebuildObjCImplicitSetterGetterRefExpr(
ObjCMethodDecl *Getter,
QualType T,
@@ -1902,18 +1902,18 @@
SS, DeclPtrTy());
if (Result.isInvalid())
return getSema().ExprError();
-
+
if (Result.get())
return move(Result);
-
- return getSema().BuildMemberReferenceExpr(getSema().Owned(Base),
+
+ return getSema().BuildMemberReferenceExpr(getSema().Owned(Base),
Base->getType(),
- /*FIXME:*/IsaLoc, IsArrow, SS,
+ /*FIXME:*/IsaLoc, IsArrow, SS,
/*FirstQualifierInScope=*/0,
- R,
+ R,
/*TemplateArgs=*/0);
}
-
+
/// \brief Build a new shuffle vector expression.
///
/// By default, performs semantic analysis to build the new expression.
@@ -1966,13 +1966,13 @@
#define STMT(Node, Parent) \
case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(S));
#define EXPR(Node, Parent)
-#include "clang/AST/StmtNodes.inc"
+#include "clang/AST/StmtNodes.def"
// Transform expressions by calling TransformExpr.
#define STMT(Node, Parent)
-#define ABSTRACT(Stmt)
+#define ABSTRACT_EXPR(Node, Parent)
#define EXPR(Node, Parent) case Stmt::Node##Class:
-#include "clang/AST/StmtNodes.inc"
+#include "clang/AST/StmtNodes.def"
{
Sema::OwningExprResult E = getDerived().TransformExpr(cast<Expr>(S));
if (E.isInvalid())
@@ -1994,10 +1994,10 @@
switch (E->getStmtClass()) {
case Stmt::NoStmtClass: break;
#define STMT(Node, Parent) case Stmt::Node##Class: break;
-#define ABSTRACT(Stmt)
+#define ABSTRACT_EXPR(Node, Parent)
#define EXPR(Node, Parent) \
case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(E));
-#include "clang/AST/StmtNodes.inc"
+#include "clang/AST/StmtNodes.def"
}
return SemaRef.Owned(E->Retain());
@@ -2103,7 +2103,7 @@
case DeclarationName::CXXDestructorName:
case DeclarationName::CXXConversionFunctionName: {
TemporaryBase Rebase(*this, Loc, Name);
- QualType T = getDerived().TransformType(Name.getCXXNameType(),
+ QualType T = getDerived().TransformType(Name.getCXXNameType(),
ObjectType);
if (T.isNull())
return DeclarationName();
@@ -2164,10 +2164,10 @@
return Name;
if (DTN->isIdentifier())
- return getDerived().RebuildTemplateName(NNS, *DTN->getIdentifier(),
+ return getDerived().RebuildTemplateName(NNS, *DTN->getIdentifier(),
ObjectType);
-
- return getDerived().RebuildTemplateName(NNS, DTN->getOperator(),
+
+ return getDerived().RebuildTemplateName(NNS, DTN->getOperator(),
ObjectType);
}
@@ -2202,13 +2202,13 @@
case TemplateArgument::Type:
Output = TemplateArgumentLoc(Arg,
SemaRef.Context.getTrivialTypeSourceInfo(Arg.getAsType(), Loc));
-
+
break;
case TemplateArgument::Template:
Output = TemplateArgumentLoc(Arg, SourceRange(), Loc);
break;
-
+
case TemplateArgument::Expression:
Output = TemplateArgumentLoc(Arg, Arg.getAsExpr());
break;
@@ -2271,18 +2271,18 @@
}
case TemplateArgument::Template: {
- TemporaryBase Rebase(*this, Input.getLocation(), DeclarationName());
+ TemporaryBase Rebase(*this, Input.getLocation(), DeclarationName());
TemplateName Template
= getDerived().TransformTemplateName(Arg.getAsTemplate());
if (Template.isNull())
return true;
-
+
Output = TemplateArgumentLoc(TemplateArgument(Template),
Input.getTemplateQualifierRange(),
Input.getTemplateNameLoc());
return false;
}
-
+
case TemplateArgument::Expression: {
// Template argument expressions are not potentially evaluated.
EnterExpressionEvaluationContext Unevaluated(getSema(),
@@ -2336,7 +2336,7 @@
//===----------------------------------------------------------------------===//
template<typename Derived>
-QualType TreeTransform<Derived>::TransformType(QualType T,
+QualType TreeTransform<Derived>::TransformType(QualType T,
QualType ObjectType) {
if (getDerived().AlreadyTransformed(T))
return T;
@@ -2345,7 +2345,7 @@
// eventually turn into transformations on TypeLocs.
TypeSourceInfo *DI = getSema().Context.CreateTypeSourceInfo(T);
DI->getTypeLoc().initialize(getDerived().getBaseLocation());
-
+
TypeSourceInfo *NewDI = getDerived().TransformType(DI, ObjectType);
if (!NewDI)
@@ -2449,10 +2449,10 @@
template<typename Derived>
QualType TreeTransform<Derived>::TransformPointerType(TypeLocBuilder &TLB,
- PointerTypeLoc TL,
+ PointerTypeLoc TL,
QualType ObjectType) {
- QualType PointeeType
- = getDerived().TransformType(TLB, TL.getPointeeLoc());
+ QualType PointeeType
+ = getDerived().TransformType(TLB, TL.getPointeeLoc());
if (PointeeType.isNull())
return QualType();
@@ -2467,26 +2467,26 @@
const_cast<ObjCProtocolDecl **>(
IFace->qual_begin()),
IFace->getNumProtocols());
-
- ObjCObjectPointerTypeLoc NewT = TLB.push<ObjCObjectPointerTypeLoc>(Result);
- NewT.setStarLoc(TL.getSigilLoc());
+
+ ObjCObjectPointerTypeLoc NewT = TLB.push<ObjCObjectPointerTypeLoc>(Result);
+ NewT.setStarLoc(TL.getSigilLoc());
NewT.setHasProtocolsAsWritten(false);
NewT.setLAngleLoc(SourceLocation());
NewT.setRAngleLoc(SourceLocation());
NewT.setHasBaseTypeAsWritten(true);
return Result;
}
-
+
if (getDerived().AlwaysRebuild() ||
PointeeType != TL.getPointeeLoc().getType()) {
Result = getDerived().RebuildPointerType(PointeeType, TL.getSigilLoc());
if (Result.isNull())
return QualType();
}
-
+
PointerTypeLoc NewT = TLB.push<PointerTypeLoc>(Result);
NewT.setSigilLoc(TL.getSigilLoc());
- return Result;
+ return Result;
}
template<typename Derived>
@@ -2495,14 +2495,14 @@
BlockPointerTypeLoc TL,
QualType ObjectType) {
QualType PointeeType
- = getDerived().TransformType(TLB, TL.getPointeeLoc());
- if (PointeeType.isNull())
- return QualType();
-
- QualType Result = TL.getType();
- if (getDerived().AlwaysRebuild() ||
- PointeeType != TL.getPointeeLoc().getType()) {
- Result = getDerived().RebuildBlockPointerType(PointeeType,
+ = getDerived().TransformType(TLB, TL.getPointeeLoc());
+ if (PointeeType.isNull())
+ return QualType();
+
+ QualType Result = TL.getType();
+ if (getDerived().AlwaysRebuild() ||
+ PointeeType != TL.getPointeeLoc().getType()) {
+ Result = getDerived().RebuildBlockPointerType(PointeeType,
TL.getSigilLoc());
if (Result.isNull())
return QualType();
@@ -2620,7 +2620,7 @@
if (Result.isNull())
return QualType();
}
-
+
ConstantArrayTypeLoc NewTL = TLB.push<ConstantArrayTypeLoc>(Result);
NewTL.setLBracketLoc(TL.getLBracketLoc());
NewTL.setRBracketLoc(TL.getRBracketLoc());
@@ -2655,7 +2655,7 @@
if (Result.isNull())
return QualType();
}
-
+
IncompleteArrayTypeLoc NewTL = TLB.push<IncompleteArrayTypeLoc>(Result);
NewTL.setLBracketLoc(TL.getLBracketLoc());
NewTL.setRBracketLoc(TL.getRBracketLoc());
@@ -2697,7 +2697,7 @@
return QualType();
}
else SizeResult.take();
-
+
VariableArrayTypeLoc NewTL = TLB.push<VariableArrayTypeLoc>(Result);
NewTL.setLBracketLoc(TL.getLBracketLoc());
NewTL.setRBracketLoc(TL.getRBracketLoc());
@@ -2811,7 +2811,7 @@
if (Result.isNull())
return QualType();
}
-
+
VectorTypeLoc NewTL = TLB.push<VectorTypeLoc>(Result);
NewTL.setNameLoc(TL.getNameLoc());
@@ -2836,7 +2836,7 @@
if (Result.isNull())
return QualType();
}
-
+
ExtVectorTypeLoc NewTL = TLB.push<ExtVectorTypeLoc>(Result);
NewTL.setNameLoc(TL.getNameLoc());
@@ -2914,12 +2914,12 @@
llvm::SmallVector<ParmVarDecl*, 4> ParamDecls;
if (getDerived().TransformFunctionTypeParams(TL, ParamTypes, ParamDecls))
return QualType();
-
+
FunctionProtoType *T = TL.getTypePtr();
QualType ResultType = getDerived().TransformType(TLB, TL.getResultLoc());
if (ResultType.isNull())
return QualType();
-
+
QualType Result = TL.getType();
if (getDerived().AlwaysRebuild() ||
ResultType != T->getResultType() ||
@@ -3227,7 +3227,7 @@
TypeLocBuilder IgnoredTLB;
return TransformTemplateSpecializationType(IgnoredTLB, TL, ObjectType);
}
-
+
template<typename Derived>
QualType TreeTransform<Derived>::TransformTemplateSpecializationType(
TypeLocBuilder &TLB,
@@ -3331,10 +3331,10 @@
NewTemplateId == QualType(TemplateId, 0))
return QualType(T, 0);
- Result = getDerived().RebuildDependentNameType(T->getKeyword(), NNS,
+ Result = getDerived().RebuildDependentNameType(T->getKeyword(), NNS,
NewTemplateId);
} else {
- Result = getDerived().RebuildDependentNameType(T->getKeyword(), NNS,
+ Result = getDerived().RebuildDependentNameType(T->getKeyword(), NNS,
T->getIdentifier(), SR);
}
if (Result.isNull())
@@ -3477,7 +3477,7 @@
OwningExprResult Cond(SemaRef);
VarDecl *ConditionVar = 0;
if (S->getConditionVariable()) {
- ConditionVar
+ ConditionVar
= cast_or_null<VarDecl>(
getDerived().TransformDefinition(
S->getConditionVariable()->getLocation(),
@@ -3486,11 +3486,11 @@
return SemaRef.StmtError();
} else {
Cond = getDerived().TransformExpr(S->getCond());
-
+
if (Cond.isInvalid())
return SemaRef.StmtError();
}
-
+
Sema::FullExprArg FullCond(getSema().MakeFullExpr(Cond));
// Transform the "then" branch.
@@ -3522,7 +3522,7 @@
OwningExprResult Cond(SemaRef);
VarDecl *ConditionVar = 0;
if (S->getConditionVariable()) {
- ConditionVar
+ ConditionVar
= cast_or_null<VarDecl>(
getDerived().TransformDefinition(
S->getConditionVariable()->getLocation(),
@@ -3531,13 +3531,13 @@
return SemaRef.StmtError();
} else {
Cond = getDerived().TransformExpr(S->getCond());
-
+
if (Cond.isInvalid())
return SemaRef.StmtError();
}
Sema::FullExprArg FullCond(getSema().MakeFullExpr(Cond));
-
+
// Rebuild the switch statement.
OwningStmtResult Switch = getDerived().RebuildSwitchStmtStart(FullCond,
ConditionVar);
@@ -3561,7 +3561,7 @@
OwningExprResult Cond(SemaRef);
VarDecl *ConditionVar = 0;
if (S->getConditionVariable()) {
- ConditionVar
+ ConditionVar
= cast_or_null<VarDecl>(
getDerived().TransformDefinition(
S->getConditionVariable()->getLocation(),
@@ -3570,7 +3570,7 @@
return SemaRef.StmtError();
} else {
Cond = getDerived().TransformExpr(S->getCond());
-
+
if (Cond.isInvalid())
return SemaRef.StmtError();
}
@@ -3627,7 +3627,7 @@
OwningExprResult Cond(SemaRef);
VarDecl *ConditionVar = 0;
if (S->getConditionVariable()) {
- ConditionVar
+ ConditionVar
= cast_or_null<VarDecl>(
getDerived().TransformDefinition(
S->getConditionVariable()->getLocation(),
@@ -3636,7 +3636,7 @@
return SemaRef.StmtError();
} else {
Cond = getDerived().TransformExpr(S->getCond());
-
+
if (Cond.isInvalid())
return SemaRef.StmtError();
}
@@ -3747,7 +3747,7 @@
template<typename Derived>
Sema::OwningStmtResult
TreeTransform<Derived>::TransformAsmStmt(AsmStmt *S) {
-
+
ASTOwningVector<&ActionBase::DeleteExpr> Constraints(getSema());
ASTOwningVector<&ActionBase::DeleteExpr> Exprs(getSema());
llvm::SmallVector<IdentifierInfo *, 4> Names;
@@ -3756,43 +3756,43 @@
ASTOwningVector<&ActionBase::DeleteExpr> Clobbers(getSema());
bool ExprsChanged = false;
-
+
// Go through the outputs.
for (unsigned I = 0, E = S->getNumOutputs(); I != E; ++I) {
Names.push_back(S->getOutputIdentifier(I));
-
+
// No need to transform the constraint literal.
Constraints.push_back(S->getOutputConstraintLiteral(I)->Retain());
-
+
// Transform the output expr.
Expr *OutputExpr = S->getOutputExpr(I);
OwningExprResult Result = getDerived().TransformExpr(OutputExpr);
if (Result.isInvalid())
return SemaRef.StmtError();
-
+
ExprsChanged |= Result.get() != OutputExpr;
-
+
Exprs.push_back(Result.takeAs<Expr>());
}
-
+
// Go through the inputs.
for (unsigned I = 0, E = S->getNumInputs(); I != E; ++I) {
Names.push_back(S->getInputIdentifier(I));
-
+
// No need to transform the constraint literal.
Constraints.push_back(S->getInputConstraintLiteral(I)->Retain());
-
+
// Transform the input expr.
Expr *InputExpr = S->getInputExpr(I);
OwningExprResult Result = getDerived().TransformExpr(InputExpr);
if (Result.isInvalid())
return SemaRef.StmtError();
-
+
ExprsChanged |= Result.get() != InputExpr;
-
+
Exprs.push_back(Result.takeAs<Expr>());
}
-
+
if (!getDerived().AlwaysRebuild() && !ExprsChanged)
return SemaRef.Owned(S->Retain());
@@ -3825,7 +3825,7 @@
OwningStmtResult TryBody = getDerived().TransformStmt(S->getTryBody());
if (TryBody.isInvalid())
return SemaRef.StmtError();
-
+
// Transform the @catch statements (if present).
bool AnyCatchChanged = false;
ASTOwningVector<&ActionBase::DeleteStmt> CatchStmts(SemaRef);
@@ -3837,7 +3837,7 @@
AnyCatchChanged = true;
CatchStmts.push_back(Catch.release());
}
-
+
// Transform the @finally statement (if present).
OwningStmtResult Finally(SemaRef);
if (S->getFinallyStmt()) {
@@ -3852,7 +3852,7 @@
!AnyCatchChanged &&
Finally.get() == S->getFinallyStmt())
return SemaRef.Owned(S->Retain());
-
+
// Build a new statement.
return getDerived().RebuildObjCAtTryStmt(S->getAtTryLoc(), move(TryBody),
move_arg(CatchStmts), move(Finally));
@@ -3870,26 +3870,26 @@
if (!TSInfo)
return SemaRef.StmtError();
}
-
+
QualType T;
if (TSInfo)
T = TSInfo->getType();
else {
T = getDerived().TransformType(FromVar->getType());
if (T.isNull())
- return SemaRef.StmtError();
+ return SemaRef.StmtError();
}
-
+
Var = getDerived().RebuildObjCExceptionDecl(FromVar, TSInfo, T);
if (!Var)
return SemaRef.StmtError();
}
-
+
OwningStmtResult Body = getDerived().TransformStmt(S->getCatchBody());
if (Body.isInvalid())
return SemaRef.StmtError();
-
- return getDerived().RebuildObjCAtCatchStmt(S->getAtCatchLoc(),
+
+ return getDerived().RebuildObjCAtCatchStmt(S->getAtCatchLoc(),
S->getRParenLoc(),
Var, move(Body));
}
@@ -3901,7 +3901,7 @@
OwningStmtResult Body = getDerived().TransformStmt(S->getFinallyBody());
if (Body.isInvalid())
return SemaRef.StmtError();
-
+
// If nothing changed, just retain this statement.
if (!getDerived().AlwaysRebuild() &&
Body.get() == S->getFinallyBody())
@@ -3921,11 +3921,11 @@
if (Operand.isInvalid())
return getSema().StmtError();
}
-
+
if (!getDerived().AlwaysRebuild() &&
Operand.get() == S->getThrowExpr())
return getSema().Owned(S->Retain());
-
+
return getDerived().RebuildObjCAtThrowStmt(S->getThrowLoc(), move(Operand));
}
@@ -3937,12 +3937,12 @@
OwningExprResult Object = getDerived().TransformExpr(S->getSynchExpr());
if (Object.isInvalid())
return SemaRef.StmtError();
-
+
// Transform the body.
OwningStmtResult Body = getDerived().TransformStmt(S->getSynchBody());
if (Body.isInvalid())
return SemaRef.StmtError();
-
+
// If nothing change, just retain the current statement.
if (!getDerived().AlwaysRebuild() &&
Object.get() == S->getSynchExpr() &&
@@ -3962,24 +3962,24 @@
OwningStmtResult Element = getDerived().TransformStmt(S->getElement());
if (Element.isInvalid())
return SemaRef.StmtError();
-
+
// Transform the collection expression.
OwningExprResult Collection = getDerived().TransformExpr(S->getCollection());
if (Collection.isInvalid())
return SemaRef.StmtError();
-
+
// Transform the body.
OwningStmtResult Body = getDerived().TransformStmt(S->getBody());
if (Body.isInvalid())
return SemaRef.StmtError();
-
+
// If nothing changed, just retain this statement.
if (!getDerived().AlwaysRebuild() &&
Element.get() == S->getElement() &&
Collection.get() == S->getCollection() &&
Body.get() == S->getBody())
return SemaRef.Owned(S->Retain());
-
+
// Build a new statement.
return getDerived().RebuildObjCForCollectionStmt(S->getForLoc(),
/*FIXME:*/S->getForLoc(),
@@ -4093,7 +4093,7 @@
if (!ND)
return SemaRef.ExprError();
- if (!getDerived().AlwaysRebuild() &&
+ if (!getDerived().AlwaysRebuild() &&
Qualifier == E->getQualifier() &&
ND == E->getDecl() &&
!E->hasExplicitTemplateArgumentList()) {
@@ -4188,12 +4188,12 @@
TypeSourceInfo *Type = getDerived().TransformType(E->getTypeSourceInfo());
if (!Type)
return getSema().ExprError();
-
+
// Transform all of the components into components similar to what the
// parser uses.
- // FIXME: It would be slightly more efficient in the non-dependent case to
- // just map FieldDecls, rather than requiring the rebuilder to look for
- // the fields again. However, __builtin_offsetof is rare enough in
+ // FIXME: It would be slightly more efficient in the non-dependent case to
+ // just map FieldDecls, rather than requiring the rebuilder to look for
+ // the fields again. However, __builtin_offsetof is rare enough in
// template code that we don't care.
bool ExprChanged = false;
typedef Action::OffsetOfComponent Component;
@@ -4211,36 +4211,36 @@
OwningExprResult Index = getDerived().TransformExpr(FromIndex);
if (Index.isInvalid())
return getSema().ExprError();
-
+
ExprChanged = ExprChanged || Index.get() != FromIndex;
Comp.isBrackets = true;
Comp.U.E = Index.takeAs<Expr>(); // FIXME: leaked
break;
}
-
+
case Node::Field:
case Node::Identifier:
Comp.isBrackets = false;
Comp.U.IdentInfo = ON.getFieldName();
if (!Comp.U.IdentInfo)
continue;
-
+
break;
-
+
case Node::Base:
// Will be recomputed during the rebuild.
continue;
}
-
+
Components.push_back(Comp);
}
-
+
// If nothing changed, retain the existing expression.
if (!getDerived().AlwaysRebuild() &&
Type == E->getTypeSourceInfo() &&
!ExprChanged)
return SemaRef.Owned(E->Retain());
-
+
// Build a new offsetof expression.
return getDerived().RebuildOffsetOfExpr(E->getOperatorLoc(), Type,
Components.data(), Components.size(),
@@ -4385,7 +4385,7 @@
Member == E->getMemberDecl() &&
FoundDecl == E->getFoundDecl() &&
!E->hasExplicitTemplateArgumentList()) {
-
+
// Mark it referenced in the new context regardless.
// FIXME: this is a bit instantiation-specific.
SemaRef.MarkDeclarationReferenced(E->getMemberLoc(), Member);
@@ -4403,7 +4403,7 @@
TransArgs.addArgument(Loc);
}
}
-
+
// FIXME: Bogus source location for the operator
SourceLocation FakeOperatorLoc
= SemaRef.PP.getLocForEndOfToken(E->getBase()->getSourceRange().getEnd());
@@ -4662,7 +4662,7 @@
TreeTransform<Derived>::TransformImplicitValueInitExpr(
ImplicitValueInitExpr *E) {
TemporaryBase Rebase(*this, E->getLocStart(), DeclarationName());
-
+
// FIXME: Will we ever have proper type location here? Will we actually
// need to transform the type?
QualType T = getDerived().TransformType(E->getType());
@@ -4735,7 +4735,7 @@
}
template<typename Derived>
-Sema::OwningExprResult
+Sema::OwningExprResult
TreeTransform<Derived>::TransformStmtExpr(StmtExpr *E) {
OwningStmtResult SubStmt
= getDerived().TransformCompoundStmt(E->getSubStmt(), true);
@@ -4819,7 +4819,7 @@
case OO_Array_Delete:
llvm_unreachable("new and delete operators cannot use CXXOperatorCallExpr");
return SemaRef.ExprError();
-
+
case OO_Call: {
// This is a call to an object's operator().
assert(E->getNumArgs() >= 1 && "Object call is missing arguments");
@@ -4840,7 +4840,7 @@
for (unsigned I = 1, N = E->getNumArgs(); I != N; ++I) {
if (getDerived().DropCallArgument(E->getArg(I)))
break;
-
+
OwningExprResult Arg = getDerived().TransformExpr(E->getArg(I));
if (Arg.isInvalid())
return SemaRef.ExprError();
@@ -5195,7 +5195,7 @@
if (!OperatorDelete)
return SemaRef.ExprError();
}
-
+
if (!getDerived().AlwaysRebuild() &&
AllocType == E->getAllocatedType() &&
ArraySize.get() == E->getArraySize() &&
@@ -5225,9 +5225,9 @@
// Do nothing
} else if (const ConstantArrayType *ConsArrayT
= dyn_cast<ConstantArrayType>(ArrayT)) {
- ArraySize
+ ArraySize
= SemaRef.Owned(new (SemaRef.Context) IntegerLiteral(
- ConsArrayT->getSize(),
+ ConsArrayT->getSize(),
SemaRef.Context.getSizeType(),
/*FIXME:*/E->getLocStart()));
AllocType = ConsArrayT->getElementType();
@@ -5270,7 +5270,7 @@
if (!OperatorDelete)
return SemaRef.ExprError();
}
-
+
if (!getDerived().AlwaysRebuild() &&
Operand.get() == E->getArgument() &&
OperatorDelete == E->getOperatorDelete()) {
@@ -5297,14 +5297,14 @@
Sema::TypeTy *ObjectTypePtr = 0;
bool MayBePseudoDestructor = false;
- Base = SemaRef.ActOnStartCXXMemberReference(0, move(Base),
+ Base = SemaRef.ActOnStartCXXMemberReference(0, move(Base),
E->getOperatorLoc(),
E->isArrow()? tok::arrow : tok::period,
ObjectTypePtr,
MayBePseudoDestructor);
if (Base.isInvalid())
return SemaRef.ExprError();
-
+
QualType ObjectType = QualType::getFromOpaquePtr(ObjectTypePtr);
NestedNameSpecifier *Qualifier
= getDerived().TransformNestedNameSpecifier(E->getQualifier(),
@@ -5332,7 +5332,7 @@
SS.setScopeRep(Qualifier);
SS.setRange(E->getQualifierRange());
}
-
+
Sema::TypeTy *T = SemaRef.getDestructorName(E->getTildeLoc(),
*E->getDestroyedTypeIdentifier(),
E->getDestroyedTypeLoc(),
@@ -5341,7 +5341,7 @@
false);
if (!T)
return SemaRef.ExprError();
-
+
Destroyed
= SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.GetTypeFromParser(T),
E->getDestroyedTypeLoc());
@@ -5349,12 +5349,12 @@
TypeSourceInfo *ScopeTypeInfo = 0;
if (E->getScopeTypeInfo()) {
- ScopeTypeInfo = getDerived().TransformType(E->getScopeTypeInfo(),
+ ScopeTypeInfo = getDerived().TransformType(E->getScopeTypeInfo(),
ObjectType);
if (!ScopeTypeInfo)
return SemaRef.ExprError();
}
-
+
return getDerived().RebuildCXXPseudoDestructorExpr(move(Base),
E->getOperatorLoc(),
E->isArrow(),
@@ -5414,11 +5414,11 @@
Old->getQualifierRange());
if (!Qualifier)
return SemaRef.ExprError();
-
+
SS.setScopeRep(Qualifier);
SS.setRange(Old->getQualifierRange());
- }
-
+ }
+
if (Old->getNamingClass()) {
CXXRecordDecl *NamingClass
= cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
@@ -5426,7 +5426,7 @@
Old->getNamingClass()));
if (!NamingClass)
return SemaRef.ExprError();
-
+
R.setNamingClass(NamingClass);
}
@@ -5611,7 +5611,7 @@
CXXConstructorDecl *Constructor
= cast_or_null<CXXConstructorDecl>(
- getDerived().TransformDecl(E->getLocStart(),
+ getDerived().TransformDecl(E->getLocStart(),
E->getConstructor()));
if (!Constructor)
return SemaRef.ExprError();
@@ -5856,16 +5856,16 @@
// Determine the naming class.
if (!Old->getNamingClass()) {
- CXXRecordDecl *NamingClass
+ CXXRecordDecl *NamingClass
= cast_or_null<CXXRecordDecl>(getDerived().TransformDecl(
Old->getMemberLoc(),
Old->getNamingClass()));
if (!NamingClass)
return SemaRef.ExprError();
-
+
R.setNamingClass(NamingClass);
}
-
+
TemplateArgumentListInfo TransArgs;
if (Old->hasExplicitTemplateArgs()) {
TransArgs.setLAngleLoc(Old->getLAngleLoc());
@@ -5884,7 +5884,7 @@
// base (and therefore couldn't do the check) and a
// nested-name-qualifier (and therefore could do the lookup).
NamedDecl *FirstQualifierInScope = 0;
-
+
return getDerived().RebuildUnresolvedMemberExpr(move(Base),
BaseType,
Old->getOperatorLoc(),
@@ -5930,7 +5930,7 @@
OwningExprResult Arg = getDerived().TransformExpr(E->getArg(I));
if (Arg.isInvalid())
return SemaRef.ExprError();
-
+
ArgChanged = ArgChanged || Arg.get() != E->getArg(I);
Args.push_back(Arg.takeAs<Expr>());
}
@@ -5941,7 +5941,7 @@
= getDerived().TransformType(E->getClassReceiverTypeInfo());
if (!ReceiverTypeInfo)
return SemaRef.ExprError();
-
+
// If nothing changed, just retain the existing message send.
if (!getDerived().AlwaysRebuild() &&
ReceiverTypeInfo == E->getClassReceiverTypeInfo() && !ArgChanged)
@@ -5968,7 +5968,7 @@
if (!getDerived().AlwaysRebuild() &&
Receiver.get() == E->getInstanceReceiver() && !ArgChanged)
return SemaRef.Owned(E->Retain());
-
+
// Build a new instance message send.
return getDerived().RebuildObjCMessageExpr(move(Receiver),
E->getSelector(),
@@ -5999,12 +5999,12 @@
return SemaRef.ExprError();
// We don't need to transform the ivar; it will never change.
-
+
// If nothing changed, just retain the existing expression.
if (!getDerived().AlwaysRebuild() &&
Base.get() == E->getBase())
return SemaRef.Owned(E->Retain());
-
+
return getDerived().RebuildObjCIvarRefExpr(move(Base), E->getDecl(),
E->getLocation(),
E->isArrow(), E->isFreeIvar());
@@ -6017,14 +6017,14 @@
OwningExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
return SemaRef.ExprError();
-
+
// We don't need to transform the property; it will never change.
-
+
// If nothing changed, just retain the existing expression.
if (!getDerived().AlwaysRebuild() &&
Base.get() == E->getBase())
return SemaRef.Owned(E->Retain());
-
+
return getDerived().RebuildObjCPropertyRefExpr(move(Base), E->getProperty(),
E->getLocation());
}
@@ -6037,26 +6037,26 @@
// dependent parts. Just retain the existing declaration.
if (E->getInterfaceDecl())
return SemaRef.Owned(E->Retain());
-
+
// Transform the base expression.
OwningExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
return SemaRef.ExprError();
-
+
// We don't need to transform the getters/setters; they will never change.
-
+
// If nothing changed, just retain the existing expression.
if (!getDerived().AlwaysRebuild() &&
Base.get() == E->getBase())
return SemaRef.Owned(E->Retain());
-
+
return getDerived().RebuildObjCImplicitSetterGetterRefExpr(
E->getGetterMethod(),
E->getType(),
E->getSetterMethod(),
E->getLocation(),
move(Base));
-
+
}
template<typename Derived>
@@ -6073,12 +6073,12 @@
OwningExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
return SemaRef.ExprError();
-
+
// If nothing changed, just retain the existing expression.
if (!getDerived().AlwaysRebuild() &&
Base.get() == E->getBase())
return SemaRef.Owned(E->Retain());
-
+
return getDerived().RebuildObjCIsaExpr(move(Base), E->getIsaMemberLoc(),
E->isArrow());
}
@@ -6297,7 +6297,7 @@
// A valid resolved using typename decl points to exactly one type decl.
assert(++Using->shadow_begin() == Using->shadow_end());
Ty = cast<TypeDecl>((*Using->shadow_begin())->getTargetDecl());
-
+
} else {
assert(isa<UnresolvedUsingTypenameDecl>(D) &&
"UnresolvedUsingTypenameDecl transformed to non-using decl");
@@ -6422,7 +6422,7 @@
/*EnteringContext=*/false)
.template getAsVal<TemplateName>();
}
-
+
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::RebuildCXXOperatorCallExpr(OverloadedOperatorKind Op,
@@ -6516,7 +6516,7 @@
}
template<typename Derived>
-Sema::OwningExprResult
+Sema::OwningExprResult
TreeTransform<Derived>::RebuildCXXPseudoDestructorExpr(ExprArg Base,
SourceLocation OperatorLoc,
bool isArrow,
@@ -6536,7 +6536,7 @@
QualType BaseType = BaseE->getType();
if (BaseE->isTypeDependent() || Destroyed.getIdentifier() ||
(!isArrow && !BaseType->getAs<RecordType>()) ||
- (isArrow && BaseType->getAs<PointerType>() &&
+ (isArrow && BaseType->getAs<PointerType>() &&
!BaseType->getAs<PointerType>()->getPointeeType()
->template getAs<RecordType>())){
// This pseudo-destructor expression is still a pseudo-destructor.
@@ -6546,14 +6546,14 @@
Destroyed,
/*FIXME?*/true);
}
-
+
TypeSourceInfo *DestroyedType = Destroyed.getTypeSourceInfo();
DeclarationName Name
= SemaRef.Context.DeclarationNames.getCXXDestructorName(
SemaRef.Context.getCanonicalType(DestroyedType->getType()));
-
+
// FIXME: the ScopeType should be tacked onto SS.
-
+
return getSema().BuildMemberReferenceExpr(move(Base), BaseType,
OperatorLoc, isArrow,
SS, /*FIXME: FirstQualifier*/ 0,
More information about the cfe-commits
mailing list