summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-07-24 19:19:26 +0000
committerPete Cooper <peter_cooper@apple.com>2015-07-24 19:19:26 +0000
commit098f7c1fcbb911b4cf178fa01a66ecb5c8adb5a8 (patch)
treeb08358081df8854b00be1a5ccf3034a5d805bd78 /llvm
parentb9bf447d9018209304d22b5b485fd315cc468236 (diff)
downloadbcm5719-llvm-098f7c1fcbb911b4cf178fa01a66ecb5c8adb5a8.tar.gz
bcm5719-llvm-098f7c1fcbb911b4cf178fa01a66ecb5c8adb5a8.zip
Add const to some Type* parameters which didn't need to be mutable. NFC.
We were only getting the size of the type which doesn't need to modify the type. llvm-svn: 243146
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.cpp10
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp10
2 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index c56f72525e7..c12a0dc7e85 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -925,22 +925,22 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
/// getMaxByValAlign - Helper for getByValTypeAlignment to determine
/// the desired ByVal argument alignment.
-static void getMaxByValAlign(Type *Ty, unsigned &MaxAlign,
+static void getMaxByValAlign(const Type *Ty, unsigned &MaxAlign,
unsigned MaxMaxAlign) {
if (MaxAlign == MaxMaxAlign)
return;
- if (VectorType *VTy = dyn_cast<VectorType>(Ty)) {
+ if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
if (MaxMaxAlign >= 32 && VTy->getBitWidth() >= 256)
MaxAlign = 32;
else if (VTy->getBitWidth() >= 128 && MaxAlign < 16)
MaxAlign = 16;
- } else if (ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
+ } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
unsigned EltAlign = 0;
getMaxByValAlign(ATy->getElementType(), EltAlign, MaxMaxAlign);
if (EltAlign > MaxAlign)
MaxAlign = EltAlign;
- } else if (StructType *STy = dyn_cast<StructType>(Ty)) {
- for (auto *EltTy : STy->elements()) {
+ } else if (const StructType *STy = dyn_cast<StructType>(Ty)) {
+ for (const auto *EltTy : STy->elements()) {
unsigned EltAlign = 0;
getMaxByValAlign(EltTy, EltAlign, MaxMaxAlign);
if (EltAlign > MaxAlign)
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index ec26c728080..a17d0da060f 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -1806,19 +1806,19 @@ EVT X86TargetLowering::getSetCCResultType(const DataLayout &DL, LLVMContext &,
/// Helper for getByValTypeAlignment to determine
/// the desired ByVal argument alignment.
-static void getMaxByValAlign(Type *Ty, unsigned &MaxAlign) {
+static void getMaxByValAlign(const Type *Ty, unsigned &MaxAlign) {
if (MaxAlign == 16)
return;
- if (VectorType *VTy = dyn_cast<VectorType>(Ty)) {
+ if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
if (VTy->getBitWidth() == 128)
MaxAlign = 16;
- } else if (ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
+ } else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
unsigned EltAlign = 0;
getMaxByValAlign(ATy->getElementType(), EltAlign);
if (EltAlign > MaxAlign)
MaxAlign = EltAlign;
- } else if (StructType *STy = dyn_cast<StructType>(Ty)) {
- for (auto *EltTy : STy->elements()) {
+ } else if (const StructType *STy = dyn_cast<StructType>(Ty)) {
+ for (const auto *EltTy : STy->elements()) {
unsigned EltAlign = 0;
getMaxByValAlign(EltTy, EltAlign);
if (EltAlign > MaxAlign)
OpenPOWER on IntegriCloud