Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1798889

Browse files
authored
Refactoring getter apis (#178)
1 parentf54bbf0 commit1798889

24 files changed

+162
-169
lines changed

‎buildcc/lib/target/include/target/api/target_info_getter.h‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@ template <typename T> class TargetInfoGetter {
4444
const TargetConfig &GetConfig()const;
4545

4646
// Target Storer
47-
constinternal::fs_unordered_set &GetCurrentSourceFiles()const;
48-
constinternal::fs_unordered_set &GetCurrentHeaderFiles()const;
49-
constinternal::fs_unordered_set &GetCurrentPchFiles()const;
50-
const std::vector<fs::path> &GetTargetLibDeps()const;
51-
const std::vector<std::string> &GetCurrentExternalLibDeps()const;
52-
constinternal::fs_unordered_set &GetCurrentIncludeDirs()const;
53-
constinternal::fs_unordered_set &GetCurrentLibDirs()const;
54-
const std::unordered_set<std::string> &GetCurrentPreprocessorFlags()const;
55-
const std::unordered_set<std::string> &GetCurrentCommonCompileFlags()const;
56-
const std::unordered_set<std::string> &GetCurrentPchCompileFlags()const;
57-
const std::unordered_set<std::string> &GetCurrentPchObjectFlags()const;
58-
const std::unordered_set<std::string> &GetCurrentAsmCompileFlags()const;
59-
const std::unordered_set<std::string> &GetCurrentCCompileFlags()const;
60-
const std::unordered_set<std::string> &GetCurrentCppCompileFlags()const;
61-
const std::unordered_set<std::string> &GetCurrentLinkFlags()const;
62-
constinternal::fs_unordered_set &GetCurrentCompileDependencies()const;
63-
constinternal::fs_unordered_set &GetCurrentLinkDependencies()const;
47+
const fs_unordered_set &GetSourceFiles()const;
48+
const fs_unordered_set &GetHeaderFiles()const;
49+
const fs_unordered_set &GetPchFiles()const;
50+
const std::vector<fs::path> &GetLibDeps()const;
51+
const std::vector<std::string> &GetExternalLibDeps()const;
52+
const fs_unordered_set &GetIncludeDirs()const;
53+
const fs_unordered_set &GetLibDirs()const;
54+
const std::unordered_set<std::string> &GetPreprocessorFlags()const;
55+
const std::unordered_set<std::string> &GetCommonCompileFlags()const;
56+
const std::unordered_set<std::string> &GetPchCompileFlags()const;
57+
const std::unordered_set<std::string> &GetPchObjectFlags()const;
58+
const std::unordered_set<std::string> &GetAsmCompileFlags()const;
59+
const std::unordered_set<std::string> &GetCCompileFlags()const;
60+
const std::unordered_set<std::string> &GetCppCompileFlags()const;
61+
const std::unordered_set<std::string> &GetLinkFlags()const;
62+
const fs_unordered_set &GetCompileDependencies()const;
63+
const fs_unordered_set &GetLinkDependencies()const;
6464
};
6565

6666
}// namespace buildcc::base

‎buildcc/lib/target/include/target/base/generator_loader.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class GeneratorLoader : public LoaderInterface {
4545
return loaded_input_files_;
4646
}
4747

