From e81233d0edf0b1313a6cc219ff6d4a506dadd66b Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Thu, 4 May 2017 10:54:35 +0000 Subject: [PATCH] [ArgPromotion] Fix a truncated variable This fixes a regression since SVN rev 273808 (which was supposed to not change functionality). The regression caused miscompilations (noted in the wild when targeting AArch64) on platforms with 32 bit long. Differential Revision: https://reviews.llvm.org/D32850 llvm-svn: 302137 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index 6408cad08d557..d8cf8d3f5da21 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -247,7 +247,7 @@ doPromotion(Function *F, SmallPtrSetImpl &ArgsToPromote, if (!ArgIndex.second.empty()) { Ops.reserve(ArgIndex.second.size()); Type *ElTy = V->getType(); - for (unsigned long II : ArgIndex.second) { + for (auto II : ArgIndex.second) { // Use i32 to index structs, and i64 for others (pointers/arrays). // This satisfies GEP constraints. Type *IdxTy =