Add const version of OwningBinary::getBinary
authorAlexey Samsonov <vonosmas@gmail.com>
Mon, 20 Oct 2014 20:32:47 +0000 (20:32 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Mon, 20 Oct 2014 20:32:47 +0000 (20:32 +0000)
llvm-svn: 220231

llvm/include/llvm/Object/Binary.h

index 23c66ea..e4cb6f4 100644 (file)
@@ -140,6 +140,7 @@ public:
   OwningBinary<T> &operator=(OwningBinary<T> &&Other);
 
   std::unique_ptr<T> &getBinary();
+  const std::unique_ptr<T> &getBinary() const;
   std::unique_ptr<MemoryBuffer> &getBuffer();
 };
 
@@ -166,6 +167,11 @@ template <typename T> std::unique_ptr<T> &OwningBinary<T>::getBinary() {
 }
 
 template <typename T>
+const std::unique_ptr<T> &OwningBinary<T>::getBinary() const {
+  return Bin;
+}
+
+template <typename T>
 std::unique_ptr<MemoryBuffer> &OwningBinary<T>::getBuffer() {
   return Buf;
 }