Add llvm-modextract tool.

This program is for testing features that rely on multi-module bitcode files.
It takes a multi-module bitcode file, extracts one of the modules and writes
it to the output file.

Differential Revision: https://reviews.llvm.org/D26778

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288201 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Peter Collingbourne
2016-11-29 21:54:33 +00:00
parent 649bcb99b4
commit c67ca17e5e
8 changed files with 122 additions and 1 deletions

View File

@@ -66,7 +66,9 @@ namespace llvm {
bool ShouldLazyLoadMetadata);
public:
ArrayRef<uint8_t> getBuffer() const { return Buffer; }
StringRef getBuffer() const {
return StringRef((const char *)Buffer.begin(), Buffer.size());
}
/// Read the bitcode module and prepare for lazy deserialization of function
/// bodies. If ShouldLazyLoadMetadata is true, lazily load metadata as well.