[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / lib / Target / M68k / MCTargetDesc / M68kFixupKinds.h
blob2b760dec9e4163f8ca3382c5ae8397d5be44dbd6
1 //===-- M68kFixupKinds.h - M68k Specific Fixup Entries ------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This file contains M68k specific fixup entries.
11 ///
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_M68k_MCTARGETDESC_M68kFIXUPKINDS_H
15 #define LLVM_LIB_TARGET_M68k_MCTARGETDESC_M68kFIXUPKINDS_H
17 #include "llvm/MC/MCFixup.h"
19 namespace llvm {
20 static inline unsigned getFixupKindLog2Size(unsigned Kind) {
21 switch (Kind) {
22 case FK_PCRel_1:
23 case FK_SecRel_1:
24 case FK_Data_1:
25 return 0;
26 case FK_PCRel_2:
27 case FK_SecRel_2:
28 case FK_Data_2:
29 return 1;
30 case FK_PCRel_4:
31 case FK_SecRel_4:
32 case FK_Data_4:
33 return 2;
35 llvm_unreachable("invalid fixup kind!");
38 static inline MCFixupKind getFixupForSize(unsigned Size, bool isPCRel) {
39 switch (Size) {
40 case 8:
41 return isPCRel ? FK_PCRel_1 : FK_Data_1;
42 case 16:
43 return isPCRel ? FK_PCRel_2 : FK_Data_2;
44 case 32:
45 return isPCRel ? FK_PCRel_4 : FK_Data_4;
46 case 64:
47 return isPCRel ? FK_PCRel_8 : FK_Data_8;
49 llvm_unreachable("Invalid generic fixup size!");
52 } // namespace llvm
54 #endif