mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Be more const correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1332 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
45ee091719
commit
8927973283
@ -179,13 +179,13 @@ inline ConstPoolBool *operator<=(const ConstPoolVal &V1,
|
|||||||
// Implement higher level instruction folding type instructions
|
// Implement higher level instruction folding type instructions
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
inline ConstPoolVal *ConstantFoldCastInstruction(ConstPoolVal *V,
|
inline ConstPoolVal *ConstantFoldCastInstruction(const ConstPoolVal *V,
|
||||||
const Type *DestTy) {
|
const Type *DestTy) {
|
||||||
return ConstRules::get(*V)->castTo(V, DestTy);
|
return ConstRules::get(*V)->castTo(V, DestTy);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
|
inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
|
||||||
ConstPoolVal *V) {
|
const ConstPoolVal *V) {
|
||||||
switch (Opcode) {
|
switch (Opcode) {
|
||||||
case Instruction::Not: return !*V;
|
case Instruction::Not: return !*V;
|
||||||
// TODO: Handle get element ptr instruction here in the future? GEP null?
|
// TODO: Handle get element ptr instruction here in the future? GEP null?
|
||||||
@ -194,8 +194,8 @@ inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline ConstPoolVal *ConstantFoldBinaryInstruction(unsigned Opcode,
|
inline ConstPoolVal *ConstantFoldBinaryInstruction(unsigned Opcode,
|
||||||
ConstPoolVal *V1,
|
const ConstPoolVal *V1,
|
||||||
ConstPoolVal *V2) {
|
const ConstPoolVal *V2) {
|
||||||
switch (Opcode) {
|
switch (Opcode) {
|
||||||
case Instruction::Add: return *V1 + *V2;
|
case Instruction::Add: return *V1 + *V2;
|
||||||
case Instruction::Sub: return *V1 - *V2;
|
case Instruction::Sub: return *V1 - *V2;
|
||||||
|
@ -179,13 +179,13 @@ inline ConstPoolBool *operator<=(const ConstPoolVal &V1,
|
|||||||
// Implement higher level instruction folding type instructions
|
// Implement higher level instruction folding type instructions
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
inline ConstPoolVal *ConstantFoldCastInstruction(ConstPoolVal *V,
|
inline ConstPoolVal *ConstantFoldCastInstruction(const ConstPoolVal *V,
|
||||||
const Type *DestTy) {
|
const Type *DestTy) {
|
||||||
return ConstRules::get(*V)->castTo(V, DestTy);
|
return ConstRules::get(*V)->castTo(V, DestTy);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
|
inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
|
||||||
ConstPoolVal *V) {
|
const ConstPoolVal *V) {
|
||||||
switch (Opcode) {
|
switch (Opcode) {
|
||||||
case Instruction::Not: return !*V;
|
case Instruction::Not: return !*V;
|
||||||
// TODO: Handle get element ptr instruction here in the future? GEP null?
|
// TODO: Handle get element ptr instruction here in the future? GEP null?
|
||||||
@ -194,8 +194,8 @@ inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline ConstPoolVal *ConstantFoldBinaryInstruction(unsigned Opcode,
|
inline ConstPoolVal *ConstantFoldBinaryInstruction(unsigned Opcode,
|
||||||
ConstPoolVal *V1,
|
const ConstPoolVal *V1,
|
||||||
ConstPoolVal *V2) {
|
const ConstPoolVal *V2) {
|
||||||
switch (Opcode) {
|
switch (Opcode) {
|
||||||
case Instruction::Add: return *V1 + *V2;
|
case Instruction::Add: return *V1 + *V2;
|
||||||
case Instruction::Sub: return *V1 - *V2;
|
case Instruction::Sub: return *V1 - *V2;
|
||||||
|
@ -179,13 +179,13 @@ inline ConstPoolBool *operator<=(const ConstPoolVal &V1,
|
|||||||
// Implement higher level instruction folding type instructions
|
// Implement higher level instruction folding type instructions
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
inline ConstPoolVal *ConstantFoldCastInstruction(ConstPoolVal *V,
|
inline ConstPoolVal *ConstantFoldCastInstruction(const ConstPoolVal *V,
|
||||||
const Type *DestTy) {
|
const Type *DestTy) {
|
||||||
return ConstRules::get(*V)->castTo(V, DestTy);
|
return ConstRules::get(*V)->castTo(V, DestTy);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
|
inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
|
||||||
ConstPoolVal *V) {
|
const ConstPoolVal *V) {
|
||||||
switch (Opcode) {
|
switch (Opcode) {
|
||||||
case Instruction::Not: return !*V;
|
case Instruction::Not: return !*V;
|
||||||
// TODO: Handle get element ptr instruction here in the future? GEP null?
|
// TODO: Handle get element ptr instruction here in the future? GEP null?
|
||||||
@ -194,8 +194,8 @@ inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline ConstPoolVal *ConstantFoldBinaryInstruction(unsigned Opcode,
|
inline ConstPoolVal *ConstantFoldBinaryInstruction(unsigned Opcode,
|
||||||
ConstPoolVal *V1,
|
const ConstPoolVal *V1,
|
||||||
ConstPoolVal *V2) {
|
const ConstPoolVal *V2) {
|
||||||
switch (Opcode) {
|
switch (Opcode) {
|
||||||
case Instruction::Add: return *V1 + *V2;
|
case Instruction::Add: return *V1 + *V2;
|
||||||
case Instruction::Sub: return *V1 - *V2;
|
case Instruction::Sub: return *V1 - *V2;
|
||||||
|
Loading…
Reference in New Issue
Block a user