Skip to content

Commit 6d75266

Browse files
committed
Format code
1 parent 87e3af0 commit 6d75266

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

libcxx/include/__exception/exception_ptr.h

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
// the functions to be emitted and included in the library. When users of libc++
3434
// compile their code, the __gnu_inline__ attribute will suppress generation of
3535
// these functions while making their definitions available for inlining.
36-
# ifdef _LIBCPP_EMIT_CODE_FOR_EXCEPTION_PTR
37-
# define _LIBCPP_EXPORTED_FROM_LIB_INLINEABLE _LIBCPP_EXPORTED_FROM_ABI
38-
# else
39-
# if !__has_cpp_attribute(gnu::gnu_inline)
40-
# error "GNU inline attribute is not supported"
41-
# endif
42-
# define _LIBCPP_EXPORTED_FROM_LIB_INLINEABLE [[gnu::gnu_inline]] inline
36+
#ifdef _LIBCPP_EMIT_CODE_FOR_EXCEPTION_PTR
37+
# define _LIBCPP_EXPORTED_FROM_LIB_INLINEABLE _LIBCPP_EXPORTED_FROM_ABI
38+
#else
39+
# if !__has_cpp_attribute(gnu::gnu_inline)
40+
# error "GNU inline attribute is not supported"
4341
# endif
42+
# define _LIBCPP_EXPORTED_FROM_LIB_INLINEABLE [[gnu::gnu_inline]] inline
43+
#endif
4444

4545
_LIBCPP_DIAGNOSTIC_PUSH
4646
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wgnu-inline-cpp-without-extern")
@@ -119,8 +119,8 @@ class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
119119

120120
friend _LIBCPP_HIDE_FROM_ABI void swap(exception_ptr& __x, exception_ptr& __y) {
121121
void* __tmp = __x.__ptr_;
122-
__x.__ptr_ = __y.__ptr_;
123-
__y.__ptr_ = __tmp;
122+
__x.__ptr_ = __y.__ptr_;
123+
__y.__ptr_ = __tmp;
124124
}
125125

126126
friend _LIBCPP_EXPORTED_FROM_ABI exception_ptr current_exception() _NOEXCEPT;
@@ -136,7 +136,8 @@ _LIBCPP_EXPORTED_FROM_LIB_INLINEABLE exception_ptr exception_ptr::__from_native_
136136
}
137137

138138
// Must be defined outside the class definition due to _LIBCPP_EXPORTED_FROM_LIB_INLINEABLE
139-
_LIBCPP_EXPORTED_FROM_LIB_INLINEABLE exception_ptr::exception_ptr(const exception_ptr& __other) noexcept : __ptr_(__other.__ptr_) {
139+
_LIBCPP_EXPORTED_FROM_LIB_INLINEABLE exception_ptr::exception_ptr(const exception_ptr& __other) noexcept
140+
: __ptr_(__other.__ptr_) {
140141
__increment_refcount(__ptr_);
141142
}
142143

@@ -156,7 +157,7 @@ _LIBCPP_EXPORTED_FROM_LIB_INLINEABLE exception_ptr& exception_ptr::operator=(con
156157

157158
_LIBCPP_HIDE_FROM_ABI inline exception_ptr& exception_ptr::operator=(exception_ptr&& __other) noexcept {
158159
__decrement_refcount(__ptr_);
159-
__ptr_ = __other.__ptr_;
160+
__ptr_ = __other.__ptr_;
160161
__other.__ptr_ = nullptr;
161162
return *this;
162163
}
@@ -274,17 +275,17 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
274275

275276
_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
276277

277-
# if defined(_LIBCPP_CXX_ABI_NONE)
278-
# include <__exception/exception_ptr_unimplemented.ipp>
279-
# elif defined(_LIBCPP_CXX_ABI_LIBCXXABI) || defined(_LIBCPP_CXX_ABI_LIBCXXRT)
280-
# include <__exception/exception_ptr_cxxabi.ipp>
281-
# elif defined(_LIBCPP_CXX_ABI_LIBSTDCXX) || defined(_LIBCPP_CXX_ABI_LIBSUPCXX)
282-
# include <__exception/exception_ptr_glibcxx.ipp>
283-
# elif defined(_LIBCPP_CXX_ABI_VCRUNTIME)
284-
# include <__exception/exception_ptr_msvc.ipp>
285-
# else
286-
# error "Unsupported C++ ABI library"
287-
# endif
278+
#if defined(_LIBCPP_CXX_ABI_NONE)
279+
# include <__exception/exception_ptr_unimplemented.ipp>
280+
#elif defined(_LIBCPP_CXX_ABI_LIBCXXABI) || defined(_LIBCPP_CXX_ABI_LIBCXXRT)
281+
# include <__exception/exception_ptr_cxxabi.ipp>
282+
#elif defined(_LIBCPP_CXX_ABI_LIBSTDCXX) || defined(_LIBCPP_CXX_ABI_LIBSUPCXX)
283+
# include <__exception/exception_ptr_glibcxx.ipp>
284+
#elif defined(_LIBCPP_CXX_ABI_VCRUNTIME)
285+
# include <__exception/exception_ptr_msvc.ipp>
286+
#else
287+
# error "Unsupported C++ ABI library"
288+
#endif
288289

289290
_LIBCPP_DIAGNOSTIC_POP
290291

libcxx/src/exception.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ void nested_exception::rethrow_nested() const {
4343
rethrow_exception(__ptr_);
4444
}
4545

46-
}
46+
} // namespace std

libcxx/test/benchmarks/exception_ptr.bench.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ void bm_make_exception_ptr(benchmark::State& state) {
1818
}
1919
BENCHMARK(bm_make_exception_ptr)->ThreadRange(1, 8);
2020

21-
2221
void bm_empty_exception_ptr(benchmark::State& state) {
2322
for (auto _ : state) {
2423
// All of the following operations are no-ops because
2524
// the exception_ptr is empty. Hence, the compiler should
2625
// be able to optimize them very aggressively.
2726
std::exception_ptr p1;
28-
std::exception_ptr p2 (p1);
29-
std::exception_ptr p3 (std::move(p2));
27+
std::exception_ptr p2(p1);
28+
std::exception_ptr p3(std::move(p2));
3029
p2 = std::move(p1);
3130
p1 = p2;
3231
swap(p1, p2);

0 commit comments

Comments
 (0)