From: Eric Christopher Date: Wed, 20 Nov 2013 00:54:28 +0000 (+0000) Subject: Remove capability for polymorphic destruction from LexicalScope X-Git-Tag: android-x86-7.1-r4~67507 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b88a94faaab2234d7da660a577b612754ecb9897;p=android-x86%2Fexternal-llvm.git Remove capability for polymorphic destruction from LexicalScope and LexicalScopes, we're not using it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195182 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/LexicalScopes.h b/include/llvm/CodeGen/LexicalScopes.h index 25f903c36cd..af1f8470a42 100644 --- a/include/llvm/CodeGen/LexicalScopes.h +++ b/include/llvm/CodeGen/LexicalScopes.h @@ -45,13 +45,14 @@ typedef std::pair InsnRange; class LexicalScopes { public: LexicalScopes() : MF(NULL), CurrentFnLexicalScope(NULL) {} - virtual ~LexicalScopes(); + ~LexicalScopes(); - /// initialize - Scan machine function and constuct lexical scope nest. - virtual void initialize(const MachineFunction &); + /// initialize - Scan machine function and constuct lexical scope nest, resets + /// the instance if necessary. + void initialize(const MachineFunction &); /// releaseMemory - release memory. - virtual void releaseMemory(); + void reset(); /// empty - Return true if there is any lexical scope information available. bool empty() { return CurrentFnLexicalScope == NULL; } @@ -156,7 +157,6 @@ private: /// LexicalScope - This class is used to track scope information. /// class LexicalScope { - virtual void anchor(); public: LexicalScope(LexicalScope *P, const MDNode *D, const MDNode *I, bool A) @@ -166,8 +166,6 @@ public: Parent->addChild(this); } - virtual ~LexicalScope() {} - // Accessors. LexicalScope *getParent() const { return Parent; } const MDNode *getDesc() const { return Desc; } diff --git a/lib/CodeGen/LexicalScopes.cpp b/lib/CodeGen/LexicalScopes.cpp index 006db6ccc9e..e58145826ff 100644 --- a/lib/CodeGen/LexicalScopes.cpp +++ b/lib/CodeGen/LexicalScopes.cpp @@ -25,10 +25,11 @@ #include "llvm/Support/FormattedStream.h" using namespace llvm; -LexicalScopes::~LexicalScopes() { releaseMemory(); } +/// ~LexicalScopes - final cleanup after ourselves. +LexicalScopes::~LexicalScopes() { reset(); } -/// releaseMemory - release memory. -void LexicalScopes::releaseMemory() { +/// reset - Reset the instance so that it's prepared for another function. +void LexicalScopes::reset() { MF = NULL; CurrentFnLexicalScope = NULL; DeleteContainerSeconds(LexicalScopeMap); @@ -39,7 +40,7 @@ void LexicalScopes::releaseMemory() { /// initialize - Scan machine function and constuct lexical scope nest. void LexicalScopes::initialize(const MachineFunction &Fn) { - releaseMemory(); + reset(); MF = &Fn; SmallVector MIRanges; DenseMap MI2ScopeMap; @@ -311,8 +312,6 @@ bool LexicalScopes::dominates(DebugLoc DL, MachineBasicBlock *MBB) { return Result; } -void LexicalScope::anchor() {} - /// dump - Print data structures. void LexicalScope::dump(unsigned Indent) const { #ifndef NDEBUG diff --git a/lib/CodeGen/LiveDebugVariables.cpp b/lib/CodeGen/LiveDebugVariables.cpp index 9ada1b49288..52b7ee0f2a6 100644 --- a/lib/CodeGen/LiveDebugVariables.cpp +++ b/lib/CodeGen/LiveDebugVariables.cpp @@ -704,7 +704,6 @@ bool LDVImpl::runOnMachineFunction(MachineFunction &mf) { bool Changed = collectDebugValues(mf); computeIntervals(); DEBUG(print(dbgs())); - LS.releaseMemory(); ModifiedMF = Changed; return Changed; }