aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprCXX.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-06-17 03:11:08 +0000
committerTed Kremenek <kremenek@apple.com>2008-06-17 03:11:08 +0000
commit1060aff23f72135f8b50034a1e80f16725ebc56c (patch)
treea54715b51e86ed7132e55d87505bc1b81c4a233a /lib/AST/ExprCXX.cpp
parentf2f8d6c4718564dab73df3b5aa2d0be21bc6a163 (diff)
Fix more strict-aliasing warnings.
Fix indentation of class declarations in ExprCXX.h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52380 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprCXX.cpp')
-rw-r--r--lib/AST/ExprCXX.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
index 323fdd67a1..6069438137 100644
--- a/lib/AST/ExprCXX.cpp
+++ b/lib/AST/ExprCXX.cpp
@@ -20,12 +20,8 @@ using namespace clang;
// CXXCastExpr
-Stmt::child_iterator CXXCastExpr::child_begin() {
- return reinterpret_cast<Stmt**>(&Op);
-}
-Stmt::child_iterator CXXCastExpr::child_end() {
- return reinterpret_cast<Stmt**>(&Op)+1;
-}
+Stmt::child_iterator CXXCastExpr::child_begin() { return &Op; }
+Stmt::child_iterator CXXCastExpr::child_end() { return &Op+1; }
// CXXBoolLiteralExpr
Stmt::child_iterator CXXBoolLiteralExpr::child_begin() {
@@ -36,14 +32,10 @@ Stmt::child_iterator CXXBoolLiteralExpr::child_end() {
}
// CXXThrowExpr
-Stmt::child_iterator CXXThrowExpr::child_begin() {
- return reinterpret_cast<Stmt**>(&Op);
-}
+Stmt::child_iterator CXXThrowExpr::child_begin() { return &Op; }
Stmt::child_iterator CXXThrowExpr::child_end() {
// If Op is 0, we are processing throw; which has no children.
- if (Op == 0)
- return reinterpret_cast<Stmt**>(&Op)+0;
- return reinterpret_cast<Stmt**>(&Op)+1;
+ return Op ? &Op+1 : &Op;
}
// CXXDefaultArgExpr