forked from OSchip/llvm-project
Remove unused enum Position::ANY and third parameter of insertElementAt().
insertElementAt()'s third parameter is not only unused but also ignored if you pass Position::END. The actual meaning of the parameter was obscure. Differential Revision: http://llvm-reviews.chandlerc.com/D3256 llvm-svn: 205376
This commit is contained in:
parent
2243015825
commit
5b8be49fed
|
@ -49,11 +49,7 @@ public:
|
|||
|
||||
/// Where do we want to insert the input element when calling the
|
||||
/// insertElementAt.
|
||||
enum Position : uint8_t {
|
||||
ANY,
|
||||
BEGIN,
|
||||
END
|
||||
};
|
||||
enum Position : uint8_t { BEGIN, END };
|
||||
|
||||
/// \brief Initialize the inputgraph
|
||||
InputGraph() : _ordinal(0), _nextElementIndex(0) {}
|
||||
|
@ -91,8 +87,7 @@ public:
|
|||
}
|
||||
|
||||
/// \brief Insert an element into the input graph at position.
|
||||
void insertElementAt(std::unique_ptr<InputElement>, Position position,
|
||||
size_t pos = 0);
|
||||
void insertElementAt(std::unique_ptr<InputElement>, Position position);
|
||||
|
||||
/// \brief Helper functions for the resolver
|
||||
ErrorOr<InputElement *> getNextInputElement();
|
||||
|
|
|
@ -44,12 +44,13 @@ bool InputGraph::dump(raw_ostream &diagnostics) {
|
|||
|
||||
/// \brief Insert element at position
|
||||
void InputGraph::insertElementAt(std::unique_ptr<InputElement> element,
|
||||
Position position, size_t pos) {
|
||||
if (position == InputGraph::Position::BEGIN)
|
||||
pos = 0;
|
||||
else if (position == InputGraph::Position::END)
|
||||
pos = _inputArgs.size();
|
||||
_inputArgs.insert(_inputArgs.begin() + pos, std::move(element));
|
||||
Position position) {
|
||||
if (position == InputGraph::Position::BEGIN) {
|
||||
_inputArgs.insert(_inputArgs.begin(), std::move(element));
|
||||
return;
|
||||
}
|
||||
assert(position == InputGraph::Position::END);
|
||||
_inputArgs.push_back(std::move(element));
|
||||
}
|
||||
|
||||
/// \brief Helper functions for the resolver
|
||||
|
|
Loading…
Reference in New Issue