| 1 | //==-- MSP430.h - Top-level interface for MSP430 representation --*- 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 | // This file contains the entry points for global functions defined in |
| 10 | // the LLVM MSP430 backend. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_LIB_TARGET_MSP430_MSP430_H |
| 15 | #define LLVM_LIB_TARGET_MSP430_MSP430_H |
| 16 | |
| 17 | #include "MCTargetDesc/MSP430MCTargetDesc.h" |
| 18 | #include "llvm/CodeGen/MachineFunctionAnalysisManager.h" |
| 19 | #include "llvm/CodeGen/SelectionDAGISel.h" |
| 20 | #include "llvm/IR/Analysis.h" |
| 21 | #include "llvm/IR/PassManager.h" |
| 22 | #include "llvm/Target/TargetMachine.h" |
| 23 | |
| 24 | namespace MSP430CC { |
| 25 | // MSP430 specific condition code. |
| 26 | enum CondCodes { |
| 27 | COND_E = 0, // aka COND_Z |
| 28 | COND_NE = 1, // aka COND_NZ |
| 29 | COND_HS = 2, // aka COND_C |
| 30 | COND_LO = 3, // aka COND_NC |
| 31 | COND_GE = 4, |
| 32 | COND_L = 5, |
| 33 | COND_N = 6, // jump if negative |
| 34 | COND_NONE, // unconditional |
| 35 | |
| 36 | COND_INVALID = -1 |
| 37 | }; |
| 38 | } |
| 39 | |
| 40 | namespace llvm { |
| 41 | class FunctionPass; |
| 42 | class MSP430TargetMachine; |
| 43 | class PassRegistry; |
| 44 | |
| 45 | class MSP430ISelDAGToDAGPass : public SelectionDAGISelPass { |
| 46 | public: |
| 47 | MSP430ISelDAGToDAGPass(MSP430TargetMachine &TM, CodeGenOptLevel OptLevel); |
| 48 | }; |
| 49 | |
| 50 | FunctionPass *createMSP430ISelDag(MSP430TargetMachine &TM, |
| 51 | CodeGenOptLevel OptLevel); |
| 52 | |
| 53 | class MSP430BranchSelectPass : public PassInfoMixin<MSP430BranchSelectPass> { |
| 54 | public: |
| 55 | PreservedAnalyses run(MachineFunction &MF, |
| 56 | MachineFunctionAnalysisManager &MFAM); |
| 57 | }; |
| 58 | |
| 59 | FunctionPass *createMSP430BranchSelectLegacyPass(); |
| 60 | |
| 61 | void initializeMSP430AsmPrinterPass(PassRegistry &); |
| 62 | void initializeMSP430DAGToDAGISelLegacyPass(PassRegistry &); |
| 63 | |
| 64 | } // namespace llvm |
| 65 | |
| 66 | #endif |
| 67 | |