summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp
diff options
context:
space:
mode:
authorEugene Zelenko <eugene.zelenko@gmail.com>2016-11-23 23:16:32 +0000
committerEugene Zelenko <eugene.zelenko@gmail.com>2016-11-23 23:16:32 +0000
commit570e39a25ca345e3facaea16b2facefddfb3aa92 (patch)
tree04b12c1516d05fbbcd6883f4579a9a62eb8d45be /llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp
parentbf9523f549cc28c9c9836fa9442db86ba4657433 (diff)
downloadbcm5719-llvm-570e39a25ca345e3facaea16b2facefddfb3aa92.tar.gz
bcm5719-llvm-570e39a25ca345e3facaea16b2facefddfb3aa92.zip
[DebugInfo] Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC).
Per Zachary Turner and Mehdi Amini suggestion to make only post-commit reviews. llvm-svn: 287838
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp b/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp
index ad7a3fc14de..cd3a2064c71 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp
@@ -7,10 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/DebugInfo/PDB/Raw/RawSession.h"
-
+#include "llvm/ADT/STLExtras.h"
#include "llvm/DebugInfo/MSF/ByteStream.h"
-#include "llvm/DebugInfo/MSF/StreamInterface.h"
#include "llvm/DebugInfo/PDB/GenericError.h"
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
@@ -18,9 +16,13 @@
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
#include "llvm/DebugInfo/PDB/Raw/RawError.h"
-
+#include "llvm/DebugInfo/PDB/Raw/RawSession.h"
+#include "llvm/Support/Allocator.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/MemoryBuffer.h"
+#include <algorithm>
+#include <memory>
using namespace llvm;
using namespace llvm::msf;
@@ -30,16 +32,15 @@ RawSession::RawSession(std::unique_ptr<PDBFile> PdbFile,
std::unique_ptr<BumpPtrAllocator> Allocator)
: Pdb(std::move(PdbFile)), Allocator(std::move(Allocator)) {}
-RawSession::~RawSession() {}
+RawSession::~RawSession() = default;
Error RawSession::createFromPdb(StringRef Path,
std::unique_ptr<IPDBSession> &Session) {
-
ErrorOr<std::unique_ptr<MemoryBuffer>> ErrorOrBuffer =
MemoryBuffer::getFileOrSTDIN(Path, /*FileSize=*/-1,
/*RequiresNullTerminator=*/false);
if (!ErrorOrBuffer)
- return llvm::make_error<GenericError>(generic_error_code::invalid_path);
+ return make_error<GenericError>(generic_error_code::invalid_path);
std::unique_ptr<MemoryBuffer> Buffer = std::move(*ErrorOrBuffer);
auto Stream = llvm::make_unique<MemoryBufferByteStream>(std::move(Buffer));
@@ -59,7 +60,7 @@ Error RawSession::createFromPdb(StringRef Path,
Error RawSession::createFromExe(StringRef Path,
std::unique_ptr<IPDBSession> &Session) {
- return llvm::make_error<RawError>(raw_error_code::feature_unsupported);
+ return make_error<RawError>(raw_error_code::feature_unsupported);
}
uint64_t RawSession::getLoadAddress() const { return 0; }
@@ -92,26 +93,26 @@ RawSession::findLineNumbersByAddress(uint64_t Address, uint32_t Length) const {
std::unique_ptr<IPDBEnumSourceFiles>
RawSession::findSourceFiles(const PDBSymbolCompiland *Compiland,
- llvm::StringRef Pattern,
+ StringRef Pattern,
PDB_NameSearchFlags Flags) const {
return nullptr;
}
std::unique_ptr<IPDBSourceFile>
RawSession::findOneSourceFile(const PDBSymbolCompiland *Compiland,
- llvm::StringRef Pattern,
+ StringRef Pattern,
PDB_NameSearchFlags Flags) const {
return nullptr;
}
std::unique_ptr<IPDBEnumChildren<PDBSymbolCompiland>>
-RawSession::findCompilandsForSourceFile(llvm::StringRef Pattern,
+RawSession::findCompilandsForSourceFile(StringRef Pattern,
PDB_NameSearchFlags Flags) const {
return nullptr;
}
std::unique_ptr<PDBSymbolCompiland>
-RawSession::findOneCompilandForSourceFile(llvm::StringRef Pattern,
+RawSession::findOneCompilandForSourceFile(StringRef Pattern,
PDB_NameSearchFlags Flags) const {
return nullptr;
}
OpenPOWER on IntegriCloud