Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 15f2908

Browse files
authored
[Cleanup] Remove Lock APIs (#217)
1 parent 05ad3df commit 15f2908

22 files changed

+4
-282
lines changed

buildcc/lib/target/include/target/api/target_getter.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ template <typename T> class TargetGetter {
3838
// Target State
3939
const TargetState &GetState() const;
4040
bool IsBuilt() const;
41-
bool IsLocked() const;
4241

4342
// Target Config
4443
const TargetConfig &GetConfig() const;

buildcc/lib/target/include/target/target_info.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ class TargetInfo : public internal::SourceApi<TargetInfo>,
8686
TargetEnv env_;
8787

8888
//
89-
FunctionLock lock_;
9089
UserTargetSchema user_;
9190

9291
private:

buildcc/lib/target/src/api/deps_api.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@ template <typename T>
2424
void DepsApi<T>::AddCompileDependencyAbsolute(const fs::path &absolute_path) {
2525
T &t = static_cast<T &>(*this);
2626

27-
t.lock_.ExpectsUnlock(__FUNCTION__);
2827
t.user_.compile_dependencies.insert(absolute_path);
2928
}
3029
template <typename T>
3130
void DepsApi<T>::AddLinkDependencyAbsolute(const fs::path &absolute_path) {
3231
T &t = static_cast<T &>(*this);
3332

34-
t.lock_.ExpectsUnlock(__FUNCTION__);
3533
t.user_.link_dependencies.insert(absolute_path);
3634
}
3735

buildcc/lib/target/src/api/flag_api.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,55 +24,47 @@ template <typename T>
2424
void FlagApi<T>::AddPreprocessorFlag(const std::string &flag) {
2525
T &t = static_cast<T &>(*this);
2626

27-
t.lock_.ExpectsUnlock(__FUNCTION__);
2827
t.user_.preprocessor_flags.insert(flag);
2928
}
3029
template <typename T>
3130
void FlagApi<T>::AddCommonCompileFlag(const std::string &flag) {
3231
T &t = static_cast<T &>(*this);
3332

34-
t.lock_.ExpectsUnlock(__FUNCTION__);
3533
t.user_.common_compile_flags.insert(flag);
3634
}
3735
template <typename T>
3836
void FlagApi<T>::AddPchCompileFlag(const std::string &flag) {
3937
T &t = static_cast<T &>(*this);
4038

41-
t.lock_.ExpectsUnlock(__FUNCTION__);
4239
t.user_.pch_compile_flags.insert(flag);
4340
}
4441
template <typename T>
4542
void FlagApi<T>::AddPchObjectFlag(const std::string &flag) {
4643
T &t = static_cast<T &>(*this);
4744

48-
t.lock_.ExpectsUnlock(__FUNCTION__);
4945
t.user_.pch_object_flags.insert(flag);
5046
}
5147
template <typename T>
5248
void FlagApi<T>::AddAsmCompileFlag(const std::string &flag) {
5349
T &t = static_cast<T &>(*this);
5450

55-
t.lock_.ExpectsUnlock(__FUNCTION__);
5651
t.user_.asm_compile_flags.insert(flag);
5752
}
5853
template <typename T>
5954
void FlagApi<T>::AddCCompileFlag(const std::string &flag) {
6055
T &t = static_cast<T &>(*this);
6156

62-
t.lock_.ExpectsUnlock(__FUNCTION__);
6357
t.user_.c_compile_flags.insert(flag);
6458
}
6559
template <typename T>
6660
void FlagApi<T>::AddCppCompileFlag(const std::string &flag) {
6761
T &t = static_cast<T &>(*this);
6862

69-
t.lock_.ExpectsUnlock(__FUNCTION__);
7063
t.user_.cpp_compile_flags.insert(flag);
7164
}
7265
template <typename T> void FlagApi<T>::AddLinkFlag(const std::string &flag) {
7366
T &t = static_cast<T &>(*this);
7467

75-
t.lock_.ExpectsUnlock(__FUNCTION__);
7668
t.user_.link_flags.insert(flag);
7769
}
7870

buildcc/lib/target/src/api/include_api.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ template <typename T>
2424
void IncludeApi<T>::AddHeaderAbsolute(const fs::path &absolute_filepath) {
2525
T &t = static_cast<T &>(*this);
2626

27-
t.lock_.ExpectsUnlock(__FUNCTION__);
2827
t.toolchain_.GetConfig().ExpectsValidHeader(absolute_filepath);
2928
t.user_.headers.insert(absolute_filepath);
3029
}
@@ -74,7 +73,6 @@ void IncludeApi<T>::AddIncludeDirAbsolute(const fs::path &absolute_include_dir,
7473
bool glob_headers) {
7574
T &t = static_cast<T &>(*this);
7675

77-
t.lock_.ExpectsUnlock(__FUNCTION__);
7876
t.user_.include_dirs.insert(absolute_include_dir);
7977

8078
if (glob_headers) {

buildcc/lib/target/src/api/lib_api.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ template <typename T>
2525
void LibApi<T>::AddLibDirAbsolute(const fs::path &absolute_lib_dir) {
2626
T &t = static_cast<T &>(*this);
2727

28-
t.lock_.ExpectsUnlock(__FUNCTION__);
2928
t.user_.lib_dirs.insert(absolute_lib_dir);
3029
}
3130

@@ -40,14 +39,12 @@ void LibApi<T>::AddLibDir(const fs::path &relative_lib_dir) {
4039
template <typename T> void LibApi<T>::AddLibDep(const BaseTarget &lib_dep) {
4140
T &t = static_cast<T &>(*this);
4241

43-
t.lock_.ExpectsUnlock(__FUNCTION__);
4442
t.user_.libs.push_back(lib_dep.GetTargetPath());
4543
}
4644

4745
template <typename T> void LibApi<T>::AddLibDep(const std::string &lib_dep) {
4846
T &t = static_cast<T &>(*this);
4947

50-
t.lock_.ExpectsUnlock(__FUNCTION__);
5148
t.user_.external_libs.push_back(lib_dep);
5249
}
5350

buildcc/lib/target/src/api/pch_api.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ template <typename T>
2424
void PchApi<T>::AddPchAbsolute(const fs::path &absolute_filepath) {
2525
T &t = static_cast<T &>(*this);
2626

27-
t.lock_.ExpectsUnlock(__FUNCTION__);
2827
t.toolchain_.GetConfig().ExpectsValidHeader(absolute_filepath);
2928

3029
const fs::path absolute_pch = fs::path(absolute_filepath).make_preferred();

buildcc/lib/target/src/api/source_api.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ template <typename T>
2424
void SourceApi<T>::AddSourceAbsolute(const fs::path &absolute_source) {
2525
T &t = static_cast<T &>(*this);
2626

27-
t.lock_.ExpectsUnlock(__FUNCTION__);
2827
t.toolchain_.GetConfig().ExpectsValidSource(absolute_source);
2928
t.user_.sources.emplace(fs::path(absolute_source).make_preferred());
3029
}

buildcc/lib/target/src/api/sync_api.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ template <typename TargetType>
4141
void SyncApi<T>::SpecializedCopy(TargetType target,
4242
std::initializer_list<SyncOption> options) {
4343
T &t = static_cast<T &>(*this);
44-
t.lock_.ExpectsUnlock(__FUNCTION__);
4544
for (const SyncOption o : options) {
4645
switch (o) {
4746
case SyncOption::PreprocessorFlags:
@@ -122,7 +121,6 @@ template <typename TargetType>
122121
void SyncApi<T>::SpecializedInsert(TargetType target,
123122
std::initializer_list<SyncOption> options) {
124123
T &t = static_cast<T &>(*this);
125-
t.lock_.ExpectsUnlock(__FUNCTION__);
126124
for (const SyncOption o : options) {
127125
switch (o) {
128126
case SyncOption::PreprocessorFlags:

buildcc/lib/target/src/api/target_getter.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ template <typename T> const TargetConfig &TargetGetter<T>::GetConfig() const {
4040
return t.config_;
4141
}
4242

43-
template <typename T> bool TargetGetter<T>::IsLocked() const {
44-
const T &t = static_cast<const T &>(*this);
45-
46-
return t.lock_.IsLocked();
47-
}
48-
4943
template <typename T> const fs::path &TargetGetter<T>::GetBinaryPath() const {
5044
const T &t = static_cast<const T &>(*this);
5145

@@ -95,22 +89,19 @@ const std::string &
9589
TargetGetter<T>::GetCompileCommand(const fs::path &source) const {
9690
const T &t = static_cast<const T &>(*this);
9791

98-
t.lock_.ExpectsLock(__FUNCTION__);
9992
return t.compile_object_.GetObjectData(source).command;
10093
}
10194

10295
template <typename T>
10396
const std::string &TargetGetter<T>::GetLinkCommand() const {
10497
const T &t = static_cast<const T &>(*this);
10598

106-
t.lock_.ExpectsLock(__FUNCTION__);
10799
return t.link_target_.GetCommand();
108100
}
109101

110102
template <typename T> tf::Taskflow &TargetGetter<T>::GetTaskflow() {
111103
T &t = static_cast<T &>(*this);
112104

113-
t.lock_.ExpectsLock(__FUNCTION__);
114105
return t.tf_;
115106
}
116107

0 commit comments

Comments
 (0)