summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterClassInfo.cpp
diff options
context:
space:
mode:
authorMichael Ilseman <milseman@apple.com>2014-12-15 18:48:43 +0000
committerMichael Ilseman <milseman@apple.com>2014-12-15 18:48:43 +0000
commitaddddc441f9c7fbd4ed70bc5a3256c385599929d (patch)
treed418ffd0237296eef0ec82e40c001e7771dc66c3 /llvm/lib/CodeGen/RegisterClassInfo.cpp
parentb736bf38990c4d474b1267f90c0706a3c983a10f (diff)
downloadbcm5719-llvm-addddc441f9c7fbd4ed70bc5a3256c385599929d.tar.gz
bcm5719-llvm-addddc441f9c7fbd4ed70bc5a3256c385599929d.zip
Silence more static analyzer warnings.
Add in definedness checks for shift operators, null checks when pointers are assumed by the code to be non-null, and explicit unreachables. llvm-svn: 224255
Diffstat (limited to 'llvm/lib/CodeGen/RegisterClassInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterClassInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegisterClassInfo.cpp b/llvm/lib/CodeGen/RegisterClassInfo.cpp
index e0d1aa2b533..ab33672d41f 100644
--- a/llvm/lib/CodeGen/RegisterClassInfo.cpp
+++ b/llvm/lib/CodeGen/RegisterClassInfo.cpp
@@ -47,6 +47,7 @@ void RegisterClassInfo::runOnMachineFunction(const MachineFunction &mf) {
}
// Does this MF have different CSRs?
+ assert(TRI && "no register info set");
const MCPhysReg *CSR = TRI->getCalleeSavedRegs(MF);
if (Update || CSR != CalleeSaved) {
// Build a CSRNum map. Every CSR alias gets an entry pointing to the last
@@ -76,6 +77,7 @@ void RegisterClassInfo::runOnMachineFunction(const MachineFunction &mf) {
/// registers filtered out. Volatile registers come first followed by CSR
/// aliases ordered according to the CSR order specified by the target.
void RegisterClassInfo::compute(const TargetRegisterClass *RC) const {
+ assert(RC && "no register class given");
RCInfo &RCI = RegClass[RC->getID()];
// Raw register count, including all reserved regs.
OpenPOWER on IntegriCloud