mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	Simplify the logic, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240554 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		@@ -154,26 +154,22 @@ std::error_code COFFObjectFile::getSymbolAddress(DataRefImpl Ref,
 | 
				
			|||||||
                                                 uint64_t &Result) const {
 | 
					                                                 uint64_t &Result) const {
 | 
				
			||||||
  COFFSymbolRef Symb = getCOFFSymbol(Ref);
 | 
					  COFFSymbolRef Symb = getCOFFSymbol(Ref);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (Symb.isAnyUndefined()) {
 | 
					  if (Symb.isAnyUndefined() || Symb.isCommon()) {
 | 
				
			||||||
    Result = UnknownAddress;
 | 
					 | 
				
			||||||
    return std::error_code();
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  if (Symb.isCommon()) {
 | 
					 | 
				
			||||||
    Result = UnknownAddress;
 | 
					    Result = UnknownAddress;
 | 
				
			||||||
    return std::error_code();
 | 
					    return std::error_code();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  int32_t SectionNumber = Symb.getSectionNumber();
 | 
					  int32_t SectionNumber = Symb.getSectionNumber();
 | 
				
			||||||
  if (!COFF::isReservedSectionNumber(SectionNumber)) {
 | 
					  if (COFF::isReservedSectionNumber(SectionNumber)) {
 | 
				
			||||||
 | 
					    Result = Symb.getValue();
 | 
				
			||||||
 | 
					    return std::error_code();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const coff_section *Section = nullptr;
 | 
					  const coff_section *Section = nullptr;
 | 
				
			||||||
  if (std::error_code EC = getSection(SectionNumber, Section))
 | 
					  if (std::error_code EC = getSection(SectionNumber, Section))
 | 
				
			||||||
    return EC;
 | 
					    return EC;
 | 
				
			||||||
 | 
					 | 
				
			||||||
  Result = Section->VirtualAddress + Symb.getValue();
 | 
					  Result = Section->VirtualAddress + Symb.getValue();
 | 
				
			||||||
  return std::error_code();
 | 
					  return std::error_code();
 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  Result = Symb.getValue();
 | 
					 | 
				
			||||||
  return std::error_code();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
std::error_code COFFObjectFile::getSymbolType(DataRefImpl Ref,
 | 
					std::error_code COFFObjectFile::getSymbolType(DataRefImpl Ref,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user