mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243146 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
1 parent
8cae9a32fc
commit
62eb62e6f5
2 files changed
+10
-10
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user