forked from OSchip/llvm-project
PPCReduceCRLogicals - fix static analyzer warnings. NFC
- Fix uninitialized variable warnings. - Fix null dereference warnings.
This commit is contained in:
parent
d1bd5e476b
commit
66f2ed0746
|
@ -375,10 +375,10 @@ public:
|
|||
};
|
||||
|
||||
private:
|
||||
const PPCInstrInfo *TII;
|
||||
MachineFunction *MF;
|
||||
MachineRegisterInfo *MRI;
|
||||
const MachineBranchProbabilityInfo *MBPI;
|
||||
const PPCInstrInfo *TII = nullptr;
|
||||
MachineFunction *MF = nullptr;
|
||||
MachineRegisterInfo *MRI = nullptr;
|
||||
const MachineBranchProbabilityInfo *MBPI = nullptr;
|
||||
|
||||
// A vector to contain all the CR logical operations
|
||||
SmallVector<CRLogicalOpInfo, 16> AllCRLogicalOps;
|
||||
|
@ -470,21 +470,21 @@ PPCReduceCRLogicals::createCRLogicalOpInfo(MachineInstr &MIParam) {
|
|||
} else {
|
||||
MachineInstr *Def1 = lookThroughCRCopy(MIParam.getOperand(1).getReg(),
|
||||
Ret.SubregDef1, Ret.CopyDefs.first);
|
||||
assert(Def1 && "Must be able to find a definition of operand 1.");
|
||||
Ret.DefsSingleUse &=
|
||||
MRI->hasOneNonDBGUse(Def1->getOperand(0).getReg());
|
||||
Ret.DefsSingleUse &=
|
||||
MRI->hasOneNonDBGUse(Ret.CopyDefs.first->getOperand(0).getReg());
|
||||
assert(Def1 && "Must be able to find a definition of operand 1.");
|
||||
if (isBinary(MIParam)) {
|
||||
Ret.IsBinary = 1;
|
||||
MachineInstr *Def2 = lookThroughCRCopy(MIParam.getOperand(2).getReg(),
|
||||
Ret.SubregDef2,
|
||||
Ret.CopyDefs.second);
|
||||
assert(Def2 && "Must be able to find a definition of operand 2.");
|
||||
Ret.DefsSingleUse &=
|
||||
MRI->hasOneNonDBGUse(Def2->getOperand(0).getReg());
|
||||
Ret.DefsSingleUse &=
|
||||
MRI->hasOneNonDBGUse(Ret.CopyDefs.second->getOperand(0).getReg());
|
||||
assert(Def2 && "Must be able to find a definition of operand 2.");
|
||||
Ret.TrueDefs = std::make_pair(Def1, Def2);
|
||||
} else {
|
||||
Ret.TrueDefs = std::make_pair(Def1, nullptr);
|
||||
|
|
Loading…
Reference in New Issue