aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-07-20 18:13:33 +0000
committerChris Lattner <sabre@nondot.org>2007-07-20 18:13:33 +0000
commitb1c2df99ba67ec6c29ac7dceaa4eb2c8cda4a017 (patch)
tree98bd36c219a63a4cd01a6db27c6b14ff58297455
parent31bb8be680ee2facf7fbb3c6c87b9bbd20248328 (diff)
fix a nasty bug Owen noticed in a gcc warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40110 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--AST/ASTContext.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp
index 0de2d5e4e6..29057b491f 100644
--- a/AST/ASTContext.cpp
+++ b/AST/ASTContext.cpp
@@ -160,18 +160,18 @@ ASTContext::getTypeInfo(QualType T, SourceLocation L) {
case Type::TypeName: assert(0 && "Not a canonical type!");
case Type::FunctionNoProto:
case Type::FunctionProto:
- assert(0 && "Incomplete types have no size!");
default:
+ assert(0 && "Incomplete types have no size!");
case Type::Array: {
std::pair<uint64_t, unsigned> EltInfo =
getTypeInfo(cast<ArrayType>(T)->getElementType(), L);
// Get the size of the array.
- llvm::APSInt Size(32);
- if (!cast<ArrayType>(T)->getSizeExpr()->isIntegerConstantExpr(Size, *this))
+ llvm::APSInt Sz(32);
+ if (!cast<ArrayType>(T)->getSizeExpr()->isIntegerConstantExpr(Sz, *this))
assert(0 && "VLAs not implemented yet!");
- Size = EltInfo.first*Size.getZExtValue();
+ Size = EltInfo.first*Sz.getZExtValue();
Align = EltInfo.second;
break;
}