jak-project/decompiler/ObjectFile/LinkedWord.h

38 lines
970 B
C
Raw Normal View History

#pragma once
2020-08-22 23:30:17 -04:00
/*!
* @file LinkedWord.h
* A word (4 bytes), possibly with some linking info.
*/
#ifndef JAK2_DISASSEMBLER_LINKEDWORD_H
#define JAK2_DISASSEMBLER_LINKEDWORD_H
#include <cstdint>
#include <string>
namespace decompiler {
2020-08-22 23:30:17 -04:00
class LinkedWord {
public:
explicit LinkedWord(uint32_t _data) : data(_data) {}
enum Kind {
PLAIN_DATA, // just plain data
PTR, // pointer to a location
HI_PTR, // lower 16-bits of this data are the upper 16 bits of a pointer
LO_PTR, // lower 16-bits of this data are the lower 16 bits of a pointer
SYM_PTR, // this is a pointer to a symbol
EMPTY_PTR, // this is a pointer to the empty list
SYM_OFFSET, // this is an offset of a symbol in the symbol table
TYPE_PTR // this is a pointer to a type
} kind = PLAIN_DATA;
uint32_t data = 0;
int label_id = -1;
std::string symbol_name;
};
} // namespace decompiler
2020-08-22 23:30:17 -04:00
#endif // JAK2_DISASSEMBLER_LINKEDWORD_H