summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-24 19:46:37 +0000
committerChris Lattner <sabre@nondot.org>2009-01-24 19:46:37 +0000
commitb1355b1545e7d32d504e8aa06cdc09bac13c549b (patch)
treef8efafdc64e718b41044bff66800cb56d3d85696 /clang/lib
parent3cedd4dc643b548da418a77609329d2922aafcb3 (diff)
downloadbcm5719-llvm-b1355b1545e7d32d504e8aa06cdc09bac13c549b.tar.gz
bcm5719-llvm-b1355b1545e7d32d504e8aa06cdc09bac13c549b.zip
minor formatting changes, no functionality change.
llvm-svn: 62926
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 202f07b4bf5..9a4977d09b9 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1016,19 +1016,23 @@ bool Sema::CheckSizeOfAlignOfOperand(QualType exprType,
const SourceRange &ExprRange,
bool isSizeof) {
// C99 6.5.3.4p1:
- if (isa<FunctionType>(exprType) && isSizeof)
+ if (isa<FunctionType>(exprType)) {
// alignof(function) is allowed.
- Diag(OpLoc, diag::ext_sizeof_function_type) << ExprRange;
- else if (exprType->isVoidType())
+ if (isSizeof)
+ Diag(OpLoc, diag::ext_sizeof_function_type) << ExprRange;
+ return false;
+ }
+
+ if (exprType->isVoidType()) {
Diag(OpLoc, diag::ext_sizeof_void_type)
<< (isSizeof ? "sizeof" : "__alignof") << ExprRange;
- else
- return DiagnoseIncompleteType(OpLoc, exprType,
- isSizeof ? diag::err_sizeof_incomplete_type :
- diag::err_alignof_incomplete_type,
- ExprRange);
+ return false;
+ }
- return false;
+ return DiagnoseIncompleteType(OpLoc, exprType,
+ isSizeof ? diag::err_sizeof_incomplete_type :
+ diag::err_alignof_incomplete_type,
+ ExprRange);
}
/// ActOnSizeOfAlignOfExpr - Handle @c sizeof(type) and @c sizeof @c expr and
@@ -1059,8 +1063,8 @@ Sema::ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
// C99 6.5.3.4p4: the type (an unsigned integer type) is size_t.
return Owned(new (Context) SizeOfAlignOfExpr(isSizeof, isType, TyOrEx,
- Context.getSizeType(), OpLoc,
- Range.getEnd()));
+ Context.getSizeType(), OpLoc,
+ Range.getEnd()));
}
QualType Sema::CheckRealImagOperand(Expr *&V, SourceLocation Loc) {
OpenPOWER on IntegriCloud