summaryrefslogtreecommitdiffstats
path: root/lib/Target/PIC16/PIC16Section.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/PIC16/PIC16Section.h')
-rw-r--r--lib/Target/PIC16/PIC16Section.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Target/PIC16/PIC16Section.h b/lib/Target/PIC16/PIC16Section.h
index 566f920..9039ca7 100644
--- a/lib/Target/PIC16/PIC16Section.h
+++ b/lib/Target/PIC16/PIC16Section.h
@@ -30,11 +30,11 @@ namespace llvm {
PIC16SectionType T;
/// Name of the section to uniquely identify it.
- std::string Name;
+ StringRef Name;
/// User can specify an address at which a section should be placed.
/// Negative value here means user hasn't specified any.
- std::string Address;
+ StringRef Address;
/// Overlay information - Sections with same color can be overlaid on
/// one another.
@@ -43,17 +43,16 @@ namespace llvm {
/// Total size of all data objects contained here.
unsigned Size;
- PIC16Section(const StringRef &name, SectionKind K, const std::string &addr,
- int color)
+ PIC16Section(StringRef name, SectionKind K, StringRef addr, int color)
: MCSection(K), Name(name), Address(addr), Color(color), Size(0) {
}
public:
/// Return the name of the section.
- const std::string &getName() const { return Name; }
+ StringRef getName() const { return Name; }
/// Return the Address of the section.
- const std::string &getAddress() const { return Address; }
+ StringRef getAddress() const { return Address; }
/// Return the Color of the section.
int getColor() const { return Color; }
@@ -64,6 +63,8 @@ namespace llvm {
void setSize(unsigned size) { Size = size; }
/// Conatined data objects.
+ // FIXME: This vector is leaked because sections are allocated with a
+ // BumpPtrAllocator.
std::vector<const GlobalVariable *>Items;
/// Check section type.
@@ -77,8 +78,8 @@ namespace llvm {
PIC16SectionType getType() const { return T; }
/// This would be the only way to create a section.
- static PIC16Section *Create(const StringRef &Name, PIC16SectionType Ty,
- const std::string &Address, int Color,
+ static PIC16Section *Create(StringRef Name, PIC16SectionType Ty,
+ StringRef Address, int Color,
MCContext &Ctx);
/// Override this as PIC16 has its own way of printing switching
OpenPOWER on IntegriCloud