Implement unique sections with an unique ID.
[oota-llvm.git] / include / llvm / MC / MCContext.h
index c1f2fac82f7509555bdc96d2a358624fcf440ee8..e06886445755080ca8b8f88b2879c577788924e8 100644 (file)
@@ -165,12 +165,17 @@ namespace llvm {
     struct ELFSectionKey {
       std::string SectionName;
       StringRef GroupName;
-      ELFSectionKey(StringRef SectionName, StringRef GroupName)
-          : SectionName(SectionName), GroupName(GroupName) {}
+      unsigned UniqueID;
+      ELFSectionKey(StringRef SectionName, StringRef GroupName,
+                    unsigned UniqueID)
+          : SectionName(SectionName), GroupName(GroupName), UniqueID(UniqueID) {
+      }
       bool operator<(const ELFSectionKey &Other) const {
         if (SectionName != Other.SectionName)
           return SectionName < Other.SectionName;
-        return GroupName < Other.GroupName;
+        if (GroupName != Other.GroupName)
+          return GroupName < Other.GroupName;
+        return UniqueID < Other.UniqueID;
       }
     };
 
@@ -259,6 +264,7 @@ namespace llvm {
     MCSymbol *getOrCreateSectionSymbol(const MCSectionELF &Section);
 
     MCSymbol *getOrCreateFrameAllocSymbol(StringRef FuncName, unsigned Idx);
+    MCSymbol *getOrCreateParentFrameOffsetSymbol(StringRef FuncName);
 
     /// Get the symbol for \p Name, or null.
     MCSymbol *LookupSymbol(const Twine &Name) const;
@@ -302,7 +308,7 @@ namespace llvm {
 
     const MCSectionELF *getELFSection(StringRef Section, unsigned Type,
                                       unsigned Flags, unsigned EntrySize,
-                                      StringRef Group, bool Unique,
+                                      StringRef Group, unsigned UniqueID,
                                       const char *BeginSymName = nullptr);
 
     const MCSectionELF *createELFRelSection(StringRef Name, unsigned Type,