mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 18:34:09 +00:00
MergeFunctions, tiny refactoring:
cmpAPInt has been renamed to cmpAPInts (multiple form). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216375 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
993a3f82cb
commit
4112da5f1f
@ -346,7 +346,7 @@ private:
|
|||||||
|
|
||||||
int cmpNumbers(uint64_t L, uint64_t R) const;
|
int cmpNumbers(uint64_t L, uint64_t R) const;
|
||||||
|
|
||||||
int cmpAPInt(const APInt &L, const APInt &R) const;
|
int cmpAPInts(const APInt &L, const APInt &R) const;
|
||||||
int cmpAPFloat(const APFloat &L, const APFloat &R) const;
|
int cmpAPFloat(const APFloat &L, const APFloat &R) const;
|
||||||
int cmpStrings(StringRef L, StringRef R) const;
|
int cmpStrings(StringRef L, StringRef R) const;
|
||||||
int cmpAttrs(const AttributeSet L, const AttributeSet R) const;
|
int cmpAttrs(const AttributeSet L, const AttributeSet R) const;
|
||||||
@ -412,7 +412,7 @@ int FunctionComparator::cmpNumbers(uint64_t L, uint64_t R) const {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FunctionComparator::cmpAPInt(const APInt &L, const APInt &R) const {
|
int FunctionComparator::cmpAPInts(const APInt &L, const APInt &R) const {
|
||||||
if (int Res = cmpNumbers(L.getBitWidth(), R.getBitWidth()))
|
if (int Res = cmpNumbers(L.getBitWidth(), R.getBitWidth()))
|
||||||
return Res;
|
return Res;
|
||||||
if (L.ugt(R)) return 1;
|
if (L.ugt(R)) return 1;
|
||||||
@ -424,7 +424,7 @@ int FunctionComparator::cmpAPFloat(const APFloat &L, const APFloat &R) const {
|
|||||||
if (int Res = cmpNumbers((uint64_t)&L.getSemantics(),
|
if (int Res = cmpNumbers((uint64_t)&L.getSemantics(),
|
||||||
(uint64_t)&R.getSemantics()))
|
(uint64_t)&R.getSemantics()))
|
||||||
return Res;
|
return Res;
|
||||||
return cmpAPInt(L.bitcastToAPInt(), R.bitcastToAPInt());
|
return cmpAPInts(L.bitcastToAPInt(), R.bitcastToAPInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
int FunctionComparator::cmpStrings(StringRef L, StringRef R) const {
|
int FunctionComparator::cmpStrings(StringRef L, StringRef R) const {
|
||||||
@ -541,7 +541,7 @@ int FunctionComparator::cmpConstants(const Constant *L, const Constant *R) {
|
|||||||
case Value::ConstantIntVal: {
|
case Value::ConstantIntVal: {
|
||||||
const APInt &LInt = cast<ConstantInt>(L)->getValue();
|
const APInt &LInt = cast<ConstantInt>(L)->getValue();
|
||||||
const APInt &RInt = cast<ConstantInt>(R)->getValue();
|
const APInt &RInt = cast<ConstantInt>(R)->getValue();
|
||||||
return cmpAPInt(LInt, RInt);
|
return cmpAPInts(LInt, RInt);
|
||||||
}
|
}
|
||||||
case Value::ConstantFPVal: {
|
case Value::ConstantFPVal: {
|
||||||
const APFloat &LAPF = cast<ConstantFP>(L)->getValueAPF();
|
const APFloat &LAPF = cast<ConstantFP>(L)->getValueAPF();
|
||||||
@ -860,7 +860,7 @@ int FunctionComparator::cmpGEPs(const GEPOperator *GEPL,
|
|||||||
APInt OffsetL(BitWidth, 0), OffsetR(BitWidth, 0);
|
APInt OffsetL(BitWidth, 0), OffsetR(BitWidth, 0);
|
||||||
if (GEPL->accumulateConstantOffset(*DL, OffsetL) &&
|
if (GEPL->accumulateConstantOffset(*DL, OffsetL) &&
|
||||||
GEPR->accumulateConstantOffset(*DL, OffsetR))
|
GEPR->accumulateConstantOffset(*DL, OffsetR))
|
||||||
return cmpAPInt(OffsetL, OffsetR);
|
return cmpAPInts(OffsetL, OffsetR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (int Res = cmpNumbers((uint64_t)GEPL->getPointerOperand()->getType(),
|
if (int Res = cmpNumbers((uint64_t)GEPL->getPointerOperand()->getType(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user