[Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301049 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eugene Zelenko
2017-04-21 22:03:05 +00:00
parent 960a40ec57
commit 903f87efcc
7 changed files with 281 additions and 219 deletions

View File

@@ -1,4 +1,4 @@
//===- ModuleSummaryIndexObjectFile.cpp - Summary index file implementation ==//
//==- ModuleSummaryIndexObjectFile.cpp - Summary index file implementation -==//
//
// The LLVM Compiler Infrastructure
//
@@ -11,29 +11,38 @@
//
//===----------------------------------------------------------------------===//
#include "llvm/Object/ModuleSummaryIndexObjectFile.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/IR/ModuleSummaryIndex.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/Error.h"
#include "llvm/Object/ModuleSummaryIndexObjectFile.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <memory>
#include <system_error>
using namespace llvm;
using namespace object;
static llvm::cl::opt<bool> IgnoreEmptyThinLTOIndexFile(
"ignore-empty-index-file", llvm::cl::ZeroOrMore,
llvm::cl::desc(
static cl::opt<bool> IgnoreEmptyThinLTOIndexFile(
"ignore-empty-index-file", cl::ZeroOrMore,
cl::desc(
"Ignore an empty index file and perform non-ThinLTO compilation"),
llvm::cl::init(false));
cl::init(false));
ModuleSummaryIndexObjectFile::ModuleSummaryIndexObjectFile(
MemoryBufferRef Object, std::unique_ptr<ModuleSummaryIndex> I)
: SymbolicFile(Binary::ID_ModuleSummaryIndex, Object), Index(std::move(I)) {
}
ModuleSummaryIndexObjectFile::~ModuleSummaryIndexObjectFile() {}
ModuleSummaryIndexObjectFile::~ModuleSummaryIndexObjectFile() = default;
std::unique_ptr<ModuleSummaryIndex> ModuleSummaryIndexObjectFile::takeIndex() {
return std::move(Index);