Adding support for placing global objects in shared data memory.
[oota-llvm.git] / lib / Target / PIC16 / PIC16ABINames.h
index 00e9e457144b1c038feac0e963100c0ee685ae62..e18ddf158ec835fb4935205ec03792a91129ac8b 100644 (file)
@@ -40,6 +40,7 @@ namespace llvm {
     // Global variables do not have any '.' in their names.
     // These are maily function names and global variable names.
     // Example - @foo,  @i
+    // Static local variables - @<func>.<var>
     // -------------------------------------------------------
     // Functions and auto variables.
     // Names are mangled as <prefix><funcname>.<tag>.<varname>
@@ -67,8 +68,12 @@ namespace llvm {
     // SECTION Names
     // uninitialized globals - @udata.<num>.#
     // initialized globals - @idata.<num>.#
+    // Program memory data - @romdata.#
+    // Variables with user defined section name - <user_defined_section>
+    // Variables with user defined address - @<var>.user_section.<address>.#
     // Function frame - @<func>.frame_section.
     // Function autos - @<func>.autos_section.
+    // Overlay sections - @<color>.##
     // Declarations - Enclosed in comments. No section for them.
     //----------------------------------------------------------
     
@@ -229,6 +234,12 @@ namespace llvm {
       return "romdata.#";
     }
 
+    static std::string getSharedUDataSectionName() {
+       std::ostringstream o;
+       o << getTagName(PREFIX_SYMBOL)  << "udata_shr" << ".#";
+       return o.str();
+    }
+
     static std::string getRomdataSectionName(unsigned num,
                                              std::string prefix = "") {
        std::ostringstream o;
@@ -299,6 +310,21 @@ namespace llvm {
         }
       }
     }
+
+    /// Return Overlay Name for the section.
+    /// The ABI Convention is: @<Color>.##.<section_tag>
+    /// The section_tag is retrieved from the SectName parameter and
+    /// and Color is passed in parameter.
+    static inline std::string  getOverlayName(std::string SectName, int Color) {
+      // FIXME: Only autos_section and frame_section are colored.
+      // So check and assert if the passed SectName does not have AUTOS_SECTION
+      // or FRAME_SECTION tag in it.
+      std::ostringstream o;
+      o << getTagName(PREFIX_SYMBOL) << Color << ".##" 
+        << SectName.substr(SectName.find("."));
+
+      return o.str();
+    } 
   }; // class PAN.
 } // end namespace llvm;