summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2011-05-02 23:00:27 +0000
committerRichard Trieu <rtrieu@google.com>2011-05-02 23:00:27 +0000
commit6a505baa570baa27e392fdee79b47d196210612f (patch)
treedb8fb5c864f41268d5d5491f10abfc2e0cbe1f00 /clang/lib/Sema/SemaStmt.cpp
parent6eb74cd2e35723f5743ad673cf8bc0dbb21ed5cf (diff)
downloadbcm5719-llvm-6a505baa570baa27e392fdee79b47d196210612f.tar.gz
bcm5719-llvm-6a505baa570baa27e392fdee79b47d196210612f.zip
Added an assert to IntegerLiteral to ensure that the integer type passed in has the same size as the APInt passed in. Also, updated the comments around IntegerLiteral.
Changed the integer type that range-based for-loops used. Switched to pointer difference type, which satisfies the new assert in IntegerLiteral. llvm-svn: 130739
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r--clang/lib/Sema/SemaStmt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 65cea7a69d6..a60fcb7097c 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -1252,7 +1252,8 @@ Sema::BuildCXXForRangeStmt(SourceLocation ForLoc, SourceLocation ColonLoc,
ExprResult BoundExpr;
if (const ConstantArrayType *CAT = dyn_cast<ConstantArrayType>(UnqAT))
BoundExpr = Owned(IntegerLiteral::Create(Context, CAT->getSize(),
- Context.IntTy, RangeLoc));
+ Context.getPointerDiffType(),
+ RangeLoc));
else if (const VariableArrayType *VAT =
dyn_cast<VariableArrayType>(UnqAT))
BoundExpr = VAT->getSizeExpr();
OpenPOWER on IntegriCloud