Path: blob/main/contrib/llvm-project/llvm/lib/Target/M68k/MCTargetDesc/M68kFixupKinds.h
35294 views
//===-- M68kFixupKinds.h - M68k Specific Fixup Entries ----------*- C++ -*-===//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//===----------------------------------------------------------------------===//7///8/// \file9/// This file contains M68k specific fixup entries.10///11//===----------------------------------------------------------------------===//1213#ifndef LLVM_LIB_TARGET_M68k_MCTARGETDESC_M68kFIXUPKINDS_H14#define LLVM_LIB_TARGET_M68k_MCTARGETDESC_M68kFIXUPKINDS_H1516#include "llvm/MC/MCFixup.h"1718namespace llvm {19static inline unsigned getFixupKindLog2Size(unsigned Kind) {20switch (Kind) {21case FK_PCRel_1:22case FK_SecRel_1:23case FK_Data_1:24return 0;25case FK_PCRel_2:26case FK_SecRel_2:27case FK_Data_2:28return 1;29case FK_PCRel_4:30case FK_SecRel_4:31case FK_Data_4:32return 2;33}34llvm_unreachable("invalid fixup kind!");35}3637static inline MCFixupKind getFixupForSize(unsigned Size, bool isPCRel) {38switch (Size) {39case 8:40return isPCRel ? FK_PCRel_1 : FK_Data_1;41case 16:42return isPCRel ? FK_PCRel_2 : FK_Data_2;43case 32:44return isPCRel ? FK_PCRel_4 : FK_Data_4;45case 64:46return isPCRel ? FK_PCRel_8 : FK_Data_8;47}48llvm_unreachable("Invalid generic fixup size!");49}5051} // namespace llvm5253#endif // LLVM_LIB_TARGET_M68k_MCTARGETDESC_M68kFIXUPKINDS_H545556