aboutsummaryrefslogtreecommitdiffstats
path: root/include/clang/AST/Expr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/Expr.h')
-rw-r--r--include/clang/AST/Expr.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index d44a815c8699..ffa7d4db96a4 100644
--- a/include/clang/AST/Expr.h
+++ b/include/clang/AST/Expr.h
@@ -906,6 +906,11 @@ public:
return skipRValueSubobjectAdjustments(CommaLHSs, Adjustments);
}
+ /// Checks that the two Expr's will refer to the same value as a comparison
+ /// operand. The caller must ensure that the values referenced by the Expr's
+ /// are not modified between E1 and E2 or the result my be invalid.
+ static bool isSameComparisonOperand(const Expr* E1, const Expr* E2);
+
static bool classof(const Stmt *T) {
return T->getStmtClass() >= firstExprConstant &&
T->getStmtClass() <= lastExprConstant;
@@ -2619,9 +2624,8 @@ public:
/// + sizeof(Stmt *) bytes of storage, aligned to alignof(CallExpr):
///
/// \code{.cpp}
- /// llvm::AlignedCharArray<alignof(CallExpr),
- /// sizeof(CallExpr) + sizeof(Stmt *)> Buffer;
- /// CallExpr *TheCall = CallExpr::CreateTemporary(Buffer.buffer, etc);
+ /// alignas(CallExpr) char Buffer[sizeof(CallExpr) + sizeof(Stmt *)];
+ /// CallExpr *TheCall = CallExpr::CreateTemporary(Buffer, etc);
/// \endcode
static CallExpr *CreateTemporary(void *Mem, Expr *Fn, QualType Ty,
ExprValueKind VK, SourceLocation RParenLoc,
@@ -4496,6 +4500,8 @@ public:
// Explicit InitListExpr's originate from source code (and have valid source
// locations). Implicit InitListExpr's are created by the semantic analyzer.
+ // FIXME: This is wrong; InitListExprs created by semantic analysis have
+ // valid source locations too!
bool isExplicit() const {
return LBraceLoc.isValid() && RBraceLoc.isValid();
}
@@ -4830,6 +4836,10 @@ public:
SourceLocation getEqualOrColonLoc() const { return EqualOrColonLoc; }
void setEqualOrColonLoc(SourceLocation L) { EqualOrColonLoc = L; }
+ /// Whether this designated initializer should result in direct-initialization
+ /// of the designated subobject (eg, '{.foo{1, 2, 3}}').
+ bool isDirectInit() const { return EqualOrColonLoc.isInvalid(); }
+
/// Determines whether this designated initializer used the
/// deprecated GNU syntax for designated initializers.
bool usesGNUSyntax() const { return GNUSyntax; }