Don't mix overload and default values.
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 4 Apr 2015 18:16:01 +0000 (18:16 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 4 Apr 2015 18:16:01 +0000 (18:16 +0000)
It makes it hard to see which one is being called.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234100 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCContext.h
lib/MC/MCContext.cpp

index e06886445755080ca8b8f88b2879c577788924e8..848614c3fb8034b08844c95ccf997ca23bc72cc9 100644 (file)
@@ -297,19 +297,42 @@ namespace llvm {
                              BeginSymName);
     }
 
+    const MCSectionELF *getELFSection(StringRef Section, unsigned Type,
+                                      unsigned Flags) {
+      return getELFSection(Section, Type, Flags, nullptr);
+    }
+
     const MCSectionELF *getELFSection(StringRef Section, unsigned Type,
                                       unsigned Flags,
-                                      const char *BeginSymName = nullptr);
+                                      const char *BeginSymName) {
+      return getELFSection(Section, Type, Flags, 0, "", BeginSymName);
+    }
+
+    const MCSectionELF *getELFSection(StringRef Section, unsigned Type,
+                                      unsigned Flags, unsigned EntrySize,
+                                      StringRef Group) {
+      return getELFSection(Section, Type, Flags, EntrySize, Group, nullptr);
+    }
 
     const MCSectionELF *getELFSection(StringRef Section, unsigned Type,
                                       unsigned Flags, unsigned EntrySize,
                                       StringRef Group,
-                                      const char *BeginSymName = nullptr);
+                                      const char *BeginSymName) {
+      return getELFSection(Section, Type, Flags, EntrySize, Group, ~0,
+                           BeginSymName);
+    }
+
+    const MCSectionELF *getELFSection(StringRef Section, unsigned Type,
+                                      unsigned Flags, unsigned EntrySize,
+                                      StringRef Group, unsigned UniqueID) {
+      return getELFSection(Section, Type, Flags, EntrySize, Group, UniqueID,
+                           nullptr);
+    }
 
     const MCSectionELF *getELFSection(StringRef Section, unsigned Type,
                                       unsigned Flags, unsigned EntrySize,
                                       StringRef Group, unsigned UniqueID,
-                                      const char *BeginSymName = nullptr);
+                                      const char *BeginSymName);
 
     const MCSectionELF *createELFRelSection(StringRef Name, unsigned Type,
                                             unsigned Flags, unsigned EntrySize,
index 4443fc00fe0421566b99dbba3530ce13cc73ef9c..34932ccd33a7f622a85a50d9fb40139cfdc4c67f 100644 (file)
@@ -262,12 +262,6 @@ MCContext::getMachOSection(StringRef Segment, StringRef Section,
                                             Reserved2, Kind, Begin);
 }
 
-const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type,
-                                             unsigned Flags,
-                                             const char *BeginSymName) {
-  return getELFSection(Section, Type, Flags, 0, "", BeginSymName);
-}
-
 void MCContext::renameELFSection(const MCSectionELF *Section, StringRef Name) {
   StringRef GroupName;
   if (const MCSymbol *Group = Section->getGroup())
@@ -330,14 +324,6 @@ const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type,
   return Result;
 }
 
-const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type,
-                                             unsigned Flags, unsigned EntrySize,
-                                             StringRef Group,
-                                             const char *BeginSymName) {
-  return getELFSection(Section, Type, Flags, EntrySize, Group, ~0,
-                       BeginSymName);
-}
-
 const MCSectionELF *MCContext::CreateELFGroupSection() {
   MCSectionELF *Result = new (*this)
       MCSectionELF(".group", ELF::SHT_GROUP, 0, SectionKind::getReadOnly(), 4,