diff options
author | Chris Lattner <sabre@nondot.org> | 2011-02-24 07:31:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-02-24 07:31:28 +0000 |
commit | 1d6ab7af99a1fc059a6aa5da083640c1d94b07f7 (patch) | |
tree | ed585b0a2943b7e0882b2bdb021921b8e2c80005 /lib/Sema/SemaStmt.cpp | |
parent | d7f758cb88ce56c5f49faae088ab5a4073c28fa6 (diff) |
compute the integer width, not the memory width here. We want to know that
_Bool is 1 bit, not 8. This fixes an assertion on the testcase, which is
PR9304 and rdar://9045501.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126368 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 64827ff177..89957e60de 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -502,8 +502,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch, bool HasDependentValue = CondExpr->isTypeDependent() || CondExpr->isValueDependent(); unsigned CondWidth - = HasDependentValue? 0 - : static_cast<unsigned>(Context.getTypeSize(CondTypeBeforePromotion)); + = HasDependentValue ? 0 : Context.getIntWidth(CondTypeBeforePromotion); bool CondIsSigned = CondTypeBeforePromotion->isSignedIntegerType(); // Accumulate all of the case values in a vector so that we can sort them |