48-
constinternal::fs_unordered_set &GetLoadedOutputFiles()constnoexcept {
48+
const fs_unordered_set &GetLoadedOutputFiles()constnoexcept {
4949
return loaded_output_files_;
5050
}
5151

@@ -58,7 +58,7 @@ class GeneratorLoader : public LoaderInterface {
5858
fs::path path_;
5959

6060
internal::path_unordered_set loaded_input_files_;
61-
internal::fs_unordered_set loaded_output_files_;
61+
fs_unordered_set loaded_output_files_;
6262
std::vector<std::string> loaded_commands_;
6363
};
6464

‎buildcc/lib/target/include/target/base/target_storer.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ struct TargetStorer {
3232
std::vector<fs::path> current_user_lib_deps;
3333
internal::path_unordered_set current_internal_lib_deps;
3434

35-
internal::fs_unordered_set current_include_dirs;
36-
internal::fs_unordered_set current_lib_dirs;
35+
fs_unordered_set current_include_dirs;
36+
fs_unordered_set current_lib_dirs;
3737

3838
// NOTE, Order matters (user takes care of the order here)
3939
std::vector<std::string> current_user_external_lib_deps;

‎buildcc/lib/target/include/target/common/path.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ inline std::string path_as_string(const fs::path &p) {
194194
returninternal::Path::CreateNewPath(p).GetPathAsString();
195195
}
196196

197+
typedef internal::fs_unordered_set fs_unordered_set;
198+
197199
}// namespace buildcc
198200

199201
// FMT specialization

‎buildcc/lib/target/include/target/common/util.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ template <typename T> std::string aggregate(const T &list) {
2929
returnfmt::format("{}",fmt::join(list,""));
3030
}
3131

32-
std::stringaggregate(const buildcc::internal::fs_unordered_set &paths);
32+
std::stringaggregate(const buildcc::fs_unordered_set &paths);
3333

3434
std::stringaggregate_with_prefix(const std::string &prefix,
3535
const fs_unordered_set &dirs);

‎buildcc/lib/target/include/target/friend/compile_object.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CompileObject {
5454
GetObjectDataMap()const {
5555
return object_files_;
5656
}
57-
internal::fs_unordered_setGetCompiledSources()const;
57+
fs_unordered_setGetCompiledSources()const;
5858
tf::Task &GetTask() {return compile_task_; }
5959

6060
private:

‎buildcc/lib/target/include/target/generator.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class Generator : public BuilderInterface {
132132

133133
// Serialization
134134
internal::RelationalPathFiles current_input_files_;
135-
internal::fs_unordered_set current_output_files_;
135+
fs_unordered_set current_output_files_;
136136
std::vector<std::string> current_commands_;
137137
bool parallel_{false};
138138

‎buildcc/lib/target/include/target/private/schema_util.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ create_fbs_vector_string(flatbuffers::FlatBufferBuilder &builder,
113113

114114
inline std::vector<flatbuffers::Offset<flatbuffers::String>>
115115
create_fbs_vector_string(flatbuffers::FlatBufferBuilder &builder,
116-
const buildcc::internal::fs_unordered_set &fslist) {
116+
const buildcc::fs_unordered_set &fslist) {
117117
std::vector<flatbuffers::Offset<flatbuffers::String>> strs;
118118
std::transform(
119119
fslist.begin(), fslist.end(),std::back_inserter(strs),

‎buildcc/lib/target/include/target/target.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ class Target : public BuilderInterface,
105105
// Recompilation checks
106106
voidRecheckPaths(const internal::path_unordered_set &previous_path,
107107
const internal::path_unordered_set &current_path);
108-
voidRecheckDirs(constinternal::fs_unordered_set &previous_dirs,
109-
constinternal::fs_unordered_set &current_dirs);
108+
voidRecheckDirs(const fs_unordered_set &previous_dirs,
109+
const fs_unordered_set &current_dirs);
110110
voidRecheckFlags(const std::unordered_set<std::string> &previous_flags,
111111
const std::unordered_set<std::string> &current_flags);
112112
voidRecheckExternalLib(

‎buildcc/lib/target/src/api/target_info_getter.cpp‎

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,135 +64,128 @@ const TargetConfig &TargetInfoGetter<T>::GetConfig() const {
6464

6565
// Target Storer
6666
template<typename T>
67-
const internal::fs_unordered_set &
68-
TargetInfoGetter<T>::GetCurrentSourceFiles()const {
67+
const fs_unordered_set &TargetInfoGetter<T>::GetSourceFiles()const {
6968
const T &t =static_cast<const T &>(*this);
7069

7170
return t.storer_.current_source_files.user;
7271
}
7372

7473
template<typename T>
75-
const internal::fs_unordered_set &
76-
TargetInfoGetter<T>::GetCurrentHeaderFiles()const {
74+
const fs_unordered_set &TargetInfoGetter<T>::GetHeaderFiles()const {
7775
const T &t =static_cast<const T &>(*this);
7876

7977
return t.storer_.current_header_files.user;
8078
}
8179

8280
template<typename T>
83-
const internal::fs_unordered_set &
84-
TargetInfoGetter<T>::GetCurrentPchFiles()const {
81+
const fs_unordered_set &TargetInfoGetter<T>::GetPchFiles()const {
8582
const T &t =static_cast<const T &>(*this);
8683

8784
return t.storer_.current_pch_files.user;
8885
}
8986

9087
template<typename T>
91-
const std::vector<fs::path> &TargetInfoGetter<T>::GetTargetLibDeps()const {
88+
const std::vector<fs::path> &TargetInfoGetter<T>::GetLibDeps()const {
9289
const T &t =static_cast<const T &>(*this);
9390

9491
return t.storer_.current_user_lib_deps;
9592
}
9693

9794
template<typename T>
9895
const std::vector<std::string> &
99-
TargetInfoGetter<T>::GetCurrentExternalLibDeps()const {
96+
TargetInfoGetter<T>::GetExternalLibDeps()const {
10097
const T &t =static_cast<const T &>(*this);
10198

10299
return t.storer_.current_user_external_lib_deps;
103100
}
104101

105102
template<typename T>
106-
const internal::fs_unordered_set &
107-
TargetInfoGetter<T>::GetCurrentIncludeDirs()const {
103+
const fs_unordered_set &TargetInfoGetter<T>::GetIncludeDirs()const {
108104
const T &t =static_cast<const T &>(*this);
109105

110106
return t.storer_.current_include_dirs;
111107
}
112108

113109
template<typename T>
114-
const internal::fs_unordered_set &
115-
TargetInfoGetter<T>::GetCurrentLibDirs()const {
110+
const fs_unordered_set &TargetInfoGetter<T>::GetLibDirs()const {
116111
const T &t =static_cast<const T &>(*this);
117112

118113
return t.storer_.current_lib_dirs;
119114
}
120115

121116
template<typename T>
122117
const std::unordered_set<std::string> &
123-
TargetInfoGetter<T>::GetCurrentPreprocessorFlags()const {
118+
TargetInfoGetter<T>::GetPreprocessorFlags()const {
124119
const T &t =static_cast<const T &>(*this);
125120

126121
return t.storer_.current_preprocessor_flags;
127122
}
128123

129124
template<typename T>
130125
const std::unordered_set<std::string> &
131-
TargetInfoGetter<T>::GetCurrentCommonCompileFlags()const {
126+
TargetInfoGetter<T>::GetCommonCompileFlags()const {
132127
const T &t =static_cast<const T &>(*this);
133128

134129
return t.storer_.current_common_compile_flags;
135130
}
136131

137132
template<typename T>
138133
const std::unordered_set<std::string> &
139-
TargetInfoGetter<T>::GetCurrentPchCompileFlags()const {
134+
TargetInfoGetter<T>::GetPchCompileFlags()const {
140135
const T &t =static_cast<const T &>(*this);
141136

142137
return t.storer_.current_pch_compile_flags;
143138
}
144139

145140
template<typename T>
146141
const std::unordered_set<std::string> &
147-
TargetInfoGetter<T>::GetCurrentPchObjectFlags()const {
142+
TargetInfoGetter<T>::GetPchObjectFlags()const {
148143
const T &t =static_cast<const T &>(*this);
149144

150145
return t.storer_.current_pch_object_flags;
151146
}
152147

153148
template<typename T>
154149
const std::unordered_set<std::string> &
155-
TargetInfoGetter<T>::GetCurrentAsmCompileFlags()const {
150+
TargetInfoGetter<T>::GetAsmCompileFlags()const {
156151
const T &t =static_cast<const T &>(*this);
157152

158153
return t.storer_.current_asm_compile_flags;
159154
}
160155

161156
template<typename T>
162157
const std::unordered_set<std::string> &
163-
TargetInfoGetter<T>::GetCurrentCCompileFlags()const {
158+
TargetInfoGetter<T>::GetCCompileFlags()const {
164159
const T &t =static_cast<const T &>(*this);
165160

166161
return t.storer_.current_c_compile_flags;
167162
}
168163

169164
template<typename T>
170165
const std::unordered_set<std::string> &
171-
TargetInfoGetter<T>::GetCurrentCppCompileFlags()const {
166+
TargetInfoGetter<T>::GetCppCompileFlags()const {
172167
const T &t =static_cast<const T &>(*this);
173168

174169
return t.storer_.current_cpp_compile_flags;
175170
}
176171

177172
template<typename T>
178173
const std::unordered_set<std::string> &
179-
TargetInfoGetter<T>::GetCurrentLinkFlags()const {
174+
TargetInfoGetter<T>::GetLinkFlags()const {
180175
const T &t =static_cast<const T &>(*this);
181176

182177
return t.storer_.current_link_flags;
183178
}
184179

185180
template<typename T>
186-
const internal::fs_unordered_set &
187-
TargetInfoGetter<T>::GetCurrentCompileDependencies()const {
181+
const fs_unordered_set &TargetInfoGetter<T>::GetCompileDependencies()const {
188182
const T &t =static_cast<const T &>(*this);
189183

190184
return t.storer_.current_compile_dependencies.user;
191185
}
192186

193187
template<typename T>
194-
const internal::fs_unordered_set &
195-
TargetInfoGetter<T>::GetCurrentLinkDependencies()const {
188+
const fs_unordered_set &TargetInfoGetter<T>::GetLinkDependencies()const {
196189
const T &t =static_cast<const T &>(*this);
197190

198191
return t.storer_.current_link_dependencies.user;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp