[llvm] r195182 - Remove capability for polymorphic destruction from LexicalScope
Eric Christopher
echristo at gmail.com
Tue Nov 19 16:54:29 PST 2013
Author: echristo
Date: Tue Nov 19 18:54:28 2013
New Revision: 195182
URL: http://llvm.org/viewvc/llvm-project?rev=195182&view=rev
Log:
Remove capability for polymorphic destruction from LexicalScope
and LexicalScopes, we're not using it.
Modified:
llvm/trunk/include/llvm/CodeGen/LexicalScopes.h
llvm/trunk/lib/CodeGen/LexicalScopes.cpp
llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp
Modified: llvm/trunk/include/llvm/CodeGen/LexicalScopes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LexicalScopes.h?rev=195182&r1=195181&r2=195182&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LexicalScopes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LexicalScopes.h Tue Nov 19 18:54:28 2013
@@ -45,13 +45,14 @@ typedef std::pair<const MachineInstr *,
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; }
Modified: llvm/trunk/lib/CodeGen/LexicalScopes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LexicalScopes.cpp?rev=195182&r1=195181&r2=195182&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LexicalScopes.cpp (original)
+++ llvm/trunk/lib/CodeGen/LexicalScopes.cpp Tue Nov 19 18:54:28 2013
@@ -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<InsnRange, 4> MIRanges;
DenseMap<const MachineInstr *, LexicalScope *> MI2ScopeMap;
@@ -311,8 +312,6 @@ bool LexicalScopes::dominates(DebugLoc D
return Result;
}
-void LexicalScope::anchor() {}
-
/// dump - Print data structures.
void LexicalScope::dump(unsigned Indent) const {
#ifndef NDEBUG
Modified: llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp?rev=195182&r1=195181&r2=195182&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveDebugVariables.cpp Tue Nov 19 18:54:28 2013
@@ -704,7 +704,6 @@ bool LDVImpl::runOnMachineFunction(Machi
bool Changed = collectDebugValues(mf);
computeIntervals();
DEBUG(print(dbgs()));
- LS.releaseMemory();
ModifiedMF = Changed;
return Changed;
}
More information about the llvm-commits
mailing list