Files
clang-p2996/lld/lib/ReaderWriter/ELF/OrderPass.h
David Blaikie 25ddcb4c27 Simplify Pass::perform to take a SimpleFile& instead of unique_ptr<SimpleFile>&
None of the implementations replace the SimpleFile with some other file,
they just modify the SimpleFile in-place, so a direct reference to the
file is sufficient.

llvm-svn: 240167
2015-06-19 19:43:43 +00:00

32 lines
832 B
C++

//===- lib/ReaderWriter/ELF/OrderPass.h -----------------------------------===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLD_READER_WRITER_ELF_ORDER_PASS_H
#define LLD_READER_WRITER_ELF_ORDER_PASS_H
#include "lld/Core/Parallel.h"
#include <limits>
namespace lld {
namespace elf {
/// \brief This pass sorts atoms by file and atom ordinals.
class OrderPass : public Pass {
public:
std::error_code perform(SimpleFile &file) override {
parallel_sort(file.definedAtoms().begin(), file.definedAtoms().end(),
DefinedAtom::compareByPosition);
return std::error_code();
}
};
}
}
#endif