Skip to content

Commit 6241734

Browse files
committed
pass StringRef by value, make Logger.cpp compile again after github screwup
1 parent 1413a08 commit 6241734

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

include/phasar/Utils/Logger.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Logger final {
5555
getLogStream(std::optional<SeverityLevel> Level,
5656
const std::optional<llvm::StringRef> &Category);
5757

58-
static bool logCategory(const llvm::StringRef &Category,
58+
static bool logCategory(llvm::StringRef Category,
5959
std::optional<SeverityLevel> Level);
6060

6161
static void addLinePrefix(llvm::raw_ostream &,
@@ -71,7 +71,7 @@ class Logger final {
7171
const std::optional<std::string> &Category = std::nullopt);
7272

7373
[[nodiscard]] static bool initializeFileLogger(
74-
const llvm::StringRef &Filename,
74+
llvm::StringRef Filename,
7575
std::optional<SeverityLevel> Level = std::nullopt,
7676
const std::optional<std::string> &Category = std::nullopt,
7777
bool Append = false);

lib/Utils/Logger.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void Logger::initializeStderrLogger(
6868
}
6969

7070
[[nodiscard]] bool Logger::initializeFileLogger(
71-
const llvm::StringRef &Filename, std::optional<SeverityLevel> Level,
71+
llvm::StringRef Filename, std::optional<SeverityLevel> Level,
7272
const std::optional<std::string> &Category, bool Append) {
7373
LoggingEnabled = true;
7474
if (Category.has_value()) {
@@ -100,7 +100,6 @@ void Logger::initializeStderrLogger(
100100
llvm::errs() << EC.message() << '\n';
101101
return false;
102102
}
103-
}
104103
return true;
105104
}
106105

@@ -161,7 +160,7 @@ llvm::raw_ostream &Logger::getLogStreamFromStreamVariant(
161160
return It->second;
162161
}
163162

164-
bool Logger::logCategory(const llvm::StringRef &Category,
163+
bool Logger::logCategory(llvm::StringRef Category,
165164
std::optional<SeverityLevel> Level) {
166165
auto CategoryLookupIt = CategoriesToStreamVariant.find(Category);
167166
if (CategoryLookupIt == CategoriesToStreamVariant.end()) {

0 commit comments

Comments
 (0)