[swift-dev] help with looking up Foundation.NSString

Rafkind, Jon jon.rafkind at hpe.com
Wed Mar 16 17:49:45 CDT 2016


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?

--


More information about the swift-dev mailing list