aboutsummaryrefslogtreecommitdiff
path: root/libcxx/src
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/src')
-rw-r--r--libcxx/src/barrier.cpp18
-rw-r--r--libcxx/src/filesystem/operations.cpp4
-rw-r--r--libcxx/src/filesystem/path.cpp28
-rw-r--r--libcxx/src/filesystem/path_parser.h28
-rw-r--r--libcxx/src/locale.cpp4
5 files changed, 41 insertions, 41 deletions
diff --git a/libcxx/src/barrier.cpp b/libcxx/src/barrier.cpp
index bbcfb60..69601bf 100644
--- a/libcxx/src/barrier.cpp
+++ b/libcxx/src/barrier.cpp
@@ -21,17 +21,17 @@ public:
} __tickets[64];
};
- ptrdiff_t& __expected;
- unique_ptr<__state_t[]> __state;
+ ptrdiff_t& __expected_;
+ unique_ptr<__state_t[]> __state_;
- _LIBCPP_HIDDEN __barrier_algorithm_base(ptrdiff_t& __expected) : __expected(__expected) {
+ _LIBCPP_HIDDEN __barrier_algorithm_base(ptrdiff_t& __expected) : __expected_(__expected) {
size_t const __count = (__expected + 1) >> 1;
- __state = unique_ptr<__state_t[]>(new __state_t[__count]);
+ __state_ = unique_ptr<__state_t[]>(new __state_t[__count]);
}
_LIBCPP_HIDDEN bool __arrive(__barrier_phase_t __old_phase) {
__barrier_phase_t const __half_step = __old_phase + 1, __full_step = __old_phase + 2;
- size_t __current_expected = __expected,
- __current = hash<thread::id>()(this_thread::get_id()) % ((__expected + 1) >> 1);
+ size_t __current_expected = __expected_,
+ __current = hash<thread::id>()(this_thread::get_id()) % ((__expected_ + 1) >> 1);
for (int __round = 0;; ++__round) {
if (__current_expected <= 1)
return true;
@@ -41,14 +41,14 @@ public:
__current = 0;
__barrier_phase_t expect = __old_phase;
if (__current == __last_node && (__current_expected & 1)) {
- if (__state[__current].__tickets[__round].__phase.compare_exchange_strong(
+ if (__state_[__current].__tickets[__round].__phase.compare_exchange_strong(
expect, __full_step, memory_order_acq_rel))
break; // I'm 1 in 1, go to next __round
- } else if (__state[__current].__tickets[__round].__phase.compare_exchange_strong(
+ } else if (__state_[__current].__tickets[__round].__phase.compare_exchange_strong(
expect, __half_step, memory_order_acq_rel)) {
return false; // I'm 1 in 2, done with arrival
} else if (expect == __half_step) {
- if (__state[__current].__tickets[__round].__phase.compare_exchange_strong(
+ if (__state_[__current].__tickets[__round].__phase.compare_exchange_strong(
expect, __full_step, memory_order_acq_rel))
break; // I'm 2 in 2, go to next __round
}
diff --git a/libcxx/src/filesystem/operations.cpp b/libcxx/src/filesystem/operations.cpp
index abd8695..a83c1ae 100644
--- a/libcxx/src/filesystem/operations.cpp
+++ b/libcxx/src/filesystem/operations.cpp
@@ -934,7 +934,7 @@ path __weakly_canonical(const path& p, error_code* ec) {
vector<string_view_t> DNEParts;
error_code m_ec;
- while (PP.State != PathParser::PS_BeforeBegin) {
+ while (PP.State_ != PathParser::PS_BeforeBegin) {
tmp.assign(createView(p.native().data(), &PP.RawEntry.back()));
file_status st = __status(tmp, &m_ec);
if (!status_known(st)) {
@@ -949,7 +949,7 @@ path __weakly_canonical(const path& p, error_code* ec) {
DNEParts.push_back(*PP);
--PP;
}
- if (PP.State == PathParser::PS_BeforeBegin) {
+ if (PP.State_ == PathParser::PS_BeforeBegin) {
result = __canonical("", &m_ec);
if (m_ec) {
return err.report(m_ec);
diff --git a/libcxx/src/filesystem/path.cpp b/libcxx/src/filesystem/path.cpp
index c89346a..b201952 100644
--- a/libcxx/src/filesystem/path.cpp
+++ b/libcxx/src/filesystem/path.cpp
@@ -45,23 +45,23 @@ path& path::replace_extension(path const& replacement) {
string_view_t path::__root_name() const {
auto PP = PathParser::CreateBegin(__pn_);
- if (PP.State == PathParser::PS_InRootName)
+ if (PP.State_ == PathParser::PS_InRootName)
return *PP;
return {};
}
string_view_t path::__root_directory() const {
auto PP = PathParser::CreateBegin(__pn_);
- if (PP.State == PathParser::PS_InRootName)
+ if (PP.State_ == PathParser::PS_InRootName)
++PP;
- if (PP.State == PathParser::PS_InRootDir)
+ if (PP.State_ == PathParser::PS_InRootDir)
return *PP;
return {};
}
string_view_t path::__root_path_raw() const {
auto PP = PathParser::CreateBegin(__pn_);
- if (PP.State == PathParser::PS_InRootName) {
+ if (PP.State_ == PathParser::PS_InRootName) {
auto NextCh = PP.peek();
if (NextCh && isSeparator(*NextCh)) {
++PP;
@@ -69,24 +69,24 @@ string_view_t path::__root_path_raw() const {
}
return PP.RawEntry;
}
- if (PP.State == PathParser::PS_InRootDir)
+ if (PP.State_ == PathParser::PS_InRootDir)
return *PP;
return {};
}
static bool ConsumeRootName(PathParser* PP) {
static_assert(PathParser::PS_BeforeBegin == 1 && PathParser::PS_InRootName == 2, "Values for enums are incorrect");
- while (PP->State <= PathParser::PS_InRootName)
+ while (PP->State_ <= PathParser::PS_InRootName)
++(*PP);
- return PP->State == PathParser::PS_AtEnd;
+ return PP->State_ == PathParser::PS_AtEnd;
}
static bool ConsumeRootDir(PathParser* PP) {
static_assert(PathParser::PS_BeforeBegin == 1 && PathParser::PS_InRootName == 2 && PathParser::PS_InRootDir == 3,
"Values for enums are incorrect");
- while (PP->State <= PathParser::PS_InRootDir)
+ while (PP->State_ <= PathParser::PS_InRootDir)
++(*PP);
- return PP->State == PathParser::PS_AtEnd;
+ return PP->State_ == PathParser::PS_AtEnd;
}
string_view_t path::__relative_path() const {
@@ -248,7 +248,7 @@ path path::lexically_relative(const path& base) const {
auto PP = PathParser::CreateBegin(__pn_);
auto PPBase = PathParser::CreateBegin(base.__pn_);
auto CheckIterMismatchAtBase = [&]() {
- return PP.State != PPBase.State && (PP.inRootPath() || PPBase.inRootPath());
+ return PP.State_ != PPBase.State_ && (PP.inRootPath() || PPBase.inRootPath());
};
if (PP.inRootName() && PPBase.inRootName()) {
if (*PP != *PPBase)
@@ -267,7 +267,7 @@ path path::lexically_relative(const path& base) const {
// Find the first mismatching element
auto PP = PathParser::CreateBegin(__pn_);
auto PPBase = PathParser::CreateBegin(base.__pn_);
- while (PP && PPBase && PP.State == PPBase.State && *PP == *PPBase) {
+ while (PP && PPBase && PP.State_ == PPBase.State_ && *PP == *PPBase) {
++PP;
++PPBase;
}
@@ -380,7 +380,7 @@ path::iterator path::begin() const {
auto PP = PathParser::CreateBegin(__pn_);
iterator it;
it.__path_ptr_ = this;
- it.__state_ = static_cast<path::iterator::_ParserState>(PP.State);
+ it.__state_ = static_cast<path::iterator::_ParserState>(PP.State_);
it.__entry_ = PP.RawEntry;
it.__stashed_elem_.__assign_view(*PP);
return it;
@@ -396,7 +396,7 @@ path::iterator path::end() const {
path::iterator& path::iterator::__increment() {
PathParser PP(__path_ptr_->native(), __entry_, __state_);
++PP;
- __state_ = static_cast<_ParserState>(PP.State);
+ __state_ = static_cast<_ParserState>(PP.State_);
__entry_ = PP.RawEntry;
__stashed_elem_.__assign_view(*PP);
return *this;
@@ -405,7 +405,7 @@ path::iterator& path::iterator::__increment() {
path::iterator& path::iterator::__decrement() {
PathParser PP(__path_ptr_->native(), __entry_, __state_);
--PP;
- __state_ = static_cast<_ParserState>(PP.State);
+ __state_ = static_cast<_ParserState>(PP.State_);
__entry_ = PP.RawEntry;
__stashed_elem_.__assign_view(*PP);
return *this;
diff --git a/libcxx/src/filesystem/path_parser.h b/libcxx/src/filesystem/path_parser.h
index 28a8f24..0662369 100644
--- a/libcxx/src/filesystem/path_parser.h
+++ b/libcxx/src/filesystem/path_parser.h
@@ -50,14 +50,14 @@ struct PathParser {
const string_view_t Path;
string_view_t RawEntry;
- ParserState State;
+ ParserState State_;
private:
- PathParser(string_view_t P, ParserState State) noexcept : Path(P), State(State) {}
+ PathParser(string_view_t P, ParserState State) noexcept : Path(P), State_(State) {}
public:
PathParser(string_view_t P, string_view_t E, unsigned char S)
- : Path(P), RawEntry(E), State(static_cast<ParserState>(S)) {
+ : Path(P), RawEntry(E), State_(static_cast<ParserState>(S)) {
// S cannot be '0' or PS_BeforeBegin.
}
@@ -84,7 +84,7 @@ public:
if (Start == End)
return makeState(PS_AtEnd);
- switch (State) {
+ switch (State_) {
case PS_BeforeBegin: {
PosPtr TkEnd = consumeRootName(Start, End);
if (TkEnd)
@@ -125,7 +125,7 @@ public:
if (RStart == REnd) // we're decrementing the begin
return makeState(PS_BeforeBegin);
- switch (State) {
+ switch (State_) {
case PS_AtEnd: {
// Try to consume a trailing separator or root directory first.
if (PosPtr SepEnd = consumeAllSeparators(RStart, REnd)) {
@@ -169,7 +169,7 @@ public:
/// \brief Return a view with the "preferred representation" of the current
/// element. For example trailing separators are represented as a '.'
string_view_t operator*() const noexcept {
- switch (State) {
+ switch (State_) {
case PS_BeforeBegin:
case PS_AtEnd:
return PATHSTR("");
@@ -187,7 +187,7 @@ public:
__libcpp_unreachable();
}
- explicit operator bool() const noexcept { return State != PS_BeforeBegin && State != PS_AtEnd; }
+ explicit operator bool() const noexcept { return State_ != PS_BeforeBegin && State_ != PS_AtEnd; }
PathParser& operator++() noexcept {
increment();
@@ -199,21 +199,21 @@ public:
return *this;
}
- bool atEnd() const noexcept { return State == PS_AtEnd; }
+ bool atEnd() const noexcept { return State_ == PS_AtEnd; }
- bool inRootDir() const noexcept { return State == PS_InRootDir; }
+ bool inRootDir() const noexcept { return State_ == PS_InRootDir; }
- bool inRootName() const noexcept { return State == PS_InRootName; }
+ bool inRootName() const noexcept { return State_ == PS_InRootName; }
bool inRootPath() const noexcept { return inRootName() || inRootDir(); }
private:
void makeState(ParserState NewState, PosPtr Start, PosPtr End) noexcept {
- State = NewState;
+ State_ = NewState;
RawEntry = string_view_t(Start, End - Start);
}
void makeState(ParserState NewState) noexcept {
- State = NewState;
+ State_ = NewState;
RawEntry = {};
}
@@ -224,7 +224,7 @@ private:
/// \brief Return a pointer to the first character after the currently
/// lexed element.
PosPtr getNextTokenStartPos() const noexcept {
- switch (State) {
+ switch (State_) {
case PS_BeforeBegin:
return Path.data();
case PS_InRootName:
@@ -241,7 +241,7 @@ private:
/// \brief Return a pointer to the first character in the currently lexed
/// element.
PosPtr getCurrentTokenStartPos() const noexcept {
- switch (State) {
+ switch (State_) {
case PS_BeforeBegin:
case PS_InRootName:
return &Path.front();
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index c5ab6de..4efdc63 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -557,9 +557,9 @@ locale::locale(const locale& other, const locale& one, category c)
string locale::name() const { return __locale_->name(); }
-void locale::__install_ctor(const locale& other, facet* f, long id) {
+void locale::__install_ctor(const locale& other, facet* f, long facet_id) {
if (f)
- __locale_ = new __imp(*other.__locale_, f, id);
+ __locale_ = new __imp(*other.__locale_, f, facet_id);
else
__locale_ = other.__locale_;
__locale_->acquire();