1 //===- llvm-objcopy.h -------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_TOOLS_OBJCOPY_OBJCOPY_H
11 #define LLVM_TOOLS_OBJCOPY_OBJCOPY_H
13 #include "llvm/ADT/Twine.h"
14 #include "llvm/Support/Compiler.h"
15 #include "llvm/Support/Error.h"
16 #include "llvm/Support/raw_ostream.h"
21 LLVM_ATTRIBUTE_NORETURN
extern void error(Twine Message
);
23 // This is taken from llvm-readobj.
24 // [see here](llvm/tools/llvm-readobj/llvm-readobj.h:38)
25 template <class T
> T
unwrapOrError(Expected
<T
> EO
) {
29 raw_string_ostream
OS(Buf
);
30 logAllUnhandledErrors(EO
.takeError(), OS
, "");
35 } // end namespace llvm
37 #endif // LLVM_TOOLS_OBJCOPY_OBJCOPY_H