1 //===-- PIC16Overlay.h - Interface for PIC16 Frame Overlay -*- 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 PIC16 Overlay infrastructure.
12 //===----------------------------------------------------------------------===//
14 #ifndef PIC16FRAMEOVERLAY_H
15 #define PIC16FRAMEOVERLAY_H
22 // Forward declarations.
30 namespace PIC16OVERLAY {
32 StartInterruptColor = 200,
33 StartIndirectCallColor = 300
36 class PIC16Overlay : public ModulePass {
37 std::string OverlayStr;
38 unsigned InterruptDepth;
39 unsigned IndirectCallColor;
41 static char ID; // Class identification
42 PIC16Overlay() : ModulePass(ID) {
43 OverlayStr = "Overlay=";
44 InterruptDepth = PIC16OVERLAY::StartInterruptColor;
45 IndirectCallColor = PIC16OVERLAY::StartIndirectCallColor;
48 virtual void getAnalysisUsage(AnalysisUsage &AU) const;
49 virtual bool runOnModule(Module &M);
52 unsigned getColor(Function *Fn);
53 void setColor(Function *Fn, unsigned Color);
54 unsigned ModifyDepthForInterrupt(CallGraphNode *CGN, unsigned Depth);
55 void MarkIndirectlyCalledFunctions(Module &M);
56 void DFSTraverse(CallGraphNode *CGN, unsigned Depth);