summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PIC16/PIC16PAN.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/PIC16/PIC16PAN.h')
-rw-r--r--llvm/lib/Target/PIC16/PIC16PAN.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16PAN.h b/llvm/lib/Target/PIC16/PIC16PAN.h
index cca8f355a71..f0e1ba0de07 100644
--- a/llvm/lib/Target/PIC16/PIC16PAN.h
+++ b/llvm/lib/Target/PIC16/PIC16PAN.h
@@ -22,8 +22,19 @@
#include <cassert>
#include <cstring>
#include <string>
-
namespace llvm {
+namespace PIC16Overlay {
+ // Implement Overlay through colors because we may want to enhance overlay
+ // architecture later. More colors can be added then.
+ // Idea here is that functions with same color can be overlayed.
+ enum Overlay {
+ // A color name can only consist of upper case letters and underscore.
+ GREEN, // Stands for mainline functions that can be overlayed.
+ GREEN_IL, // Interrupt line version of GREEN.
+ RED // Stands for functions that can not be overlayed.
+ };
+}
+
// A Central class to manage all ABI naming conventions.
// PAN - [P]ic16 [A]BI [N]ames
class PAN {
@@ -414,6 +425,27 @@ namespace llvm {
}
}
}
+ inline static std::string getOverlayStr(unsigned Color) {
+ std::string Str = "Overlay=";
+ Str.append(getSectionNameForColor(Color));
+ return Str;
+ }
+
+ inline static std::string getSectionNameForColor(unsigned Color) {
+ switch (Color) {
+ case PIC16Overlay::GREEN:
+ return "GREEN";
+ case PIC16Overlay::GREEN_IL:
+ return "GREEN_IL";
+ default:
+ assert( 0 && "Color not supported");
+ }
+ }
+
+ inline static std::string getAutosSectionForColor(std::string Color) {
+ return Color.append("_AUTOS");
+ }
+
}; // class PAN.
} // end namespace llvm;
OpenPOWER on IntegriCloud