aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ObjectFile.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-11-19 09:54:24 +0100
committerPavel Labath <pavel@labath.sk>2019-11-19 10:34:30 +0100
commitc0fc29c4684a997d282bfed71eb4d903ad16ee25 (patch)
treeaaeed42b3d1ecbac3fd0a5e74edad4adccae5bb3 /llvm/lib/Object/ObjectFile.cpp
parent7db1230a9f5e0185a88019c9aa5b55bd85498285 (diff)
downloadllvm-c0fc29c4684a997d282bfed71eb4d903ad16ee25.zip
llvm-c0fc29c4684a997d282bfed71eb4d903ad16ee25.tar.gz
llvm-c0fc29c4684a997d282bfed71eb4d903ad16ee25.tar.bz2
Add operator<< for object::SectionedAddress
The main motivation for this is better failure messages in unit tests. Split off from D70394.
Diffstat (limited to 'llvm/lib/Object/ObjectFile.cpp')
-rw-r--r--llvm/lib/Object/ObjectFile.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp
index e0e63a5..098b3d8 100644
--- a/llvm/lib/Object/ObjectFile.cpp
+++ b/llvm/lib/Object/ObjectFile.cpp
@@ -32,6 +32,13 @@
using namespace llvm;
using namespace object;
+raw_ostream &object::operator<<(raw_ostream &OS, const SectionedAddress &Addr) {
+ OS << "SectionedAddress{" << format_hex(Addr.Address, 10);
+ if (Addr.SectionIndex != SectionedAddress::UndefSection)
+ OS << ", " << Addr.SectionIndex;
+ return OS << "}";
+}
+
void ObjectFile::anchor() {}
ObjectFile::ObjectFile(unsigned int Type, MemoryBufferRef Source)