summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-04-02 00:14:33 +0000
committerRui Ueyama <ruiu@google.com>2014-04-02 00:14:33 +0000
commit60ede621ef4651ec08c569fa5099bd9c7090bb16 (patch)
tree7d98bfbcd55331c8b1d67cfaf36dbc3a850486ca
parent5b8be49fed9714cae9be7b1a918513b7605fcc49 (diff)
downloadbcm5719-llvm-60ede621ef4651ec08c569fa5099bd9c7090bb16.tar.gz
bcm5719-llvm-60ede621ef4651ec08c569fa5099bd9c7090bb16.zip
De-virtualize InputGraph's member functions.
There's no class derived from InputGraph. Making member functions virtual just makes it a bit inefficient. llvm-svn: 205377
-rw-r--r--lld/include/lld/Core/InputGraph.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/lld/include/lld/Core/InputGraph.h b/lld/include/lld/Core/InputGraph.h
index 2fdd578aa89..2fb15c5a839 100644
--- a/lld/include/lld/Core/InputGraph.h
+++ b/lld/include/lld/Core/InputGraph.h
@@ -55,22 +55,20 @@ public:
InputGraph() : _ordinal(0), _nextElementIndex(0) {}
/// \brief Adds a node into the InputGraph
- virtual bool addInputElement(std::unique_ptr<InputElement>);
+ bool addInputElement(std::unique_ptr<InputElement>);
/// \brief Set Ordinals for all the InputElements that form the InputGraph
- virtual bool assignOrdinals();
+ bool assignOrdinals();
/// Normalize the InputGraph. It visits all nodes in the tree to replace a
/// node with its children if it's shouldExpand() returnst true.
- virtual void normalize();
-
- virtual ~InputGraph() {}
+ void normalize();
/// \brief Do postprocessing of the InputGraph if there is a need for the
/// to provide additional information to the user, also rearranges
/// InputElements by their ordinals. If a user wants to place an input file
/// at the desired position, the user can do that.
- virtual void doPostProcess();
+ void doPostProcess();
range<InputElementIterT> inputElements() {
return make_range(_inputArgs.begin(), _inputArgs.end());
@@ -125,12 +123,12 @@ public:
/// Return the Element Type for an Input Element
virtual Kind kind() const { return _kind; }
- virtual void setOrdinal(int64_t ordinal) {
+ void setOrdinal(int64_t ordinal) {
if (_ordinal != -1)
_ordinal = ordinal;
}
- virtual int64_t getOrdinal() const { return _ordinal; }
+ int64_t getOrdinal() const { return _ordinal; }
/// \brief Dump the Input Element
virtual bool dump(raw_ostream &diagnostics) { return true; }
@@ -152,8 +150,6 @@ public:
/// \brief Reset the next index
virtual void resetNextIndex() = 0;
- /// Normalize functions
-
/// Returns true if we want to replace this node with children.
virtual bool shouldExpand() const { return false; }
OpenPOWER on IntegriCloud