LLVM  10.0.0svn
AVR.h
Go to the documentation of this file.
1 //===-- AVR.h - Top-level interface for AVR 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 the LLVM
10 // AVR back-end.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_AVR_H
15 #define LLVM_AVR_H
16 
19 
20 namespace llvm {
21 
22 class AVRTargetMachine;
23 class FunctionPass;
24 
25 FunctionPass *createAVRISelDag(AVRTargetMachine &TM,
26  CodeGenOpt::Level OptLevel);
27 FunctionPass *createAVRExpandPseudoPass();
28 FunctionPass *createAVRFrameAnalyzerPass();
29 FunctionPass *createAVRRelaxMemPass();
30 FunctionPass *createAVRDynAllocaSRPass();
31 FunctionPass *createAVRBranchSelectionPass();
32 
33 void initializeAVRExpandPseudoPass(PassRegistry&);
34 void initializeAVRRelaxMemPass(PassRegistry&);
35 
36 /// Contains the AVR backend.
37 namespace AVR {
38 
39 /// An integer that identifies all of the supported AVR address spaces.
41 
42 /// Checks if a given type is a pointer to program memory.
43 template <typename T> bool isProgramMemoryAddress(T *V) {
44  return cast<PointerType>(V->getType())->getAddressSpace() == ProgramMemory;
45 }
46 
47 inline bool isProgramMemoryAccess(MemSDNode const *N) {
48  auto V = N->getMemOperand()->getValue();
49 
50  return (V != nullptr) ? isProgramMemoryAddress(V) : false;
51 }
52 
53 } // end of namespace AVR
54 
55 } // end namespace llvm
56 
57 #endif // LLVM_AVR_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
bool isProgramMemoryAccess(MemSDNode const *N)
Definition: AVR.h:47
FunctionPass * createAVRRelaxMemPass()
bool isProgramMemoryAddress(T *V)
Checks if a given type is a pointer to program memory.
Definition: AVR.h:43
void initializeAVRRelaxMemPass(PassRegistry &)
const Value * getValue() const
Return the base address of the memory access.
FunctionPass * createAVRISelDag(AVRTargetMachine &TM, CodeGenOpt::Level OptLevel)
FunctionPass * createAVRBranchSelectionPass()
This is an abstract virtual class for memory operations.
FunctionPass * createAVRExpandPseudoPass()
#define N
FunctionPass * createAVRFrameAnalyzerPass()
Creates instance of the frame analyzer pass.
AddressSpace
An integer that identifies all of the supported AVR address spaces.
Definition: AVR.h:40
void initializeAVRExpandPseudoPass(PassRegistry &)
FunctionPass * createAVRDynAllocaSRPass()
createAVRDynAllocaSRPass - returns an instance of the dynalloca stack pointer save/restore pass...