summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
diff options
context:
space:
mode:
authorJustin Hibbits <jrh29@alumni.cwru.edu>2015-02-12 05:31:31 +0000
committerJustin Hibbits <jrh29@alumni.cwru.edu>2015-02-12 05:31:31 +0000
commit6cfc85a067b88e120443a7cd0f0eceea16ebaf22 (patch)
treeb670300eebf17b38b04c47a4297f18d18c57a9c8 /lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
parent5c094b8751fba46ca6a9f773ffa807711cd2f505 (diff)
downloadbcm5719-llvm-6cfc85a067b88e120443a7cd0f0eceea16ebaf22.tar.gz
bcm5719-llvm-6cfc85a067b88e120443a7cd0f0eceea16ebaf22.zip
Quiet Coverity
Summary: Coverity warns that unsigned >= 0 is always true, and k_first_gpr_powerpc happens to be 0. Quiet Coverity by changing that comparison instead to a static_assert(), in case things change in the future. Reviewers: emaste Reviewed By: emaste Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7576 llvm-svn: 228908
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp')
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
index 828fb2571f7..e353e811476 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
@@ -159,9 +159,10 @@ g_reg_sets_powerpc[k_num_register_sets] =
{ "Altivec/VMX Registers", "vmx", k_num_vmx_registers_powerpc, g_vmx_regnums },
};
+static_assert(k_first_gpr_powerpc == 0, "GPRs must index starting at 0, or fix IsGPR()");
bool RegisterContextPOSIX_powerpc::IsGPR(unsigned reg)
{
- return (reg >= k_first_gpr_powerpc) && (reg <= k_last_gpr_powerpc); // GPR's come first.
+ return (reg <= k_last_gpr_powerpc); // GPR's come first.
}
bool
OpenPOWER on IntegriCloud