diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-13 13:46:43 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-13 14:40:20 +0000 |
| commit | 66f2ed07468f78768528483ab53afdd3c489172d (patch) | |
| tree | ba1a2ada3dde6fcacd0728dc1d533c25e59323d4 /llvm/lib/Target/PowerPC | |
| parent | d1bd5e476b6baeaaa7b5ad3debf4e4ff9bae295e (diff) | |
| download | bcm5719-llvm-66f2ed07468f78768528483ab53afdd3c489172d.tar.gz bcm5719-llvm-66f2ed07468f78768528483ab53afdd3c489172d.zip | |
PPCReduceCRLogicals - fix static analyzer warnings. NFC
- Fix uninitialized variable warnings.
- Fix null dereference warnings.
Diffstat (limited to 'llvm/lib/Target/PowerPC')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp b/llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp index 3b71ed219c1..9a4c7c219d7 100644 --- a/llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp +++ b/llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp @@ -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); |

