diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:46:15 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:46:15 +0000 |
| commit | dd58ef019b700900793a1eb48b52123db01b654e (patch) | |
| tree | fcfbb4df56a744f4ddc6122c50521dd3f1c5e196 /include/llvm/Object/ObjectFile.h | |
| parent | 2fe5752e3a7c345cdb59e869278d36af33c13fa4 (diff) | |
Notes
Diffstat (limited to 'include/llvm/Object/ObjectFile.h')
| -rw-r--r-- | include/llvm/Object/ObjectFile.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/include/llvm/Object/ObjectFile.h b/include/llvm/Object/ObjectFile.h index 8dd525626218..ce0c891ee0c2 100644 --- a/include/llvm/Object/ObjectFile.h +++ b/include/llvm/Object/ObjectFile.h @@ -100,8 +100,7 @@ public: relocation_iterator relocation_begin() const; relocation_iterator relocation_end() const; iterator_range<relocation_iterator> relocations() const { - return iterator_range<relocation_iterator>(relocation_begin(), - relocation_end()); + return make_range(relocation_begin(), relocation_end()); } section_iterator getRelocatedSection() const; @@ -147,7 +146,7 @@ public: /// @brief Get section this symbol is defined in reference to. Result is /// end_sections() if it is undefined or is an absolute symbol. - std::error_code getSection(section_iterator &Result) const; + ErrorOr<section_iterator> getSection() const; const ObjectFile *getObject() const; }; @@ -202,8 +201,8 @@ protected: virtual uint32_t getSymbolAlignment(DataRefImpl Symb) const; virtual uint64_t getCommonSymbolSizeImpl(DataRefImpl Symb) const = 0; virtual SymbolRef::Type getSymbolType(DataRefImpl Symb) const = 0; - virtual std::error_code getSymbolSection(DataRefImpl Symb, - section_iterator &Res) const = 0; + virtual ErrorOr<section_iterator> + getSymbolSection(DataRefImpl Symb) const = 0; // Same as above for SectionRef. friend class SectionRef; @@ -323,8 +322,8 @@ inline uint64_t SymbolRef::getCommonSize() const { return getObject()->getCommonSymbolSize(getRawDataRefImpl()); } -inline std::error_code SymbolRef::getSection(section_iterator &Result) const { - return getObject()->getSymbolSection(getRawDataRefImpl(), Result); +inline ErrorOr<section_iterator> SymbolRef::getSection() const { + return getObject()->getSymbolSection(getRawDataRefImpl()); } inline SymbolRef::Type SymbolRef::getType() const { |
