mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
implement a new CanType subclass of Type, for use when we known that we have a canonical type.
Unlike Type, it implements equality operators. It is returned by Type->getCanonicalType(). This adopts it in the minimal places required to get the build to work, it would also be nice to switch IRGen to canonical types and use it there. Swift SVN r1298
This commit is contained in:
@@ -167,13 +167,12 @@ void TUModuleCache::lookupValue(AccessPathTy AccessPath, Identifier Name,
|
||||
|
||||
namespace {
|
||||
class TUExtensionCache {
|
||||
llvm::DenseMap<TypeBase*, TinyPtrVector<ExtensionDecl*>> Extensions;
|
||||
llvm::DenseMap<CanType, TinyPtrVector<ExtensionDecl*>> Extensions;
|
||||
public:
|
||||
|
||||
TUExtensionCache(TranslationUnit &TU);
|
||||
|
||||
ArrayRef<ExtensionDecl*> getExtensions(TypeBase *T) const{
|
||||
assert(T->isCanonical());
|
||||
ArrayRef<ExtensionDecl*> getExtensions(CanType T) const{
|
||||
auto I = Extensions.find(T);
|
||||
if (I == Extensions.end())
|
||||
return ArrayRef<ExtensionDecl*>();
|
||||
|
||||
Reference in New Issue
Block a user