diff options
| author | Sean Callanan <scallanan@apple.com> | 2011-11-30 22:11:59 +0000 |
|---|---|---|
| committer | Sean Callanan <scallanan@apple.com> | 2011-11-30 22:11:59 +0000 |
| commit | 09ab4b777cdb7ec45e8a8e4181b1d2ab2de3909f (patch) | |
| tree | f01460199e269f935d50beb0b3ba05f7b1a15ca9 /lldb/source/Expression/ClangASTSource.cpp | |
| parent | 9430e284a9007154fac11ba832064ed6a6afbac2 (diff) | |
| download | bcm5719-llvm-09ab4b777cdb7ec45e8a8e4181b1d2ab2de3909f.tar.gz bcm5719-llvm-09ab4b777cdb7ec45e8a8e4181b1d2ab2de3909f.zip | |
Added support to the Objective-C language runtime
to find Objective-C class types by looking in the
symbol tables for the individual object files.
I did this as follows:
- I added code to SymbolFileSymtab that vends
Clang types for symbols matching the pattern
"_OBJC_CLASS_$_NSMyClassName," making them
appear as Objective-C classes. This only occurs
in modules that do not have debug information,
since otherwise SymbolFileDWARF would be in
charge of looking up types.
- I made a new SymbolVendor subclass for the
Apple Objective-C runtime that is in charge of
making global lookups of Objective-C types. It
currently just sends out type lookup requests to
the appropriate SymbolFiles, but in the future we
will probably extend it to query the runtime more
completely.
I also modified a testcase whose behavior is changed
by the fact that we now actually return an Objective-C
type for __NSCFString.
llvm-svn: 145526
Diffstat (limited to 'lldb/source/Expression/ClangASTSource.cpp')
| -rw-r--r-- | lldb/source/Expression/ClangASTSource.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp index 5f3c8b15b30..db08539b977 100644 --- a/lldb/source/Expression/ClangASTSource.cpp +++ b/lldb/source/Expression/ClangASTSource.cpp @@ -17,6 +17,7 @@ #include "lldb/Expression/ClangExpression.h" #include "lldb/Symbol/ClangNamespaceDecl.h" #include "lldb/Symbol/SymbolVendor.h" +#include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Target.h" using namespace clang; @@ -460,11 +461,29 @@ ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context, SymbolContext null_sc; if (module_sp && namespace_decl) + { module_sp->FindTypes(null_sc, name, &namespace_decl, true, 1, types); + } else if(name != id_name && name != Class_name) + { m_target->GetImages().FindTypes (null_sc, name, true, 1, types); + + if (!types.GetSize()) + { + lldb::ProcessSP process = m_target->GetProcessSP(); + + if (process && process->GetObjCLanguageRuntime()) + { + SymbolVendor *objc_symbol_vendor = process->GetObjCLanguageRuntime()->GetSymbolVendor(); + + objc_symbol_vendor->FindTypes(null_sc, name, NULL, true, 1, types); + } + } + } else + { break; + } if (types.GetSize()) { @@ -484,6 +503,7 @@ ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context, context.AddTypeDecl(copied_type); } + } while(0); } |

