Alter the ExternalASTSource interface to permit by-name lookups. PCH continues to

bring in the entire lookup table at once.

Also, give ExternalSemaSource's vtable a home.  This is important because otherwise
any reference to it will cause RTTI to be emitted, and since clang is compiled
with -fno-rtti, that RTTI will contain unresolved references (to ExternalASTSource's
RTTI).  So this change makes it possible to subclass ExternalSemaSource from projects
compiled with RTTI, as long as the subclass's home is compiled with -fno-rtti.

llvm-svn: 105268
This commit is contained in:
John McCall
2010-06-01 09:23:16 +00:00
parent ce83656f97
commit 75b960e5ee
8 changed files with 203 additions and 113 deletions

View File

@@ -3494,9 +3494,9 @@ void Sema::CodeCompleteObjCClassMessage(Scope *S, TypeTy *Receiver,
// If we have an external source, load the entire class method
// pool from the PCH file.
if (ExternalSource) {
for (uint32_t I = 0, N = ExternalSource->GetNumKnownSelectors(); I != N;
++I) {
Selector Sel = ExternalSource->GetSelector(I);
for (uint32_t I = 0, N = ExternalSource->GetNumExternalSelectors();
I != N; ++I) {
Selector Sel = ExternalSource->GetExternalSelector(I);
if (Sel.isNull() || FactoryMethodPool.count(Sel) ||
InstanceMethodPool.count(Sel))
continue;
@@ -3595,9 +3595,9 @@ void Sema::CodeCompleteObjCInstanceMessage(Scope *S, ExprTy *Receiver,
// If we have an external source, load the entire class method
// pool from the PCH file.
if (ExternalSource) {
for (uint32_t I = 0, N = ExternalSource->GetNumKnownSelectors(); I != N;
++I) {
Selector Sel = ExternalSource->GetSelector(I);
for (uint32_t I = 0, N = ExternalSource->GetNumExternalSelectors();
I != N; ++I) {
Selector Sel = ExternalSource->GetExternalSelector(I);
if (Sel.isNull() || InstanceMethodPool.count(Sel) ||
FactoryMethodPool.count(Sel))
continue;