aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-20 07:34:17 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-20 07:34:17 +0000
commit8f7be4731e979255c54eb8951b7a06ed4fd6ce45 (patch)
treeebad0813d70bb764723e4ca073f98ad96c4ffc1f /lib
parent428098de6289762990fdc368474e6b464112bbcc (diff)
downloadexternal_llvm-8f7be4731e979255c54eb8951b7a06ed4fd6ce45.zip
external_llvm-8f7be4731e979255c54eb8951b7a06ed4fd6ce45.tar.gz
external_llvm-8f7be4731e979255c54eb8951b7a06ed4fd6ce45.tar.bz2
Make all raw_ostreams support the tell() function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/raw_ostream.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
index f62a31d..6ac37bc 100644
--- a/lib/Support/raw_ostream.cpp
+++ b/lib/Support/raw_ostream.cpp
@@ -339,6 +339,12 @@ void raw_os_ostream::write_impl(const char *Ptr, unsigned Size) {
OS.write(Ptr, Size);
}
+uint64_t raw_os_ostream::current_pos() { return OS.tellp(); }
+
+uint64_t raw_os_ostream::tell() {
+ return (uint64_t)OS.tellp() + GetNumBytesInBuffer();
+}
+
//===----------------------------------------------------------------------===//
// raw_string_ostream
//===----------------------------------------------------------------------===//
@@ -363,3 +369,8 @@ void raw_svector_ostream::write_impl(const char *Ptr, unsigned Size) {
OS.append(Ptr, Ptr + Size);
}
+uint64_t raw_svector_ostream::current_pos() { return OS.size(); }
+
+uint64_t raw_svector_ostream::tell() {
+ return OS.size() + GetNumBytesInBuffer();
+}