Path: blob/main/contrib/llvm-project/llvm/tools/llvm-readobj/llvm-readobj.h
35231 views
//===-- llvm-readobj.h ----------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_TOOLS_LLVM_READOBJ_LLVM_READOBJ_H9#define LLVM_TOOLS_LLVM_READOBJ_LLVM_READOBJ_H1011#include "ObjDumper.h"1213#include "llvm/ADT/SmallVector.h"14#include "llvm/Support/CommandLine.h"15#include "llvm/Support/Compiler.h"16#include "llvm/Support/Error.h"17#include "llvm/Support/ErrorOr.h"1819namespace llvm {20namespace object {21class RelocationRef;22}2324// Various helper functions.25[[noreturn]] void reportError(Error Err, StringRef Input);26void reportWarning(Error Err, StringRef Input);2728template <class T> T unwrapOrError(StringRef Input, Expected<T> EO) {29if (EO)30return *EO;31reportError(EO.takeError(), Input);32}33} // namespace llvm3435namespace opts {36extern bool SectionRelocations;37extern bool SectionSymbols;38extern bool SectionData;39extern bool ExpandRelocs;40extern bool CodeViewSubsectionBytes;41extern bool Demangle;42enum OutputStyleTy { LLVM, GNU, JSON, UNKNOWN };43extern OutputStyleTy Output;44} // namespace opts4546#define LLVM_READOBJ_ENUM_ENT(ns, enum) \47{ #enum, ns::enum }4849#define LLVM_READOBJ_ENUM_CLASS_ENT(enum_class, enum) \50{ #enum, std::underlying_type_t<enum_class>(enum_class::enum) }5152#endif535455