[cfe-commits] r161303 - in /cfe/trunk/lib: CodeGen/CGDebugInfo.cpp Sema/SemaInit.cpp
Benjamin Kramer
benny.kra at googlemail.com
Sat Aug 4 10:00:46 PDT 2012
Author: d0k
Date: Sat Aug 4 12:00:46 2012
New Revision: 161303
URL: http://llvm.org/viewvc/llvm-project?rev=161303&view=rev
Log:
Simplify code, no functionality change.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/Sema/SemaInit.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=161303&r1=161302&r2=161303&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Sat Aug 4 12:00:46 2012
@@ -2601,9 +2601,7 @@
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 @@
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,
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=161303&r1=161302&r2=161303&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Sat Aug 4 12:00:46 2012
@@ -92,8 +92,7 @@
if (const IncompleteArrayType *IAT = dyn_cast<IncompleteArrayType>(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,
More information about the cfe-commits
mailing list