Files
revng-revng/include/revng/Model/Relocation.h
Alessandro Di Federico 8570923d64 Introduce model::Relocation
2022-03-08 12:25:59 +01:00

48 lines
1.1 KiB
C++

#pragma once
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
#include "revng/Model/RelocationType.h"
#include "revng/Model/VerifyHelper.h"
#include "revng/Support/MetaAddress.h"
#include "revng/Support/MetaAddress/YAMLTraits.h"
/* TUPLE-TREE-YAML
name: Relocation
type: struct
fields:
- name: Address
type: MetaAddress
- name: Type
type: model::RelocationType::Values
- name: Addend
type: uint64_t
key:
- Address
- Type
TUPLE-TREE-YAML */
#include "revng/Model/Generated/Early/Relocation.h"
class model::Relocation : public model::generated::Relocation {
public:
using generated::Relocation::Relocation;
public:
uint64_t size() const { return model::RelocationType::getSize(Type); }
/// \return a valid end address.
MetaAddress endAddress() const { return Address + size(); }
public:
bool verify() const debug_function;
bool verify(bool Assert) const debug_function;
bool verify(VerifyHelper &VH) const;
void dump() const debug_function;
};
#include "revng/Model/Generated/Late/Relocation.h"