1 //===-- AVR.h - Top-level interface for AVR representation ------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the entry points for global functions defined in the LLVM
13 //===----------------------------------------------------------------------===//
18 #include "llvm/CodeGen/SelectionDAGNodes.h"
19 #include "llvm/Target/TargetMachine.h"
23 class AVRTargetMachine;
26 FunctionPass *createAVRISelDag(AVRTargetMachine &TM,
27 CodeGenOpt::Level OptLevel);
28 FunctionPass *createAVRExpandPseudoPass();
29 FunctionPass *createAVRFrameAnalyzerPass();
30 FunctionPass *createAVRRelaxMemPass();
31 FunctionPass *createAVRDynAllocaSRPass();
32 FunctionPass *createAVRBranchSelectionPass();
34 void initializeAVRExpandPseudoPass(PassRegistry&);
35 void initializeAVRRelaxMemPass(PassRegistry&);
37 /// Contains the AVR backend.
40 /// An integer that identifies all of the supported AVR address spaces.
41 enum AddressSpace { DataMemory, ProgramMemory };
43 /// Checks if a given type is a pointer to program memory.
44 template <typename T> bool isProgramMemoryAddress(T *V) {
45 return cast<PointerType>(V->getType())->getAddressSpace() == ProgramMemory;
48 inline bool isProgramMemoryAccess(MemSDNode const *N) {
49 auto V = N->getMemOperand()->getValue();
51 return (V != nullptr) ? isProgramMemoryAddress(V) : false;
54 } // end of namespace AVR
56 } // end namespace llvm