diff options
author | Greg Clayton <gclayton@apple.com> | 2013-07-11 22:46:58 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-07-11 22:46:58 +0000 |
commit | 57ee306789ba68992d537a65b3f107eadd18db2d (patch) | |
tree | 2d07b653b2b2dd7dc716b0119b16842861ee9eff /lldb/source/Commands/CommandObjectWatchpoint.cpp | |
parent | 37002ad30e7ccee79362e39e0a24c33f87efa993 (diff) | |
download | llvm-57ee306789ba68992d537a65b3f107eadd18db2d.zip llvm-57ee306789ba68992d537a65b3f107eadd18db2d.tar.gz llvm-57ee306789ba68992d537a65b3f107eadd18db2d.tar.bz2 |
Huge change to clean up types.
A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error.
This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness.
llvm-svn: 186130
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectWatchpoint.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp index 7a6a47e..c1f0c41 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.cpp +++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -1050,7 +1050,7 @@ protected: valobj_sp = valobj_list.GetValueObjectAtIndex(0); } - ClangASTType type; + ClangASTType clang_type; if (valobj_sp) { @@ -1063,7 +1063,7 @@ protected: size = m_option_watchpoint.watch_size == 0 ? valobj_sp->GetByteSize() : m_option_watchpoint.watch_size; } - type.SetClangType(valobj_sp->GetClangAST(), valobj_sp->GetClangType()); + clang_type = valobj_sp->GetClangType(); } else { @@ -1080,7 +1080,7 @@ protected: uint32_t watch_type = m_option_watchpoint.watch_type; error.Clear(); - Watchpoint *wp = target->CreateWatchpoint(addr, size, &type, watch_type, error).get(); + Watchpoint *wp = target->CreateWatchpoint(addr, size, &clang_type, watch_type, error).get(); if (wp) { wp->SetWatchSpec(command.GetArgumentAtIndex(0)); @@ -1292,12 +1292,10 @@ protected: // Fetch the type from the value object, the type of the watched object is the pointee type /// of the expression, so convert to that if we found a valid type. - ClangASTType type(valobj_sp->GetClangAST(), valobj_sp->GetClangType()); - if (type.IsValid()) - type.SetClangType(type.GetASTContext(), type.GetPointeeType()); + ClangASTType clang_type(valobj_sp->GetClangType()); Error error; - Watchpoint *wp = target->CreateWatchpoint(addr, size, &type, watch_type, error).get(); + Watchpoint *wp = target->CreateWatchpoint(addr, size, &clang_type, watch_type, error).get(); if (wp) { Stream &output_stream = result.GetOutputStream(); |