From: Benjamin Kramer Date: Sat, 4 Aug 2012 17:00:46 +0000 (+0000) Subject: Simplify code, no functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65263b4ec184212155c92740ab0bd363bb85c49e;p=clang Simplify code, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161303 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index dd0685e6a1..ce3d97abe3 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -2601,9 +2601,7 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var, if (T->isIncompleteArrayType()) { // CodeGen turns int[] into int[1] so we'll do the same here. - llvm::APSInt ConstVal(32); - - ConstVal = 1; + llvm::APInt ConstVal(32, 1); QualType ET = CGM.getContext().getAsArrayType(T)->getElementType(); T = CGM.getContext().getConstantArrayType(ET, ConstVal, @@ -2637,9 +2635,7 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var, if (T->isIncompleteArrayType()) { // CodeGen turns int[] into int[1] so we'll do the same here. - llvm::APSInt ConstVal(32); - - ConstVal = 1; + llvm::APInt ConstVal(32, 1); QualType ET = CGM.getContext().getAsArrayType(T)->getElementType(); T = CGM.getContext().getConstantArrayType(ET, ConstVal, diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 27d58b2310..62ab1e6450 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -92,8 +92,7 @@ static void CheckStringInit(Expr *Str, QualType &DeclT, const ArrayType *AT, if (const IncompleteArrayType *IAT = dyn_cast(AT)) { // C99 6.7.8p14. We have an array of character type with unknown size // being initialized to a string literal. - llvm::APSInt ConstVal(32); - ConstVal = StrLength; + llvm::APInt ConstVal(32, StrLength); // Return a new array type (C99 6.7.8p22). DeclT = S.Context.getConstantArrayType(IAT->getElementType(), ConstVal,