Skip to content

[BOLT] Add getter for optional relocations #133085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bolt/include/bolt/Core/Relocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class Relocation {
uint32_t Type;

private:
/// Relocations added by optimizations can be optional.
/// Relocations added by optimizations can be optional, meaning they can be
/// omitted under certain circumstances.
bool Optional = false;

public:
Expand All @@ -72,10 +73,10 @@ class Relocation {
/// Return size in bytes of the given relocation \p Type.
static size_t getSizeForType(uint32_t Type);

/// Some relocations added by optimizations are optional, meaning they can be
/// omitted under certain circumstances.
void setOptional() { Optional = true; }

bool isOptional() { return Optional; }

/// Return size of this relocation.
size_t getSize() const { return getSizeForType(Type); }

Expand Down