aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC/MCSectionELF.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-15 06:23:52 +0000
committerChris Lattner <sabre@nondot.org>2010-03-15 06:23:52 +0000
commit1f8008cf214b984954de2e986fb8cb0e5cc58606 (patch)
treefcb0837c9a3e2e4a69bb24cf6e92a0e6a9b63ab2 /include/llvm/MC/MCSectionELF.h
parentc28cc093e3b5b8601cb5024a5365a6f31f49839a (diff)
downloadexternal_llvm-1f8008cf214b984954de2e986fb8cb0e5cc58606.zip
external_llvm-1f8008cf214b984954de2e986fb8cb0e5cc58606.tar.gz
external_llvm-1f8008cf214b984954de2e986fb8cb0e5cc58606.tar.bz2
fix MCSectionELF to not leak memory, just like I did for MCSymbol.
MCSectionMachO is already fine (yay for fixed size arrays?), MCSectionCOFF still leaks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCSectionELF.h')
-rw-r--r--include/llvm/MC/MCSectionELF.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/llvm/MC/MCSectionELF.h b/include/llvm/MC/MCSectionELF.h
index 2dccf5c..41c17bd 100644
--- a/include/llvm/MC/MCSectionELF.h
+++ b/include/llvm/MC/MCSectionELF.h
@@ -21,7 +21,9 @@ namespace llvm {
/// 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;
@@ -163,10 +165,7 @@ public:
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; }