[ProfileData] Clean up string handling a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271180 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2016-05-29 10:31:00 +00:00
parent a83f08e633
commit 2ff22b74ed
6 changed files with 15 additions and 17 deletions
+3 -3
View File
@@ -19,7 +19,7 @@
using namespace llvm;
static Expected<std::unique_ptr<MemoryBuffer>>
setupMemoryBuffer(std::string Path) {
setupMemoryBuffer(const Twine &Path) {
ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr =
MemoryBuffer::getFileOrSTDIN(Path);
if (std::error_code EC = BufferOrErr.getError())
@@ -32,7 +32,7 @@ static Error initializeReader(InstrProfReader &Reader) {
}
Expected<std::unique_ptr<InstrProfReader>>
InstrProfReader::create(std::string Path) {
InstrProfReader::create(const Twine &Path) {
// Set up the buffer to read.
auto BufferOrError = setupMemoryBuffer(Path);
if (Error E = BufferOrError.takeError())
@@ -67,7 +67,7 @@ InstrProfReader::create(std::unique_ptr<MemoryBuffer> Buffer) {
}
Expected<std::unique_ptr<IndexedInstrProfReader>>
IndexedInstrProfReader::create(std::string Path) {
IndexedInstrProfReader::create(const Twine &Path) {
// Set up the buffer to read.
auto BufferOrError = setupMemoryBuffer(Path);
if (Error E = BufferOrError.takeError())