summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/include/llvm/Object/Decompressor.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/include/llvm/Object/Decompressor.h')
-rw-r--r--contrib/llvm/include/llvm/Object/Decompressor.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/llvm/include/llvm/Object/Decompressor.h b/contrib/llvm/include/llvm/Object/Decompressor.h
index a11857d..c8e888d 100644
--- a/contrib/llvm/include/llvm/Object/Decompressor.h
+++ b/contrib/llvm/include/llvm/Object/Decompressor.h
@@ -10,8 +10,8 @@
#ifndef LLVM_OBJECT_DECOMPRESSOR_H
#define LLVM_OBJECT_DECOMPRESSOR_H
-#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Object/ObjectFile.h"
namespace llvm {
@@ -30,7 +30,10 @@ public:
/// @brief Resize the buffer and uncompress section data into it.
/// @param Out Destination buffer.
- Error decompress(SmallString<32> &Out);
+ template <class T> Error resizeAndDecompress(T &Out) {
+ Out.resize(DecompressedSize);
+ return decompress({Out.data(), (size_t)DecompressedSize});
+ }
/// @brief Uncompress section data to raw buffer provided.
/// @param Buffer Destination buffer.
OpenPOWER on IntegriCloud