forked from OSchip/llvm-project
				
			
							parent
							
								
									2a9baebae1
								
							
						
					
					
						commit
						24e24d51a1
					
				| 
						 | 
					@ -280,13 +280,10 @@ typedef llvm::DenseMap<DeclarationName, std::vector<NamedDecl*> >
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DeclContext::~DeclContext() {
 | 
					DeclContext::~DeclContext() {
 | 
				
			||||||
  unsigned Size = LookupPtr.getInt();
 | 
					  unsigned Size = LookupPtr.getInt();
 | 
				
			||||||
  if (Size == LookupIsMap) {
 | 
					  if (Size == LookupIsMap)
 | 
				
			||||||
    StoredDeclsMap *Map = static_cast<StoredDeclsMap*>(LookupPtr.getPointer());
 | 
					    delete static_cast<StoredDeclsMap*>(LookupPtr.getPointer());
 | 
				
			||||||
    delete Map;
 | 
					  else
 | 
				
			||||||
  } else {
 | 
					    delete [] static_cast<NamedDecl**>(LookupPtr.getPointer());
 | 
				
			||||||
    NamedDecl **Array = static_cast<NamedDecl**>(LookupPtr.getPointer());
 | 
					 | 
				
			||||||
    delete [] Array;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DeclContext::DestroyDecls(ASTContext &C) {
 | 
					void DeclContext::DestroyDecls(ASTContext &C) {
 | 
				
			||||||
| 
						 | 
					@ -412,10 +409,11 @@ DeclContext::lookup(DeclarationName Name) {
 | 
				
			||||||
  if (isLookupMap()) {
 | 
					  if (isLookupMap()) {
 | 
				
			||||||
    StoredDeclsMap *Map = static_cast<StoredDeclsMap*>(LookupPtr.getPointer());
 | 
					    StoredDeclsMap *Map = static_cast<StoredDeclsMap*>(LookupPtr.getPointer());
 | 
				
			||||||
    StoredDeclsMap::iterator Pos = Map->find(Name);
 | 
					    StoredDeclsMap::iterator Pos = Map->find(Name);
 | 
				
			||||||
    if (Pos != Map->end())
 | 
					    if (Pos == Map->end())
 | 
				
			||||||
      return lookup_result(&Pos->second.front(), 
 | 
					      return lookup_result(0, 0);
 | 
				
			||||||
                           &Pos->second.front() + Pos->second.size());
 | 
					    
 | 
				
			||||||
    return lookup_result(0, 0);
 | 
					    return lookup_result(&Pos->second.front(), 
 | 
				
			||||||
 | 
					                         &Pos->second.front() + Pos->second.size());
 | 
				
			||||||
  } 
 | 
					  } 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // We have a small array. Look into it.
 | 
					  // We have a small array. Look into it.
 | 
				
			||||||
| 
						 | 
					@ -566,7 +564,7 @@ void DeclContext::makeDeclVisibleInContextImpl(NamedDecl *D) {
 | 
				
			||||||
    DeclNameEntries.push_back(D);
 | 
					    DeclNameEntries.push_back(D);
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					
 | 
				
			||||||
  if (MayBeRedeclaration) {
 | 
					  if (MayBeRedeclaration) {
 | 
				
			||||||
    // Determine if this declaration is actually a redeclaration.
 | 
					    // Determine if this declaration is actually a redeclaration.
 | 
				
			||||||
    std::vector<NamedDecl *>::iterator Redecl
 | 
					    std::vector<NamedDecl *>::iterator Redecl
 | 
				
			||||||
| 
						 | 
					@ -578,11 +576,10 @@ void DeclContext::makeDeclVisibleInContextImpl(NamedDecl *D) {
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  // Put this declaration into the appropriate slot.
 | 
					  // Put this declaration into the appropriate slot.
 | 
				
			||||||
  if (isa<UsingDirectiveDecl>(D) ||
 | 
					  if (isa<UsingDirectiveDecl>(D) ||
 | 
				
			||||||
      D->getIdentifierNamespace() == Decl::IDNS_Tag ||
 | 
					      D->getIdentifierNamespace() == Decl::IDNS_Tag)
 | 
				
			||||||
      DeclNameEntries.empty())
 | 
					 | 
				
			||||||
    DeclNameEntries.push_back(D);
 | 
					    DeclNameEntries.push_back(D);
 | 
				
			||||||
  else if (DeclNameEntries.back()->getIdentifierNamespace() == Decl::IDNS_Tag) {
 | 
					  else if (DeclNameEntries.back()->getIdentifierNamespace() == Decl::IDNS_Tag) {
 | 
				
			||||||
    NamedDecl *TagD = DeclNameEntries.back();
 | 
					    NamedDecl *TagD = DeclNameEntries.back();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue