mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-05 00:48:08 +00:00
Add an LLVM-style dump method to CompilerType for extra convenience during debugging
This change has no effect on Release (NoAsserts) builds. Differential Revision: https://reviews.llvm.org/D59102 llvm-svn: 355632
This commit is contained in:
parent
53954b5e12
commit
0c72a42a8f
@ -929,6 +929,13 @@ public:
|
||||
//----------------------------------------------------------------------
|
||||
// Dumping types
|
||||
//----------------------------------------------------------------------
|
||||
#ifndef NDEBUG
|
||||
/// Convenience LLVM-style dump method for use in the debugger only.
|
||||
/// In contrast to the other \p Dump() methods this directly invokes
|
||||
/// \p clang::QualType::dump().
|
||||
LLVM_DUMP_METHOD void dump(lldb::opaque_compiler_type_t type) const override;
|
||||
#endif
|
||||
|
||||
void Dump(Stream &s);
|
||||
|
||||
void DumpValue(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx,
|
||||
|
@ -388,6 +388,13 @@ public:
|
||||
//----------------------------------------------------------------------
|
||||
// Dumping types
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef NDEBUG
|
||||
/// Convenience LLVM-style dump method for use in the debugger only.
|
||||
/// Don't call this function from actual code.
|
||||
LLVM_DUMP_METHOD void dump() const;
|
||||
#endif
|
||||
|
||||
void DumpValue(ExecutionContext *exe_ctx, Stream *s, lldb::Format format,
|
||||
const DataExtractor &data, lldb::offset_t data_offset,
|
||||
size_t data_byte_size, uint32_t bitfield_bit_size,
|
||||
|
@ -355,6 +355,12 @@ public:
|
||||
// Dumping types
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#ifndef NDEBUG
|
||||
/// Convenience LLVM-style dump method for use in the debugger only.
|
||||
LLVM_DUMP_METHOD virtual void
|
||||
dump(lldb::opaque_compiler_type_t type) const = 0;
|
||||
#endif
|
||||
|
||||
virtual void DumpValue(lldb::opaque_compiler_type_t type,
|
||||
ExecutionContext *exe_ctx, Stream *s,
|
||||
lldb::Format format, const DataExtractor &data,
|
||||
|
@ -9086,6 +9086,16 @@ ClangASTContext::ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
|
||||
//----------------------------------------------------------------------
|
||||
#define DEPTH_INCREMENT 2
|
||||
|
||||
#ifndef NDEBUG
|
||||
LLVM_DUMP_METHOD void
|
||||
ClangASTContext::dump(lldb::opaque_compiler_type_t type) const {
|
||||
if (!type)
|
||||
return;
|
||||
clang::QualType qual_type(GetQualType(type));
|
||||
qual_type.dump();
|
||||
}
|
||||
#endif
|
||||
|
||||
void ClangASTContext::Dump(Stream &s) {
|
||||
Decl *tu = Decl::castFromDeclContext(GetTranslationUnitDecl());
|
||||
tu->dump(s.AsRawOstream());
|
||||
|
@ -800,6 +800,15 @@ void CompilerType::DumpTypeDescription(Stream *s) const {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
LLVM_DUMP_METHOD void CompilerType::dump() const {
|
||||
if (IsValid())
|
||||
m_type_system->dump(m_type);
|
||||
else
|
||||
llvm::errs() << "<invalid>\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
bool CompilerType::GetValueAsScalar(const lldb_private::DataExtractor &data,
|
||||
lldb::offset_t data_byte_offset,
|
||||
size_t data_byte_size,
|
||||
|
Loading…
x
Reference in New Issue
Block a user