help with looking up Foundation.NSString


(Jon Rafkind) #1

I am trying to retrieve the ValueDecl associated with an NSString using the swiftc code base. I can find the Foundation module, but I cannot seem to retrieve the NSString type out of it.

swift::ModuleDecl * foundation = context->getLoadedModule(context->getIdentifier("Foundation")); // this is non-null, so the module was found
llvm::SmallVector<swift::ValueDecl *, 1> results;
foundation->lookupValue({}, context->getIdentifier("NSString"), swift::NLKind::UnqualifiedLookup, results);

'results' is empty. Is this an improper way to find the NSString type? What other method would work?

ยทยทยท

--