summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-10-07 13:46:06 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-10-07 13:46:06 +0000
commit30d77777e7383afd5f1d73efc4f6fee99f577521 (patch)
tree6541abbf53d97c3db4bc56546188bae1dfdb748b /llvm
parentdb71abf2d4a3690d4e2cbc42355137c6a6ccef12 (diff)
downloadbcm5719-llvm-30d77777e7383afd5f1d73efc4f6fee99f577521.tar.gz
bcm5719-llvm-30d77777e7383afd5f1d73efc4f6fee99f577521.zip
Use non virtual destructors for sections.
llvm-svn: 249548
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/MC/MCSection.h3
-rw-r--r--llvm/include/llvm/MC/MCSectionCOFF.h5
-rw-r--r--llvm/include/llvm/MC/MCSectionELF.h5
-rw-r--r--llvm/include/llvm/MC/MCSectionMachO.h2
-rw-r--r--llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp38
-rw-r--r--llvm/lib/Target/NVPTX/NVPTXSection.h4
6 files changed, 29 insertions, 28 deletions
diff --git a/llvm/include/llvm/MC/MCSection.h b/llvm/include/llvm/MC/MCSection.h
index f5490fcd173..c049ad5455b 100644
--- a/llvm/include/llvm/MC/MCSection.h
+++ b/llvm/include/llvm/MC/MCSection.h
@@ -105,10 +105,9 @@ protected:
MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin);
SectionVariant Variant;
SectionKind Kind;
+ ~MCSection();
public:
- virtual ~MCSection();
-
SectionKind getKind() const { return Kind; }
SectionVariant getVariant() const { return Variant; }
diff --git a/llvm/include/llvm/MC/MCSectionCOFF.h b/llvm/include/llvm/MC/MCSectionCOFF.h
index 7dcec1e2b27..d94682c8c38 100644
--- a/llvm/include/llvm/MC/MCSectionCOFF.h
+++ b/llvm/include/llvm/MC/MCSectionCOFF.h
@@ -21,7 +21,7 @@ namespace llvm {
class MCSymbol;
/// This represents a section on Windows
-class MCSectionCOFF : public MCSection {
+class MCSectionCOFF final : public MCSection {
// The memory for this string is stored in the same MCContext as *this.
StringRef SectionName;
@@ -51,9 +51,10 @@ private:
assert((Characteristics & 0x00F00000) == 0 &&
"alignment must not be set upon section creation");
}
- ~MCSectionCOFF() override;
public:
+ ~MCSectionCOFF();
+
/// Decides whether a '.section' directive should be printed before the
/// section name
bool ShouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const;
diff --git a/llvm/include/llvm/MC/MCSectionELF.h b/llvm/include/llvm/MC/MCSectionELF.h
index 38740612edd..52e6d949376 100644
--- a/llvm/include/llvm/MC/MCSectionELF.h
+++ b/llvm/include/llvm/MC/MCSectionELF.h
@@ -27,7 +27,7 @@ class MCSymbol;
/// This represents a section on linux, lots of unix variants and some bare
/// metal systems.
-class MCSectionELF final : public MCSection {
+class MCSectionELF final : public MCSection {
/// This is the name of the section. The referenced memory is owned by
/// TargetLoweringObjectFileELF's ELFUniqueMap.
StringRef SectionName;
@@ -61,11 +61,12 @@ private:
if (Group)
Group->setIsSignature();
}
- ~MCSectionELF() override;
void setSectionName(StringRef Name) { SectionName = Name; }
public:
+ ~MCSectionELF();
+
/// Decides whether a '.section' directive should be printed before the
/// section name
bool ShouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const;
diff --git a/llvm/include/llvm/MC/MCSectionMachO.h b/llvm/include/llvm/MC/MCSectionMachO.h
index 860c27fa6e6..658dfcda726 100644
--- a/llvm/include/llvm/MC/MCSectionMachO.h
+++ b/llvm/include/llvm/MC/MCSectionMachO.h
@@ -22,7 +22,7 @@ namespace llvm {
/// This represents a section on a Mach-O system (used by Mac OS X). On a Mac
/// system, these are also described in /usr/include/mach-o/loader.h.
-class MCSectionMachO : public MCSection {
+class MCSectionMachO final : public MCSection {
char SegmentName[16]; // Not necessarily null terminated!
char SectionName[16]; // Not necessarily null terminated!
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
index 3f1bde4586d..b5ebc91c692 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -4566,25 +4566,25 @@ void NVPTXTargetLowering::ReplaceNodeResults(
void NVPTXSection::anchor() {}
NVPTXTargetObjectFile::~NVPTXTargetObjectFile() {
- delete TextSection;
- delete DataSection;
- delete BSSSection;
- delete ReadOnlySection;
-
- delete StaticCtorSection;
- delete StaticDtorSection;
- delete LSDASection;
- delete EHFrameSection;
- delete DwarfAbbrevSection;
- delete DwarfInfoSection;
- delete DwarfLineSection;
- delete DwarfFrameSection;
- delete DwarfPubTypesSection;
- delete DwarfDebugInlineSection;
- delete DwarfStrSection;
- delete DwarfLocSection;
- delete DwarfARangesSection;
- delete DwarfRangesSection;
+ delete static_cast<NVPTXSection*>(TextSection);
+ delete static_cast<NVPTXSection*>(DataSection);
+ delete static_cast<NVPTXSection*>(BSSSection);
+ delete static_cast<NVPTXSection*>(ReadOnlySection);
+
+ delete static_cast<NVPTXSection*>(StaticCtorSection);
+ delete static_cast<NVPTXSection*>(StaticDtorSection);
+ delete static_cast<NVPTXSection*>(LSDASection);
+ delete static_cast<NVPTXSection*>(EHFrameSection);
+ delete static_cast<NVPTXSection*>(DwarfAbbrevSection);
+ delete static_cast<NVPTXSection*>(DwarfInfoSection);
+ delete static_cast<NVPTXSection*>(DwarfLineSection);
+ delete static_cast<NVPTXSection*>(DwarfFrameSection);
+ delete static_cast<NVPTXSection*>(DwarfPubTypesSection);
+ delete static_cast<const NVPTXSection*>(DwarfDebugInlineSection);
+ delete static_cast<NVPTXSection*>(DwarfStrSection);
+ delete static_cast<NVPTXSection*>(DwarfLocSection);
+ delete static_cast<NVPTXSection*>(DwarfARangesSection);
+ delete static_cast<NVPTXSection*>(DwarfRangesSection);
}
MCSection *
diff --git a/llvm/lib/Target/NVPTX/NVPTXSection.h b/llvm/lib/Target/NVPTX/NVPTXSection.h
index 3108ce2faa0..45a7309479e 100644
--- a/llvm/lib/Target/NVPTX/NVPTXSection.h
+++ b/llvm/lib/Target/NVPTX/NVPTXSection.h
@@ -22,11 +22,11 @@ namespace llvm {
/// Represents a section in PTX PTX does not have sections. We create this class
/// in order to use the ASMPrint interface.
///
-class NVPTXSection : public MCSection {
+class NVPTXSection final : public MCSection {
virtual void anchor();
public:
NVPTXSection(SectionVariant V, SectionKind K) : MCSection(V, K, nullptr) {}
- virtual ~NVPTXSection() {}
+ ~NVPTXSection() {}
/// Override this as NVPTX has its own way of printing switching
/// to a section.
OpenPOWER on IntegriCloud