<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 7, 2015 at 6:46 AM, Rafael Espindola via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: rafael<br>
Date: Wed Oct 7 08:46:06 2015<br>
New Revision: 249548<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=249548&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=249548&view=rev</a><br>
Log:<br>
Use non virtual destructors for sections.<br></blockquote><div><br><span style="color:rgb(51,51,51);font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;background-color:rgb(249,249,249)">👍</span><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Modified:<br>
llvm/trunk/include/llvm/MC/MCSection.h<br>
llvm/trunk/include/llvm/MC/MCSectionCOFF.h<br>
llvm/trunk/include/llvm/MC/MCSectionELF.h<br>
llvm/trunk/include/llvm/MC/MCSectionMachO.h<br>
llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp<br>
llvm/trunk/lib/Target/NVPTX/NVPTXSection.h<br>
<br>
Modified: llvm/trunk/include/llvm/MC/MCSection.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSection.h?rev=249548&r1=249547&r2=249548&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSection.h?rev=249548&r1=249547&r2=249548&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/MC/MCSection.h (original)<br>
+++ llvm/trunk/include/llvm/MC/MCSection.h Wed Oct 7 08:46:06 2015<br>
@@ -105,10 +105,9 @@ protected:<br>
MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin);<br>
SectionVariant Variant;<br>
SectionKind Kind;<br>
+ ~MCSection();<br>
<br>
public:<br>
- virtual ~MCSection();<br>
-<br>
SectionKind getKind() const { return Kind; }<br>
<br>
SectionVariant getVariant() const { return Variant; }<br>
<br>
Modified: llvm/trunk/include/llvm/MC/MCSectionCOFF.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionCOFF.h?rev=249548&r1=249547&r2=249548&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionCOFF.h?rev=249548&r1=249547&r2=249548&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/MC/MCSectionCOFF.h (original)<br>
+++ llvm/trunk/include/llvm/MC/MCSectionCOFF.h Wed Oct 7 08:46:06 2015<br>
@@ -21,7 +21,7 @@ namespace llvm {<br>
class MCSymbol;<br>
<br>
/// This represents a section on Windows<br>
-class MCSectionCOFF : public MCSection {<br>
+class MCSectionCOFF final : public MCSection {<br>
// The memory for this string is stored in the same MCContext as *this.<br>
StringRef SectionName;<br>
<br>
@@ -51,9 +51,10 @@ private:<br>
assert((Characteristics & 0x00F00000) == 0 &&<br>
"alignment must not be set upon section creation");<br>
}<br>
- ~MCSectionCOFF() override;<br>
<br>
public:<br>
+ ~MCSectionCOFF();<br>
+<br>
/// Decides whether a '.section' directive should be printed before the<br>
/// section name<br>
bool ShouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const;<br>
<br>
Modified: llvm/trunk/include/llvm/MC/MCSectionELF.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionELF.h?rev=249548&r1=249547&r2=249548&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionELF.h?rev=249548&r1=249547&r2=249548&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/MC/MCSectionELF.h (original)<br>
+++ llvm/trunk/include/llvm/MC/MCSectionELF.h Wed Oct 7 08:46:06 2015<br>
@@ -27,7 +27,7 @@ class MCSymbol;<br>
<br>
/// This represents a section on linux, lots of unix variants and some bare<br>
/// metal systems.<br>
-class MCSectionELF final : public MCSection {<br>
+class MCSectionELF final : public MCSection {<br></blockquote><div><br></div><div>Looks like some extra whitespace (two spaces between final and the : rather than one) snuck in here? Maybe clang-format the diff?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
/// This is the name of the section. The referenced memory is owned by<br>
/// TargetLoweringObjectFileELF's ELFUniqueMap.<br>
StringRef SectionName;<br>
@@ -61,11 +61,12 @@ private:<br>
if (Group)<br>
Group->setIsSignature();<br>
}<br>
- ~MCSectionELF() override;<br>
<br>
void setSectionName(StringRef Name) { SectionName = Name; }<br>
<br>
public:<br>
+ ~MCSectionELF();<br>
+<br>
/// Decides whether a '.section' directive should be printed before the<br>
/// section name<br>
bool ShouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const;<br>
<br>
Modified: llvm/trunk/include/llvm/MC/MCSectionMachO.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionMachO.h?rev=249548&r1=249547&r2=249548&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionMachO.h?rev=249548&r1=249547&r2=249548&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/MC/MCSectionMachO.h (original)<br>
+++ llvm/trunk/include/llvm/MC/MCSectionMachO.h Wed Oct 7 08:46:06 2015<br>
@@ -22,7 +22,7 @@ namespace llvm {<br>
<br>
/// This represents a section on a Mach-O system (used by Mac OS X). On a Mac<br>
/// system, these are also described in /usr/include/mach-o/loader.h.<br>
-class MCSectionMachO : public MCSection {<br>
+class MCSectionMachO final : public MCSection {<br>
char SegmentName[16]; // Not necessarily null terminated!<br>
char SectionName[16]; // Not necessarily null terminated!<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp?rev=249548&r1=249547&r2=249548&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp?rev=249548&r1=249547&r2=249548&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp Wed Oct 7 08:46:06 2015<br>
@@ -4566,25 +4566,25 @@ void NVPTXTargetLowering::ReplaceNodeRes<br>
void NVPTXSection::anchor() {}<br>
<br>
NVPTXTargetObjectFile::~NVPTXTargetObjectFile() {<br>
- delete TextSection;<br>
- delete DataSection;<br>
- delete BSSSection;<br>
- delete ReadOnlySection;<br>
+ delete static_cast<NVPTXSection*>(TextSection);<br>
+ delete static_cast<NVPTXSection*>(DataSection);<br>
+ delete static_cast<NVPTXSection*>(BSSSection);<br>
+ delete static_cast<NVPTXSection*>(ReadOnlySection);<br>
<br>
- delete StaticCtorSection;<br>
- delete StaticDtorSection;<br>
- delete LSDASection;<br>
- delete EHFrameSection;<br>
- delete DwarfAbbrevSection;<br>
- delete DwarfInfoSection;<br>
- delete DwarfLineSection;<br>
- delete DwarfFrameSection;<br>
- delete DwarfPubTypesSection;<br>
- delete DwarfDebugInlineSection;<br>
- delete DwarfStrSection;<br>
- delete DwarfLocSection;<br>
- delete DwarfARangesSection;<br>
- delete DwarfRangesSection;<br>
+ delete static_cast<NVPTXSection*>(StaticCtorSection);<br>
+ delete static_cast<NVPTXSection*>(StaticDtorSection);<br>
+ delete static_cast<NVPTXSection*>(LSDASection);<br>
+ delete static_cast<NVPTXSection*>(EHFrameSection);<br>
+ delete static_cast<NVPTXSection*>(DwarfAbbrevSection);<br>
+ delete static_cast<NVPTXSection*>(DwarfInfoSection);<br>
+ delete static_cast<NVPTXSection*>(DwarfLineSection);<br>
+ delete static_cast<NVPTXSection*>(DwarfFrameSection);<br>
+ delete static_cast<NVPTXSection*>(DwarfPubTypesSection);<br>
+ delete static_cast<const NVPTXSection*>(DwarfDebugInlineSection);<br>
+ delete static_cast<NVPTXSection*>(DwarfStrSection);<br>
+ delete static_cast<NVPTXSection*>(DwarfLocSection);<br>
+ delete static_cast<NVPTXSection*>(DwarfARangesSection);<br>
+ delete static_cast<NVPTXSection*>(DwarfRangesSection);<br>
}<br>
<br>
MCSection *<br>
<br>
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXSection.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXSection.h?rev=249548&r1=249547&r2=249548&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXSection.h?rev=249548&r1=249547&r2=249548&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/NVPTX/NVPTXSection.h (original)<br>
+++ llvm/trunk/lib/Target/NVPTX/NVPTXSection.h Wed Oct 7 08:46:06 2015<br>
@@ -22,11 +22,11 @@ namespace llvm {<br>
/// Represents a section in PTX PTX does not have sections. We create this class<br>
/// in order to use the ASMPrint interface.<br>
///<br>
-class NVPTXSection : public MCSection {<br>
+class NVPTXSection final : public MCSection {<br>
virtual void anchor();<br>
public:<br>
NVPTXSection(SectionVariant V, SectionKind K) : MCSection(V, K, nullptr) {}<br>
- virtual ~NVPTXSection() {}<br>
+ ~NVPTXSection() {}<br>
<br>
/// Override this as NVPTX has its own way of printing switching<br>
/// to a section.<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>