diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-11-18 09:31:53 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-11-18 09:31:53 +0000 |
commit | b21ab43cfc3fa0dacf5c95f04e58b6d804b59a16 (patch) | |
tree | 12f522231a5b3a875b1ac733a5bf1b1025088c7c /lib/Target/NVPTX | |
parent | 69b2447b6a3fcc303e03cba8c7c50d745b0284d2 (diff) | |
download | external_llvm-b21ab43cfc3fa0dacf5c95f04e58b6d804b59a16.zip external_llvm-b21ab43cfc3fa0dacf5c95f04e58b6d804b59a16.tar.gz external_llvm-b21ab43cfc3fa0dacf5c95f04e58b6d804b59a16.tar.bz2 |
Revert r194865 and r194874.
This change is incorrect. If you delete virtual destructor of both a base class
and a subclass, then the following code:
Base *foo = new Child();
delete foo;
will not cause the destructor for members of Child class. As a result, I observe
plently of memory leaks. Notable examples I investigated are:
ObjectBuffer and ObjectBufferStream, AttributeImpl and StringSAttributeImpl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194997 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/NVPTX')
-rw-r--r-- | lib/Target/NVPTX/NVPTXISelLowering.cpp | 26 | ||||
-rw-r--r-- | lib/Target/NVPTX/NVPTXInstrInfo.cpp | 5 | ||||
-rw-r--r-- | lib/Target/NVPTX/NVPTXInstrInfo.h | 1 | ||||
-rw-r--r-- | lib/Target/NVPTX/NVPTXSection.h | 4 | ||||
-rw-r--r-- | lib/Target/NVPTX/NVPTXSubtarget.cpp | 3 | ||||
-rw-r--r-- | lib/Target/NVPTX/NVPTXSubtarget.h | 2 | ||||
-rw-r--r-- | lib/Target/NVPTX/NVPTXTargetObjectFile.h | 23 |
7 files changed, 25 insertions, 39 deletions
diff --git a/lib/Target/NVPTX/NVPTXISelLowering.cpp b/lib/Target/NVPTX/NVPTXISelLowering.cpp index 756b15e..7ff43bf 100644 --- a/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -2288,29 +2288,3 @@ void NVPTXTargetLowering::ReplaceNodeResults( return; } } - -// pin NVPTXSection.h and NVPTXTargetObjectFile.h vtables to this file -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 DwarfMacroInfoSection; -} diff --git a/lib/Target/NVPTX/NVPTXInstrInfo.cpp b/lib/Target/NVPTX/NVPTXInstrInfo.cpp index ce5b5d5..1f54d3e 100644 --- a/lib/Target/NVPTX/NVPTXInstrInfo.cpp +++ b/lib/Target/NVPTX/NVPTXInstrInfo.cpp @@ -14,7 +14,7 @@ #include "NVPTX.h" #include "NVPTXInstrInfo.h" #include "NVPTXTargetMachine.h" -#define GET_INSTRINFO_CTOR_DTOR +#define GET_INSTRINFO_CTOR #include "NVPTXGenInstrInfo.inc" #include "llvm/IR/Function.h" #include "llvm/ADT/STLExtras.h" @@ -24,9 +24,6 @@ using namespace llvm; -// pin vtable to this file -void NVPTXInstrInfo::anchor() {} - // FIXME: Add the subtarget support on this constructor. NVPTXInstrInfo::NVPTXInstrInfo(NVPTXTargetMachine &tm) : NVPTXGenInstrInfo(), TM(tm), RegInfo(*TM.getSubtargetImpl()) {} diff --git a/lib/Target/NVPTX/NVPTXInstrInfo.h b/lib/Target/NVPTX/NVPTXInstrInfo.h index 600fc5c..b1972e9 100644 --- a/lib/Target/NVPTX/NVPTXInstrInfo.h +++ b/lib/Target/NVPTX/NVPTXInstrInfo.h @@ -26,7 +26,6 @@ namespace llvm { class NVPTXInstrInfo : public NVPTXGenInstrInfo { NVPTXTargetMachine &TM; const NVPTXRegisterInfo RegInfo; - virtual void anchor(); public: explicit NVPTXInstrInfo(NVPTXTargetMachine &TM); diff --git a/lib/Target/NVPTX/NVPTXSection.h b/lib/Target/NVPTX/NVPTXSection.h index f8a692e..e57ace9 100644 --- a/lib/Target/NVPTX/NVPTXSection.h +++ b/lib/Target/NVPTX/NVPTXSection.h @@ -24,10 +24,10 @@ namespace llvm { /// the ASMPrint interface. /// class NVPTXSection : public MCSection { - virtual void anchor(); + public: NVPTXSection(SectionVariant V, SectionKind K) : MCSection(V, K) {} - virtual ~NVPTXSection() {} + ~NVPTXSection() {} /// Override this as NVPTX has its own way of printing switching /// to a section. diff --git a/lib/Target/NVPTX/NVPTXSubtarget.cpp b/lib/Target/NVPTX/NVPTXSubtarget.cpp index 3e5bcf7..c4d0d6e 100644 --- a/lib/Target/NVPTX/NVPTXSubtarget.cpp +++ b/lib/Target/NVPTX/NVPTXSubtarget.cpp @@ -20,9 +20,6 @@ using namespace llvm; -// pin vtable to this file -void NVPTXSubtarget::anchor() {} - NVPTXSubtarget::NVPTXSubtarget(const std::string &TT, const std::string &CPU, const std::string &FS, bool is64Bit) : NVPTXGenSubtargetInfo(TT, CPU, FS), Is64Bit(is64Bit), PTXVersion(0), diff --git a/lib/Target/NVPTX/NVPTXSubtarget.h b/lib/Target/NVPTX/NVPTXSubtarget.h index a183920..670077d 100644 --- a/lib/Target/NVPTX/NVPTXSubtarget.h +++ b/lib/Target/NVPTX/NVPTXSubtarget.h @@ -36,8 +36,6 @@ class NVPTXSubtarget : public NVPTXGenSubtargetInfo { // SM version x.y is represented as 10*x+y, e.g. 3.1 == 31 unsigned int SmVersion; - virtual void anchor(); - public: /// This constructor initializes the data members to match that /// of the specified module. diff --git a/lib/Target/NVPTX/NVPTXTargetObjectFile.h b/lib/Target/NVPTX/NVPTXTargetObjectFile.h index 2a7394b..1449f52 100644 --- a/lib/Target/NVPTX/NVPTXTargetObjectFile.h +++ b/lib/Target/NVPTX/NVPTXTargetObjectFile.h @@ -44,7 +44,28 @@ public: DwarfMacroInfoSection = 0; } - virtual ~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 DwarfMacroInfoSection; + } virtual void Initialize(MCContext &ctx, const TargetMachine &TM) { TargetLoweringObjectFile::Initialize(ctx, TM); |