Skip to content

Commit d8b8d59

Browse files
Merge pull request #4060 from adrian-prantl/lambda-logging
No longer strip out operator() from LOG_PRINTF().
2 parents c098b8e + 6049953 commit d8b8d59

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,6 @@
129129
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
130130

131131
namespace {
132-
/// This silly constexpr allows us to filter out the useless __FUNCTION__ name
133-
/// of lambdas in the LOG_PRINTF macro.
134-
bool constexpr IsLambda(const char *name) {
135-
return name[0] && name[0] == 'o' && name[1] && name[1] == 'p' && name[2] &&
136-
name[2] == 'e' && name[3] && name[3] == 'r' && name[4] &&
137-
name[4] == 'a' && name[5] && name[5] == 't' && name[6] &&
138-
name[6] == 'o' && name[7] && name[7] == 'r' && name[8] &&
139-
name[8] == '(' && name[9] && name[9] == ')';
140-
}
141132

142133
/// Used to sort the log output.
143134
std::recursive_mutex g_log_mutex;
@@ -157,8 +148,7 @@ std::recursive_mutex g_log_mutex;
157148
if (!(VERBOSE) || log->GetVerbose()) { \
158149
std::lock_guard<std::recursive_mutex> locker(g_log_mutex); \
159150
/* The format string is optimized for code size, not speed. */ \
160-
log->Printf("%s::%s%s" FMT, m_description.c_str(), \
161-
IsLambda(__FUNCTION__) ? "" : __FUNCTION__, \
151+
log->Printf("%s::%s%s" FMT, m_description.c_str(), __FUNCTION__, \
162152
(FMT && FMT[0] == '(') ? "" : "() -- ", ##__VA_ARGS__); \
163153
} \
164154
} while (0)

0 commit comments

Comments
 (0)