diff options
author | Sean Callanan <scallanan@apple.com> | 2012-03-15 01:53:17 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2012-03-15 01:53:17 +0000 |
commit | cf12862a9a6b97b10b493dc62061877cc5e5c743 (patch) | |
tree | 6aa11151f921c0d26cc3a7122c13413c8df2584f /lldb/source/Expression/ASTResultSynthesizer.cpp | |
parent | 778324abe434adeef05b7d9af8f4d38bead14502 (diff) | |
download | bcm5719-llvm-cf12862a9a6b97b10b493dc62061877cc5e5c743.tar.gz bcm5719-llvm-cf12862a9a6b97b10b493dc62061877cc5e5c743.zip |
Strengthened LLDB's completion of object types.
Now when LLDB reports a variable, it has a
complete type. Similarly, when it reports
members of a struct, it completes their types.
Also, when it creates the result variable for
an expression, it ensures that variable's type
is complete.
This ensures compliance with Clang's
expectations, preventing potential crashes.
llvm-svn: 152771
Diffstat (limited to 'lldb/source/Expression/ASTResultSynthesizer.cpp')
-rw-r--r-- | lldb/source/Expression/ASTResultSynthesizer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/Expression/ASTResultSynthesizer.cpp b/lldb/source/Expression/ASTResultSynthesizer.cpp index de17ebd792a..2c7533864b5 100644 --- a/lldb/source/Expression/ASTResultSynthesizer.cpp +++ b/lldb/source/Expression/ASTResultSynthesizer.cpp @@ -16,6 +16,7 @@ #include "clang/AST/Expr.h" #include "clang/AST/Stmt.h" #include "clang/Parse/Parser.h" +#include "clang/Sema/SemaDiagnostic.h" #include "llvm/Support/Casting.h" #include "llvm/Support/raw_ostream.h" #include "lldb/Core/Log.h" @@ -329,8 +330,10 @@ ASTResultSynthesizer::SynthesizeBodyResult (CompoundStmt *Body, else result_ptr_id = &Ctx.Idents.get("$__lldb_expr_result_ptr"); - QualType ptr_qual_type; + m_sema->RequireCompleteType(SourceLocation(), expr_qual_type, clang::diag::err_incomplete_type); + QualType ptr_qual_type; + if (expr_qual_type->getAs<ObjCObjectType>() != NULL) ptr_qual_type = Ctx.getObjCObjectPointerType(expr_qual_type); else |