@@ -108,7 +108,7 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &s, const IR &ir) {
108
108
<< " object " << objectName << " {\n " ;
109
109
110
110
for (const auto &typeDef : ir.typeDefs ) {
111
- if (ir.isOutputted (typeDef)) {
111
+ if (ir.shouldOutput (typeDef)) {
112
112
s << *typeDef;
113
113
}
114
114
}
@@ -145,7 +145,7 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &s, const IR &ir) {
145
145
146
146
std::string sep = " " ;
147
147
for (const auto &e : ir.enums ) {
148
- if (ir.isOutputted (e)) {
148
+ if (ir.shouldOutput (e)) {
149
149
s << sep << *e;
150
150
sep = " \n " ;
151
151
}
@@ -158,13 +158,13 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &s, const IR &ir) {
158
158
s << " object " << ir.libName << " Helpers {\n " ;
159
159
160
160
for (const auto &st : ir.structs ) {
161
- if (ir.isOutputted (st) && st->hasHelperMethods ()) {
161
+ if (ir.shouldOutput (st) && st->hasHelperMethods ()) {
162
162
s << " \n " << st->generateHelperClass ();
163
163
}
164
164
}
165
165
166
166
for (const auto &u : ir.unions ) {
167
- if (ir.isOutputted (u)) {
167
+ if (ir.shouldOutput (u)) {
168
168
s << " \n " << u->generateHelperClass ();
169
169
}
170
170
}
@@ -179,7 +179,6 @@ void IR::generate(const std::string &excludePrefix) {
179
179
if (!generated) {
180
180
setScalaNames ();
181
181
filterDeclarations (excludePrefix);
182
- // removeUnusedExternalTypedefs();
183
182
generated = true ;
184
183
}
185
184
}
@@ -191,7 +190,7 @@ bool IR::hasHelperMethods() const {
191
190
}
192
191
193
192
for (const auto &s : structs) {
194
- if (isOutputted (s) && s->hasHelperMethods ()) {
193
+ if (shouldOutput (s) && s->hasHelperMethods ()) {
195
194
return true ;
196
195
}
197
196
}
@@ -269,7 +268,7 @@ bool IR::isTypeUsed(const std::shared_ptr<Type> &type,
269
268
* references this type */
270
269
for (const auto &typeDef : typeDefs) {
271
270
if (typeDef->usesType (type, false )) {
272
- if (isOutputted (typeDef)) {
271
+ if (shouldOutput (typeDef)) {
273
272
return true ;
274
273
}
275
274
}
@@ -278,7 +277,7 @@ bool IR::isTypeUsed(const std::shared_ptr<Type> &type,
278
277
/* stopOnTypeDefs parameter is true because because typedefs were
279
278
* checked */
280
279
if (s->usesType (type, true )) {
281
- if (isOutputted (s)) {
280
+ if (shouldOutput (s)) {
282
281
return true ;
283
282
}
284
283
}
@@ -287,7 +286,7 @@ bool IR::isTypeUsed(const std::shared_ptr<Type> &type,
287
286
/* stopOnTypeDefs parameter is true because because typedefs were
288
287
* checked */
289
288
if (u->usesType (type, true )) {
290
- if (isOutputted (u)) {
289
+ if (shouldOutput (u)) {
291
290
return true ;
292
291
}
293
292
}
@@ -429,14 +428,14 @@ template <typename T>
429
428
bool IR::hasOutputtedDeclaration (
430
429
const std::vector<std::shared_ptr<T>> &declarations) const {
431
430
for (const auto &declaration : declarations) {
432
- if (isOutputted (declaration)) {
431
+ if (shouldOutput (declaration)) {
433
432
return true ;
434
433
}
435
434
}
436
435
return false ;
437
436
}
438
437
439
438
template <typename T>
440
- bool IR::isOutputted (const std::shared_ptr<T> &type) const {
439
+ bool IR::shouldOutput (const std::shared_ptr<T> &type) const {
441
440
return inMainFile (*type) || isTypeUsed (type, true );
442
441
}
0 commit comments