diff options
author | Sean Callanan <scallanan@apple.com> | 2012-12-18 00:50:17 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2012-12-18 00:50:17 +0000 |
commit | f53f5785674af89c021c8b3aa54552231273bb35 (patch) | |
tree | 7b82de366f00054761d7d7d85e284d5c4e1e8c58 /lldb/source/Expression/ASTResultSynthesizer.cpp | |
parent | 41bbf9c256b9266eeeb0746b330bde2aeabd891a (diff) | |
download | bcm5719-llvm-f53f5785674af89c021c8b3aa54552231273bb35.tar.gz bcm5719-llvm-f53f5785674af89c021c8b3aa54552231273bb35.zip |
Removed a possible use of unchecked NULL from
the AST result synthesizer's logging.
<rdar://problem/12889053>
llvm-svn: 170396
Diffstat (limited to 'lldb/source/Expression/ASTResultSynthesizer.cpp')
-rw-r--r-- | lldb/source/Expression/ASTResultSynthesizer.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lldb/source/Expression/ASTResultSynthesizer.cpp b/lldb/source/Expression/ASTResultSynthesizer.cpp index f295209f6bd..e33fd76168d 100644 --- a/lldb/source/Expression/ASTResultSynthesizer.cpp +++ b/lldb/source/Expression/ASTResultSynthesizer.cpp @@ -131,8 +131,6 @@ ASTResultSynthesizer::SynthesizeFunctionResult (FunctionDecl *FunDecl) { lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - ASTContext &Ctx(*m_ast_context); - if (!m_sema) return false; @@ -146,11 +144,11 @@ ASTResultSynthesizer::SynthesizeFunctionResult (FunctionDecl *FunDecl) std::string s; raw_string_ostream os(s); - Ctx.getTranslationUnitDecl()->print(os); + function_decl->print(os); os.flush(); - log->Printf("AST context before transforming:\n%s", s.c_str()); + log->Printf ("Untransformed function AST:\n%s", s.c_str()); } Stmt *function_body = function_decl->getBody(); @@ -178,9 +176,7 @@ bool ASTResultSynthesizer::SynthesizeObjCMethodResult (ObjCMethodDecl *MethodDecl) { lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - - ASTContext &Ctx(*m_ast_context); - + if (!m_sema) return false; @@ -192,11 +188,11 @@ ASTResultSynthesizer::SynthesizeObjCMethodResult (ObjCMethodDecl *MethodDecl) std::string s; raw_string_ostream os(s); - Ctx.getTranslationUnitDecl()->print(os); + MethodDecl->print(os); os.flush(); - log->Printf("AST context before transforming:\n%s", s.c_str()); + log->Printf ("Untransformed method AST:\n%s", s.c_str()); } Stmt *method_body = MethodDecl->getBody(); @@ -209,7 +205,7 @@ ASTResultSynthesizer::SynthesizeObjCMethodResult (ObjCMethodDecl *MethodDecl) bool ret = SynthesizeBodyResult (compound_stmt, MethodDecl); - if (log) + if (log && log->GetVerbose()) { std::string s; raw_string_ostream os(s); @@ -218,7 +214,7 @@ ASTResultSynthesizer::SynthesizeObjCMethodResult (ObjCMethodDecl *MethodDecl) os.flush(); - log->Printf("Transformed function AST:\n%s", s.c_str()); + log->Printf("Transformed method AST:\n%s", s.c_str()); } return ret; |