1 //===-- DebugMacros.h -------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_DebugMacros_h_
11 #define liblldb_DebugMacros_h_
18 // Other libraries and framework includes
20 #include "lldb/lldb-private.h"
21 #include "lldb/Core/ConstString.h"
23 namespace lldb_private {
27 typedef std::shared_ptr<DebugMacros> DebugMacrosSP;
43 static DebugMacroEntry
44 CreateDefineEntry(uint32_t line, const char *str);
46 static DebugMacroEntry
47 CreateUndefEntry(uint32_t line, const char *str);
49 static DebugMacroEntry
50 CreateStartFileEntry(uint32_t line, uint32_t debug_line_file_idx);
52 static DebugMacroEntry
55 static DebugMacroEntry
56 CreateIndirectEntry(const DebugMacrosSP &debug_macros_sp);
58 DebugMacroEntry() : m_type(INVALID) { }
60 ~DebugMacroEntry() = default;
75 GetMacroString() const
80 const FileSpec& GetFileSpec(CompileUnit *comp_unit) const;
83 GetIndirectDebugMacros() const
85 return m_debug_macros_sp.get();
89 DebugMacroEntry(EntryType type,
91 uint32_t debug_line_file_idx,
94 DebugMacroEntry(EntryType type,
95 const DebugMacrosSP &debug_macros_sp);
99 uint32_t m_debug_line_file_idx;
101 DebugMacrosSP m_debug_macros_sp;
107 DebugMacros() = default;
109 ~DebugMacros() = default;
112 AddMacroEntry(const DebugMacroEntry &entry)
114 m_macro_entries.push_back(entry);
118 GetNumMacroEntries() const
120 return m_macro_entries.size();
124 GetMacroEntryAtIndex(const size_t index) const
126 if (index < m_macro_entries.size())
127 return m_macro_entries[index];
129 return DebugMacroEntry();
133 DISALLOW_COPY_AND_ASSIGN(DebugMacros);
135 std::vector<DebugMacroEntry> m_macro_entries;
138 } // namespace lldb_private
140 #endif // liblldb_DebugMacros_h_