|
@@ -746,67 +746,110 @@ public:
|
|
|
/// member expression.
|
|
|
static QualType findBoundMemberType(const Expr *expr);
|
|
|
|
|
|
- /// IgnoreImpCasts - Skip past any implicit casts which might
|
|
|
- /// surround this expression. Only skips ImplicitCastExprs.
|
|
|
+ /// Skip past any implicit casts which might surround this expression until
|
|
|
+ /// reaching a fixed point. Skips:
|
|
|
+ /// * ImplicitCastExpr
|
|
|
+ /// * FullExpr
|
|
|
Expr *IgnoreImpCasts() LLVM_READONLY;
|
|
|
-
|
|
|
- /// IgnoreImplicit - Skip past any implicit AST nodes which might
|
|
|
- /// surround this expression.
|
|
|
- Expr *IgnoreImplicit() LLVM_READONLY {
|
|
|
- return cast<Expr>(Stmt::IgnoreImplicit());
|
|
|
- }
|
|
|
-
|
|
|
- const Expr *IgnoreImplicit() const LLVM_READONLY {
|
|
|
- return const_cast<Expr*>(this)->IgnoreImplicit();
|
|
|
+ const Expr *IgnoreImpCasts() const {
|
|
|
+ return const_cast<Expr *>(this)->IgnoreImpCasts();
|
|
|
}
|
|
|
|
|
|
- /// IgnoreParens - Ignore parentheses. If this Expr is a ParenExpr, return
|
|
|
- /// its subexpression. If that subexpression is also a ParenExpr,
|
|
|
- /// then this method recursively returns its subexpression, and so forth.
|
|
|
- /// Otherwise, the method returns the current Expr.
|
|
|
- Expr *IgnoreParens() LLVM_READONLY;
|
|
|
-
|
|
|
- /// IgnoreParenCasts - Ignore parentheses and casts. Strip off any ParenExpr
|
|
|
- /// or CastExprs, returning their operand.
|
|
|
- Expr *IgnoreParenCasts() LLVM_READONLY;
|
|
|
-
|
|
|
- /// Ignore casts. Strip off any CastExprs, returning their operand.
|
|
|
+ /// Skip past any casts which might surround this expression until reaching
|
|
|
+ /// a fixed point. Skips:
|
|
|
+ /// * CastExpr
|
|
|
+ /// * FullExpr
|
|
|
+ /// * MaterializeTemporaryExpr
|
|
|
+ /// * SubstNonTypeTemplateParmExpr
|
|
|
Expr *IgnoreCasts() LLVM_READONLY;
|
|
|
-
|
|
|
- /// IgnoreParenImpCasts - Ignore parentheses and implicit casts. Strip off
|
|
|
- /// any ParenExpr or ImplicitCastExprs, returning their operand.
|
|
|
+ const Expr *IgnoreCasts() const {
|
|
|
+ return const_cast<Expr *>(this)->IgnoreCasts();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// Skip past any implicit AST nodes which might surround this expression
|
|
|
+ /// until reaching a fixed point. Skips:
|
|
|
+ /// * What IgnoreImpCasts() skips
|
|
|
+ /// * MaterializeTemporaryExpr
|
|
|
+ /// * CXXBindTemporaryExpr
|
|
|
+ Expr *IgnoreImplicit() LLVM_READONLY;
|
|
|
+ const Expr *IgnoreImplicit() const {
|
|
|
+ return const_cast<Expr *>(this)->IgnoreImplicit();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// Skip past any parentheses which might surround this expression until
|
|
|
+ /// reaching a fixed point. Skips:
|
|
|
+ /// * ParenExpr
|
|
|
+ /// * UnaryOperator if `UO_Extension`
|
|
|
+ /// * GenericSelectionExpr if `!isResultDependent()`
|
|
|
+ /// * ChooseExpr if `!isConditionDependent()`
|
|
|
+ /// * ConstantExpr
|
|
|
+ Expr *IgnoreParens() LLVM_READONLY;
|
|
|
+ const Expr *IgnoreParens() const {
|
|
|
+ return const_cast<Expr *>(this)->IgnoreParens();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// Skip past any parentheses and implicit casts which might surround this
|
|
|
+ /// expression until reaching a fixed point.
|
|
|
+ /// FIXME: IgnoreParenImpCasts really ought to be equivalent to
|
|
|
+ /// IgnoreParens() + IgnoreImpCasts() until reaching a fixed point. However
|
|
|
+ /// this is currently not the case. Instead IgnoreParenImpCasts() skips:
|
|
|
+ /// * What IgnoreParens() skips
|
|
|
+ /// * ImplicitCastExpr
|
|
|
+ /// * MaterializeTemporaryExpr
|
|
|
+ /// * SubstNonTypeTemplateParmExpr
|
|
|
Expr *IgnoreParenImpCasts() LLVM_READONLY;
|
|
|
-
|
|
|
- /// IgnoreConversionOperator - Ignore conversion operator. If this Expr is a
|
|
|
- /// call to a conversion operator, return the argument.
|
|
|
- Expr *IgnoreConversionOperator() LLVM_READONLY;
|
|
|
-
|
|
|
- const Expr *IgnoreConversionOperator() const LLVM_READONLY {
|
|
|
- return const_cast<Expr*>(this)->IgnoreConversionOperator();
|
|
|
+ const Expr *IgnoreParenImpCasts() const {
|
|
|
+ return const_cast<Expr *>(this)->IgnoreParenImpCasts();
|
|
|
}
|
|
|
|
|
|
- const Expr *IgnoreParenImpCasts() const LLVM_READONLY {
|
|
|
- return const_cast<Expr*>(this)->IgnoreParenImpCasts();
|
|
|
+ /// Skip past any parentheses and casts which might surround this expression
|
|
|
+ /// until reaching a fixed point. Skips:
|
|
|
+ /// * What IgnoreParens() skips
|
|
|
+ /// * What IgnoreCasts() skips
|
|
|
+ Expr *IgnoreParenCasts() LLVM_READONLY;
|
|
|
+ const Expr *IgnoreParenCasts() const {
|
|
|
+ return const_cast<Expr *>(this)->IgnoreParenCasts();
|
|
|
}
|
|
|
|
|
|
- /// Ignore parentheses and lvalue casts. Strip off any ParenExpr and
|
|
|
- /// CastExprs that represent lvalue casts, returning their operand.
|
|
|
+ /// Skip conversion operators. If this Expr is a call to a conversion
|
|
|
+ /// operator, return the argument.
|
|
|
+ Expr *IgnoreConversionOperator() LLVM_READONLY;
|
|
|
+ const Expr *IgnoreConversionOperator() const {
|
|
|
+ return const_cast<Expr *>(this)->IgnoreConversionOperator();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// Skip past any parentheses and lvalue casts which might surround this
|
|
|
+ /// expression until reaching a fixed point. Skips:
|
|
|
+ /// * What IgnoreParens() skips
|
|
|
+ /// * What IgnoreCasts() skips, except that only lvalue-to-rvalue
|
|
|
+ /// casts are skipped
|
|
|
+ /// FIXME: This is intended purely as a temporary workaround for code
|
|
|
+ /// that hasn't yet been rewritten to do the right thing about those
|
|
|
+ /// casts, and may disappear along with the last internal use.
|
|
|
Expr *IgnoreParenLValueCasts() LLVM_READONLY;
|
|
|
-
|
|
|
- const Expr *IgnoreParenLValueCasts() const LLVM_READONLY {
|
|
|
- return const_cast<Expr*>(this)->IgnoreParenLValueCasts();
|
|
|
- }
|
|
|
-
|
|
|
- /// IgnoreParenNoopCasts - Ignore parentheses and casts that do not change the
|
|
|
- /// value (including ptr->int casts of the same size). Strip off any
|
|
|
- /// ParenExpr or CastExprs, returning their operand.
|
|
|
- Expr *IgnoreParenNoopCasts(ASTContext &Ctx) LLVM_READONLY;
|
|
|
-
|
|
|
- /// Ignore parentheses and derived-to-base casts.
|
|
|
+ const Expr *IgnoreParenLValueCasts() const {
|
|
|
+ return const_cast<Expr *>(this)->IgnoreParenLValueCasts();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// Skip past any parenthese and casts which do not change the value
|
|
|
+ /// (including ptr->int casts of the same size) until reaching a fixed point.
|
|
|
+ /// Skips:
|
|
|
+ /// * What IgnoreParens() skips
|
|
|
+ /// * CastExpr which do not change the value
|
|
|
+ /// * SubstNonTypeTemplateParmExpr
|
|
|
+ Expr *IgnoreParenNoopCasts(const ASTContext &Ctx) LLVM_READONLY;
|
|
|
+ const Expr *IgnoreParenNoopCasts(const ASTContext &Ctx) const {
|
|
|
+ return const_cast<Expr *>(this)->IgnoreParenNoopCasts(Ctx);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// Skip past any parentheses and derived-to-base casts until reaching a
|
|
|
+ /// fixed point. Skips:
|
|
|
+ /// * What IgnoreParens() skips
|
|
|
+ /// * CastExpr which represent a derived-to-base cast (CK_DerivedToBase,
|
|
|
+ /// CK_UncheckedDerivedToBase and CK_NoOp)
|
|
|
Expr *ignoreParenBaseCasts() LLVM_READONLY;
|
|
|
-
|
|
|
- const Expr *ignoreParenBaseCasts() const LLVM_READONLY {
|
|
|
- return const_cast<Expr*>(this)->ignoreParenBaseCasts();
|
|
|
+ const Expr *ignoreParenBaseCasts() const {
|
|
|
+ return const_cast<Expr *>(this)->ignoreParenBaseCasts();
|
|
|
}
|
|
|
|
|
|
/// Determine whether this expression is a default function argument.
|
|
@@ -825,24 +868,6 @@ public:
|
|
|
/// Whether this expression is an implicit reference to 'this' in C++.
|
|
|
bool isImplicitCXXThis() const;
|
|
|
|
|
|
- const Expr *IgnoreImpCasts() const LLVM_READONLY {
|
|
|
- return const_cast<Expr*>(this)->IgnoreImpCasts();
|
|
|
- }
|
|
|
- const Expr *IgnoreParens() const LLVM_READONLY {
|
|
|
- return const_cast<Expr*>(this)->IgnoreParens();
|
|
|
- }
|
|
|
- const Expr *IgnoreParenCasts() const LLVM_READONLY {
|
|
|
- return const_cast<Expr*>(this)->IgnoreParenCasts();
|
|
|
- }
|
|
|
- /// Strip off casts, but keep parentheses.
|
|
|
- const Expr *IgnoreCasts() const LLVM_READONLY {
|
|
|
- return const_cast<Expr*>(this)->IgnoreCasts();
|
|
|
- }
|
|
|
-
|
|
|
- const Expr *IgnoreParenNoopCasts(ASTContext &Ctx) const LLVM_READONLY {
|
|
|
- return const_cast<Expr*>(this)->IgnoreParenNoopCasts(Ctx);
|
|
|
- }
|
|
|
-
|
|
|
static bool hasAnyTypeDependentArguments(ArrayRef<Expr *> Exprs);
|
|
|
|
|
|
/// For an expression of class type or pointer to class type,
|
|
@@ -3167,18 +3192,6 @@ public:
|
|
|
friend class CastExpr;
|
|
|
};
|
|
|
|
|
|
-inline Expr *Expr::IgnoreImpCasts() {
|
|
|
- Expr *e = this;
|
|
|
- while (true)
|
|
|
- if (ImplicitCastExpr *ice = dyn_cast<ImplicitCastExpr>(e))
|
|
|
- e = ice->getSubExpr();
|
|
|
- else if (FullExpr *fe = dyn_cast<FullExpr>(e))
|
|
|
- e = fe->getSubExpr();
|
|
|
- else
|
|
|
- break;
|
|
|
- return e;
|
|
|
-}
|
|
|
-
|
|
|
/// ExplicitCastExpr - An explicit cast written in the source
|
|
|
/// code.
|
|
|
///
|