<div dir="ltr">I thought we prefered not to put const on Types. They don't have any non-const methods anyway do they?</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 24, 2015 at 12:19 PM, Pete Cooper <span dir="ltr"><<a href="mailto:peter_cooper@apple.com" target="_blank">peter_cooper@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: pete<br>
Date: Fri Jul 24 14:19:26 2015<br>
New Revision: 243146<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D243146-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=bfjjc_U-kHOppfxxrgj9myA90BThO_pIGNxwR5qZ0h8&s=Vzk_QX1UKr-3ExLd2t6GvJCoDuw8BuOiAl-PKKJPRA8&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=243146&view=rev</a><br>
Log:<br>
Add const to some Type* parameters which didn't need to be mutable. NFC.<br>
<br>
We were only getting the size of the type which doesn't need to modify<br>
the type.<br>
<br>
Modified:<br>
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp<br>
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp<br>
<br>
Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_Target_PowerPC_PPCISelLowering.cpp-3Frev-3D243146-26r1-3D243145-26r2-3D243146-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=bfjjc_U-kHOppfxxrgj9myA90BThO_pIGNxwR5qZ0h8&s=VcpPbEKQk5P6gY-rXywp0zhmZ4Z-J1ZKOvyjhhOCuVI&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=243146&r1=243145&r2=243146&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Fri Jul 24 14:19:26 2015<br>
@@ -925,22 +925,22 @@ PPCTargetLowering::PPCTargetLowering(con<br>
<br>
/// getMaxByValAlign - Helper for getByValTypeAlignment to determine<br>
/// the desired ByVal argument alignment.<br>
-static void getMaxByValAlign(Type *Ty, unsigned &MaxAlign,<br>
+static void getMaxByValAlign(const Type *Ty, unsigned &MaxAlign,<br>
unsigned MaxMaxAlign) {<br>
if (MaxAlign == MaxMaxAlign)<br>
return;<br>
- if (VectorType *VTy = dyn_cast<VectorType>(Ty)) {<br>
+ if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {<br>
if (MaxMaxAlign >= 32 && VTy->getBitWidth() >= 256)<br>
MaxAlign = 32;<br>
else if (VTy->getBitWidth() >= 128 && MaxAlign < 16)<br>
MaxAlign = 16;<br>
- } else if (ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {<br>
+ } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {<br>
unsigned EltAlign = 0;<br>
getMaxByValAlign(ATy->getElementType(), EltAlign, MaxMaxAlign);<br>
if (EltAlign > MaxAlign)<br>
MaxAlign = EltAlign;<br>
- } else if (StructType *STy = dyn_cast<StructType>(Ty)) {<br>
- for (auto *EltTy : STy->elements()) {<br>
+ } else if (const StructType *STy = dyn_cast<StructType>(Ty)) {<br>
+ for (const auto *EltTy : STy->elements()) {<br>
unsigned EltAlign = 0;<br>
getMaxByValAlign(EltTy, EltAlign, MaxMaxAlign);<br>
if (EltAlign > MaxAlign)<br>
<br>
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_Target_X86_X86ISelLowering.cpp-3Frev-3D243146-26r1-3D243145-26r2-3D243146-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=bfjjc_U-kHOppfxxrgj9myA90BThO_pIGNxwR5qZ0h8&s=ALpli0sI31q9RpSgG09WUMZahruCHhoAz_WjVKOdshk&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=243146&r1=243145&r2=243146&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Jul 24 14:19:26 2015<br>
@@ -1806,19 +1806,19 @@ EVT X86TargetLowering::getSetCCResultTyp<br>
<br>
/// Helper for getByValTypeAlignment to determine<br>
/// the desired ByVal argument alignment.<br>
-static void getMaxByValAlign(Type *Ty, unsigned &MaxAlign) {<br>
+static void getMaxByValAlign(const Type *Ty, unsigned &MaxAlign) {<br>
if (MaxAlign == 16)<br>
return;<br>
- if (VectorType *VTy = dyn_cast<VectorType>(Ty)) {<br>
+ if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {<br>
if (VTy->getBitWidth() == 128)<br>
MaxAlign = 16;<br>
- } else if (ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {<br>
+ } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {<br>
unsigned EltAlign = 0;<br>
getMaxByValAlign(ATy->getElementType(), EltAlign);<br>
if (EltAlign > MaxAlign)<br>
MaxAlign = EltAlign;<br>
- } else if (StructType *STy = dyn_cast<StructType>(Ty)) {<br>
- for (auto *EltTy : STy->elements()) {<br>
+ } else if (const StructType *STy = dyn_cast<StructType>(Ty)) {<br>
+ for (const auto *EltTy : STy->elements()) {<br>
unsigned EltAlign = 0;<br>
getMaxByValAlign(EltTy, EltAlign);<br>
if (EltAlign > MaxAlign)<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">~Craig</div>
</div>