summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2020-01-01 22:42:25 +0100
committerRaphael Isemann <teemperor@gmail.com>2020-01-01 22:56:16 +0100
commit8dbe2f02c6d300e7222b5064b28c4d82a031647d (patch)
treee0a01e5ce68b48498dd9d6c5602c1c2a3deb0955
parent8ca79dac559219358b0c6bb00bded30935c7aa6a (diff)
downloadbcm5719-llvm-8dbe2f02c6d300e7222b5064b28c4d82a031647d.tar.gz
bcm5719-llvm-8dbe2f02c6d300e7222b5064b28c4d82a031647d.zip
[lldb][NFC] Simplify CompilerType constructors/destructors and fix unused variable warning
CompilerType has no virtual functions and no statements in its constructors, so we can simplify this code. This also allows Clang to emit unused variable warnings for CompilerType, so I also removed one unused variable that otherwise causes -Werror builds to fail.
-rw-r--r--lldb/include/lldb/Symbol/CompilerType.h11
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp2
-rw-r--r--lldb/source/Symbol/CompilerType.cpp6
3 files changed, 5 insertions, 14 deletions
diff --git a/lldb/include/lldb/Symbol/CompilerType.h b/lldb/include/lldb/Symbol/CompilerType.h
index ee87b53942b..660466be6b3 100644
--- a/lldb/include/lldb/Symbol/CompilerType.h
+++ b/lldb/include/lldb/Symbol/CompilerType.h
@@ -30,14 +30,13 @@ class DataExtractor;
class CompilerType {
public:
// Constructors and Destructors
- CompilerType(TypeSystem *type_system, lldb::opaque_compiler_type_t type);
+ CompilerType(TypeSystem *type_system, lldb::opaque_compiler_type_t type)
+ : m_type(type), m_type_system(type_system) {}
CompilerType(const CompilerType &rhs)
: m_type(rhs.m_type), m_type_system(rhs.m_type_system) {}
- CompilerType() : m_type(nullptr), m_type_system(nullptr) {}
-
- ~CompilerType();
+ CompilerType() = default;
// Operators
@@ -368,8 +367,8 @@ public:
}
private:
- lldb::opaque_compiler_type_t m_type;
- TypeSystem *m_type_system;
+ lldb::opaque_compiler_type_t m_type = nullptr;
+ TypeSystem *m_type_system = nullptr;
};
bool operator==(const CompilerType &lhs, const CompilerType &rhs);
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
index 7423f623efb..41d62a462ab 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
@@ -67,8 +67,6 @@ void ClangPersistentVariables::RemovePersistentVariable(
llvm::Optional<CompilerType>
ClangPersistentVariables::GetCompilerTypeFromPersistentDecl(
ConstString type_name) {
- CompilerType compiler_type;
-
PersistentDecl p = m_persistent_decls.lookup(type_name.GetCString());
if (p.m_decl == nullptr)
diff --git a/lldb/source/Symbol/CompilerType.cpp b/lldb/source/Symbol/CompilerType.cpp
index ba924bf84c0..09930f7a800 100644
--- a/lldb/source/Symbol/CompilerType.cpp
+++ b/lldb/source/Symbol/CompilerType.cpp
@@ -26,12 +26,6 @@
using namespace lldb;
using namespace lldb_private;
-CompilerType::CompilerType(TypeSystem *type_system,
- lldb::opaque_compiler_type_t type)
- : m_type(type), m_type_system(type_system) {}
-
-CompilerType::~CompilerType() {}
-
// Tests
bool CompilerType::IsAggregateType() const {
OpenPOWER on IntegriCloud