Skip to content

Commit 09fdd4c

Browse files
committed
Runtime: Suppress some bad GNUs.
Being standards-compliant is more important than golfing -O0 code. A context-free lambda can be trivially inlined by the optimizer.
1 parent a3c92e1 commit 09fdd4c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: include/swift/Basic/Lazy.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ template <typename T> inline T &Lazy<T>::get(void (*initCallback)(void*)) {
7474
} // namespace swift
7575

7676
#define SWIFT_LAZY_CONSTANT(INITIAL_VALUE) \
77-
({ \
77+
([]{ \
7878
using T = ::std::remove_reference<decltype(INITIAL_VALUE)>::type; \
7979
static ::swift::Lazy<T> TheLazy; \
80-
TheLazy.get([](void *ValueAddr){ ::new(ValueAddr) T{INITIAL_VALUE}; });\
81-
})
80+
return TheLazy.get([](void *ValueAddr){ ::new(ValueAddr) T{INITIAL_VALUE}; });\
81+
}())
8282

8383
#endif // SWIFT_BASIC_LAZY_H

0 commit comments

Comments
 (0)