From e9c58c74698a99f0102bd1a134937876565f2d3c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 30 Jun 2015 20:18:49 +0000 Subject: Implement containsSymbol with other lower level methods. llvm-svn: 241112 --- llvm/lib/Object/ObjectFile.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/Object/ObjectFile.cpp') diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp index f6667d9ea6a..e850d3f189b 100644 --- a/llvm/lib/Object/ObjectFile.cpp +++ b/llvm/lib/Object/ObjectFile.cpp @@ -28,6 +28,13 @@ void ObjectFile::anchor() { } ObjectFile::ObjectFile(unsigned int Type, MemoryBufferRef Source) : SymbolicFile(Type, Source) {} +bool SectionRef::containsSymbol(SymbolRef S) const { + section_iterator SymSec = getObject()->section_end(); + if (S.getSection(SymSec)) + return false; + return *this == *SymSec; +} + std::error_code ObjectFile::printSymbolName(raw_ostream &OS, DataRefImpl Symb) const { StringRef Name; -- cgit v1.2.3