llvm/llvm/include/llvm/Object/ObjectFile.h

//===- ObjectFile.h - File format independent object file -------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file declares a file format independent ObjectFile class.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_OBJECT_OBJECTFILE_H
#define LLVM_OBJECT_OBJECTFILE_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/BinaryFormat/Magic.h"
#include "llvm/BinaryFormat/Swift.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/Error.h"
#include "llvm/Object/SymbolicFile.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBufferRef.h"
#include "llvm/TargetParser/Triple.h"
#include <cassert>
#include <cstdint>
#include <memory>

namespace llvm {

class SubtargetFeatures;

namespace object {

class COFFObjectFile;
class MachOObjectFile;
class ObjectFile;
class SectionRef;
class SymbolRef;
class symbol_iterator;
class WasmObjectFile;

section_iterator;

SectionFilterPredicate;
/// This is a value type class that represents a single relocation in the list
/// of relocations in the object file.
class RelocationRef {};

relocation_iterator;

/// This is a value type class that represents a single section in the list of
/// sections in the object file.
class SectionRef {};

struct SectionedAddress {};

inline bool operator<(const SectionedAddress &LHS,
                      const SectionedAddress &RHS) {}

inline bool operator==(const SectionedAddress &LHS,
                       const SectionedAddress &RHS) {}

raw_ostream &operator<<(raw_ostream &OS, const SectionedAddress &Addr);

/// This is a value type class that represents a single symbol in the list of
/// symbols in the object file.
class SymbolRef : public BasicSymbolRef {};

class symbol_iterator : public basic_symbol_iterator {};

/// This class is the base class for all object file types. Concrete instances
/// of this object are created by createObjectFile, which figures out which type
/// to create.
class ObjectFile : public SymbolicFile {};

/// A filtered iterator for SectionRefs that skips sections based on some given
/// predicate.
class SectionFilterIterator {};

/// Creates an iterator range of SectionFilterIterators for a given Object and
/// predicate.
class SectionFilter {};

// Inline function definitions.
inline SymbolRef::SymbolRef(DataRefImpl SymbolP, const ObjectFile *Owner)
    :{}

inline Expected<StringRef> SymbolRef::getName() const {}

inline Expected<uint64_t> SymbolRef::getAddress() const {}

inline Expected<uint64_t> SymbolRef::getValue() const {}

inline uint32_t SymbolRef::getAlignment() const {}

inline uint64_t SymbolRef::getCommonSize() const {}

inline Expected<section_iterator> SymbolRef::getSection() const {}

inline Expected<SymbolRef::Type> SymbolRef::getType() const {}

inline const ObjectFile *SymbolRef::getObject() const {}

/// SectionRef
inline SectionRef::SectionRef(DataRefImpl SectionP,
                              const ObjectFile *Owner)
  :{}

inline bool SectionRef::operator==(const SectionRef &Other) const {}

inline bool SectionRef::operator!=(const SectionRef &Other) const {}

inline bool SectionRef::operator<(const SectionRef &Other) const {}

inline void SectionRef::moveNext() {}

inline Expected<StringRef> SectionRef::getName() const {}

inline uint64_t SectionRef::getAddress() const {}

inline uint64_t SectionRef::getIndex() const {}

inline uint64_t SectionRef::getSize() const {}

inline Expected<StringRef> SectionRef::getContents() const {}

inline Align SectionRef::getAlignment() const {}

inline bool SectionRef::isCompressed() const {}

inline bool SectionRef::isText() const {}

inline bool SectionRef::isData() const {}

inline bool SectionRef::isBSS() const {}

inline bool SectionRef::isVirtual() const {}

inline bool SectionRef::isBitcode() const {}

inline bool SectionRef::isStripped() const {}

inline bool SectionRef::isBerkeleyText() const {}

inline bool SectionRef::isBerkeleyData() const {}

inline bool SectionRef::isDebugSection() const {}

inline relocation_iterator SectionRef::relocation_begin() const {}

inline relocation_iterator SectionRef::relocation_end() const {}

inline Expected<section_iterator> SectionRef::getRelocatedSection() const {}

inline DataRefImpl SectionRef::getRawDataRefImpl() const {}

inline const ObjectFile *SectionRef::getObject() const {}

/// RelocationRef
inline RelocationRef::RelocationRef(DataRefImpl RelocationP,
                              const ObjectFile *Owner)
  :{}

inline bool RelocationRef::operator==(const RelocationRef &Other) const {}

inline void RelocationRef::moveNext() {}

inline uint64_t RelocationRef::getOffset() const {}

inline symbol_iterator RelocationRef::getSymbol() const {}

inline uint64_t RelocationRef::getType() const {}

inline void RelocationRef::getTypeName(SmallVectorImpl<char> &Result) const {}

inline DataRefImpl RelocationRef::getRawDataRefImpl() const {}

inline const ObjectFile *RelocationRef::getObject() const {}

} // end namespace object

template <> struct DenseMapInfo<object::SectionRef> {};

} // end namespace llvm

#endif // LLVM_OBJECT_OBJECTFILE_H