forked from OSchip/llvm-project
Make WindowsManifestMerger::merge() take a MemoryBufferRef
No behavior change.
This commit is contained in:
parent
9b96b0865d
commit
67ffce68bc
|
@ -30,6 +30,7 @@
|
|||
namespace llvm {
|
||||
|
||||
class MemoryBuffer;
|
||||
class MemoryBufferRef;
|
||||
|
||||
namespace windows_manifest {
|
||||
|
||||
|
@ -49,7 +50,7 @@ class WindowsManifestMerger {
|
|||
public:
|
||||
WindowsManifestMerger();
|
||||
~WindowsManifestMerger();
|
||||
Error merge(const MemoryBuffer &Manifest);
|
||||
Error merge(MemoryBufferRef Manifest);
|
||||
|
||||
// Returns vector containing merged xml manifest, or uninitialized vector for
|
||||
// empty manifest.
|
||||
|
|
|
@ -35,7 +35,7 @@ void WindowsManifestError::log(raw_ostream &OS) const { OS << Msg; }
|
|||
class WindowsManifestMerger::WindowsManifestMergerImpl {
|
||||
public:
|
||||
~WindowsManifestMergerImpl();
|
||||
Error merge(const MemoryBuffer &Manifest);
|
||||
Error merge(MemoryBufferRef Manifest);
|
||||
std::unique_ptr<MemoryBuffer> getMergedManifest();
|
||||
|
||||
private:
|
||||
|
@ -620,7 +620,7 @@ WindowsManifestMerger::WindowsManifestMergerImpl::~WindowsManifestMergerImpl() {
|
|||
}
|
||||
|
||||
Error WindowsManifestMerger::WindowsManifestMergerImpl::merge(
|
||||
const MemoryBuffer &Manifest) {
|
||||
MemoryBufferRef Manifest) {
|
||||
if (Merged)
|
||||
return make_error<WindowsManifestError>(
|
||||
"merge after getMergedManifest is not supported");
|
||||
|
@ -690,7 +690,7 @@ WindowsManifestMerger::WindowsManifestMergerImpl::~WindowsManifestMergerImpl() {
|
|||
}
|
||||
|
||||
Error WindowsManifestMerger::WindowsManifestMergerImpl::merge(
|
||||
const MemoryBuffer &Manifest) {
|
||||
MemoryBufferRef Manifest) {
|
||||
return make_error<WindowsManifestError>("no libxml2");
|
||||
}
|
||||
|
||||
|
@ -708,7 +708,7 @@ WindowsManifestMerger::WindowsManifestMerger()
|
|||
|
||||
WindowsManifestMerger::~WindowsManifestMerger() {}
|
||||
|
||||
Error WindowsManifestMerger::merge(const MemoryBuffer &Manifest) {
|
||||
Error WindowsManifestMerger::merge(MemoryBufferRef Manifest) {
|
||||
return Impl->merge(Manifest);
|
||||
}
|
||||
|
||||
|
|
|
@ -135,8 +135,7 @@ int main(int Argc, const char **Argv) {
|
|||
MemoryBuffer::getFile(File);
|
||||
if (!ManifestOrErr)
|
||||
reportError(File, ManifestOrErr.getError());
|
||||
MemoryBuffer &Manifest = *ManifestOrErr.get();
|
||||
error(Merger.merge(Manifest));
|
||||
error(Merger.merge(*ManifestOrErr.get()));
|
||||
}
|
||||
|
||||
std::unique_ptr<MemoryBuffer> OutputBuffer = Merger.getMergedManifest();
|
||||
|
|
Loading…
Reference in New Issue