summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-12-06 19:21:10 +0000
committerVedant Kumar <vsk@apple.com>2017-12-06 19:21:10 +0000
commit606908aab53851d390a7a989779798216f91dadb (patch)
tree79347246f29f5a8f1737daf487c0ef0b7867620b /lldb/source/Plugins/Process/gdb-remote
parent8465c38b1ecdb44eac9139a255f17eaae243b755 (diff)
downloadbcm5719-llvm-606908aab53851d390a7a989779798216f91dadb.tar.gz
bcm5719-llvm-606908aab53851d390a7a989779798216f91dadb.zip
Remove no-op function pointer null checks, NFC
Null-checking functions which aren't marked weak_import is a no-op (the compiler rewrites the check to 'true'), regardless of whether a library providing its definition is weak-linked. If the deployment target is greater than the minimum requirement, the availability markup on APIs does not lower to weak_import. Remove no-op null checks to clean up the code and silence warnings. Differential Revision: https://reviews.llvm.org/D40812 llvm-svn: 319936
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp7
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp20
2 files changed, 7 insertions, 20 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index c3f0d5dc2ee..949cf19db65 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -600,10 +600,9 @@ bool GDBRemoteCommunication::DecompressPacket() {
#if defined(HAVE_LIBCOMPRESSION)
// libcompression is weak linked so check that compression_decode_buffer() is
// available
- if (compression_decode_buffer != NULL &&
- (m_compression_type == CompressionType::ZlibDeflate ||
- m_compression_type == CompressionType::LZFSE ||
- m_compression_type == CompressionType::LZ4)) {
+ if (m_compression_type == CompressionType::ZlibDeflate ||
+ m_compression_type == CompressionType::LZFSE ||
+ m_compression_type == CompressionType::LZ4) {
compression_algorithm compression_type;
if (m_compression_type == CompressionType::LZFSE)
compression_type = COMPRESSION_LZFSE;
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 0078a14a060..e79f5d0c467 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1022,10 +1022,7 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression(
std::string avail_name;
#if defined(HAVE_LIBCOMPRESSION)
- // libcompression is weak linked so test if compression_decode_buffer() is
- // available
- if (compression_decode_buffer != NULL &&
- avail_type == CompressionType::None) {
+ if (avail_type == CompressionType::None) {
for (auto compression : supported_compressions) {
if (compression == "lzfse") {
avail_type = CompressionType::LZFSE;
@@ -1037,10 +1034,7 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression(
#endif
#if defined(HAVE_LIBCOMPRESSION)
- // libcompression is weak linked so test if compression_decode_buffer() is
- // available
- if (compression_decode_buffer != NULL &&
- avail_type == CompressionType::None) {
+ if (avail_type == CompressionType::None) {
for (auto compression : supported_compressions) {
if (compression == "zlib-deflate") {
avail_type = CompressionType::ZlibDeflate;
@@ -1064,10 +1058,7 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression(
#endif
#if defined(HAVE_LIBCOMPRESSION)
- // libcompression is weak linked so test if compression_decode_buffer() is
- // available
- if (compression_decode_buffer != NULL &&
- avail_type == CompressionType::None) {
+ if (avail_type == CompressionType::None) {
for (auto compression : supported_compressions) {
if (compression == "lz4") {
avail_type = CompressionType::LZ4;
@@ -1079,10 +1070,7 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression(
#endif
#if defined(HAVE_LIBCOMPRESSION)
- // libcompression is weak linked so test if compression_decode_buffer() is
- // available
- if (compression_decode_buffer != NULL &&
- avail_type == CompressionType::None) {
+ if (avail_type == CompressionType::None) {
for (auto compression : supported_compressions) {
if (compression == "lzma") {
avail_type = CompressionType::LZMA;
OpenPOWER on IntegriCloud