/// MCSectionELF - This represents a section on linux, lots of unix variants
/// and some bare metal systems.
class MCSectionELF : public MCSection {
- std::string SectionName;
+ /// SectionName - This is the name of the section. The referenced memory is
+ /// owned by TargetLoweringObjectFileELF's ELFUniqueMap.
+ StringRef SectionName;
/// Type - This is the sh_type field of a section, drawn from the enums below.
unsigned Type;
unsigned Flags;
/// IsExplicit - Indicates that this section comes from globals with an
- /// explicit section specfied.
+ /// explicit section specified.
bool IsExplicit;
protected:
- MCSectionELF(const StringRef &Section, unsigned type, unsigned flags,
+ MCSectionELF(StringRef Section, unsigned type, unsigned flags,
SectionKind K, bool isExplicit)
- : MCSection(K), SectionName(Section.str()), Type(type), Flags(flags),
+ : MCSection(K), SectionName(Section), Type(type), Flags(flags),
IsExplicit(isExplicit) {}
public:
- static MCSectionELF *Create(const StringRef &Section, unsigned Type,
+ static MCSectionELF *Create(StringRef Section, unsigned Type,
unsigned Flags, SectionKind K, bool isExplicit,
MCContext &Ctx);
/// ShouldOmitSectionDirective - Decides whether a '.section' directive
/// should be printed before the section name
- bool ShouldOmitSectionDirective(const char *Name,
- const MCAsmInfo &MAI) const;
+ bool ShouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const;
/// ShouldPrintSectionType - Only prints the section type if supported
bool ShouldPrintSectionType(unsigned Ty) const;
TARGET_INDEP_SHF = FIRST_TARGET_DEP_FLAG-1U
};
- StringRef getSectionName() const {
- return StringRef(SectionName);
- }
-
+ StringRef getSectionName() const { return SectionName; }
unsigned getType() const { return Type; }
unsigned getFlags() const { return Flags; }