summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h143
1 files changed, 50 insertions, 93 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
index 2452274a293..0d0a5a31726 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
@@ -27,112 +27,69 @@
// in another DWARF file.
//----------------------------------------------------------------------
-class DWARFDeclContext
-{
+class DWARFDeclContext {
public:
- struct Entry
- {
- Entry () :
- tag(0),
- name(NULL)
- {
- }
- Entry (dw_tag_t t, const char *n) :
- tag(t),
- name(n)
- {
- }
-
- bool
- NameMatches (const Entry& rhs) const
- {
- if (name == rhs.name)
- return true;
- else if (name && rhs.name)
- return strcmp(name, rhs.name) == 0;
- return false;
- }
-
- // Test operator
- explicit operator bool() const
- {
- return tag != 0;
- }
-
- dw_tag_t tag;
- const char *name;
- };
-
- DWARFDeclContext () :
- m_entries(),
- m_language(lldb::eLanguageTypeUnknown)
- {
+ struct Entry {
+ Entry() : tag(0), name(NULL) {}
+ Entry(dw_tag_t t, const char *n) : tag(t), name(n) {}
+
+ bool NameMatches(const Entry &rhs) const {
+ if (name == rhs.name)
+ return true;
+ else if (name && rhs.name)
+ return strcmp(name, rhs.name) == 0;
+ return false;
}
- void
- AppendDeclContext (dw_tag_t tag, const char *name)
- {
- m_entries.push_back(Entry(tag, name));
- }
+ // Test operator
+ explicit operator bool() const { return tag != 0; }
- bool
- operator ==(const DWARFDeclContext& rhs) const;
+ dw_tag_t tag;
+ const char *name;
+ };
- uint32_t
- GetSize() const
- {
- return m_entries.size();
- }
+ DWARFDeclContext() : m_entries(), m_language(lldb::eLanguageTypeUnknown) {}
- Entry &
- operator[] (uint32_t idx)
- {
- // "idx" must be valid
- return m_entries[idx];
- }
+ void AppendDeclContext(dw_tag_t tag, const char *name) {
+ m_entries.push_back(Entry(tag, name));
+ }
- const Entry &
- operator[] (uint32_t idx) const
- {
- // "idx" must be valid
- return m_entries[idx];
- }
+ bool operator==(const DWARFDeclContext &rhs) const;
- const char *
- GetQualifiedName () const;
+ uint32_t GetSize() const { return m_entries.size(); }
- // Same as GetQaulifiedName, but the life time of the returned string will
- // be that of the LLDB session.
- lldb_private::ConstString
- GetQualifiedNameAsConstString () const
- {
- return lldb_private::ConstString (GetQualifiedName ());
- }
+ Entry &operator[](uint32_t idx) {
+ // "idx" must be valid
+ return m_entries[idx];
+ }
- void
- Clear()
- {
- m_entries.clear();
- m_qualified_name.clear();
- }
+ const Entry &operator[](uint32_t idx) const {
+ // "idx" must be valid
+ return m_entries[idx];
+ }
- lldb::LanguageType
- GetLanguage() const
- {
- return m_language;
- }
+ const char *GetQualifiedName() const;
- void
- SetLanguage(lldb::LanguageType language)
- {
- m_language = language;
- }
+ // Same as GetQaulifiedName, but the life time of the returned string will
+ // be that of the LLDB session.
+ lldb_private::ConstString GetQualifiedNameAsConstString() const {
+ return lldb_private::ConstString(GetQualifiedName());
+ }
+
+ void Clear() {
+ m_entries.clear();
+ m_qualified_name.clear();
+ }
+
+ lldb::LanguageType GetLanguage() const { return m_language; }
+
+ void SetLanguage(lldb::LanguageType language) { m_language = language; }
protected:
- typedef std::vector<Entry> collection;
- collection m_entries;
- mutable std::string m_qualified_name;
- lldb::LanguageType m_language;
+ typedef std::vector<Entry> collection;
+ collection m_entries;
+ mutable std::string m_qualified_name;
+ lldb::LanguageType m_language;
};
-#endif // SymbolFileDWARF_DWARFDeclContext_h_
+#endif // SymbolFileDWARF_DWARFDeclContext_h_
OpenPOWER on IntegriCloud