@@ -108,7 +108,7 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &s, const IR &ir) {
108108 << " object " << objectName << " {\n " ;
109109
110110 for (const auto &typeDef : ir.typeDefs ) {
111- if (ir.isOutputted (typeDef)) {
111+ if (ir.shouldOutput (typeDef)) {
112112 s << *typeDef;
113113 }
114114 }
@@ -145,7 +145,7 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &s, const IR &ir) {
145145
146146 std::string sep = " " ;
147147 for (const auto &e : ir.enums ) {
148- if (ir.isOutputted (e)) {
148+ if (ir.shouldOutput (e)) {
149149 s << sep << *e;
150150 sep = " \n " ;
151151 }
@@ -158,13 +158,13 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &s, const IR &ir) {
158158 s << " object " << ir.libName << " Helpers {\n " ;
159159
160160 for (const auto &st : ir.structs ) {
161- if (ir.isOutputted (st) && st->hasHelperMethods ()) {
161+ if (ir.shouldOutput (st) && st->hasHelperMethods ()) {
162162 s << " \n " << st->generateHelperClass ();
163163 }
164164 }
165165
166166 for (const auto &u : ir.unions ) {
167- if (ir.isOutputted (u)) {
167+ if (ir.shouldOutput (u)) {
168168 s << " \n " << u->generateHelperClass ();
169169 }
170170 }
@@ -179,7 +179,6 @@ void IR::generate(const std::string &excludePrefix) {
179179 if (!generated) {
180180 setScalaNames ();
181181 filterDeclarations (excludePrefix);
182- // removeUnusedExternalTypedefs();
183182 generated = true ;
184183 }
185184}
@@ -191,7 +190,7 @@ bool IR::hasHelperMethods() const {
191190 }
192191
193192 for (const auto &s : structs) {
194- if (isOutputted (s) && s->hasHelperMethods ()) {
193+ if (shouldOutput (s) && s->hasHelperMethods ()) {
195194 return true ;
196195 }
197196 }
@@ -269,7 +268,7 @@ bool IR::isTypeUsed(const std::shared_ptr<Type> &type,
269268 * references this type */
270269 for (const auto &typeDef : typeDefs) {
271270 if (typeDef->usesType (type, false )) {
272- if (isOutputted (typeDef)) {
271+ if (shouldOutput (typeDef)) {
273272 return true ;
274273 }
275274 }
@@ -278,7 +277,7 @@ bool IR::isTypeUsed(const std::shared_ptr<Type> &type,
278277 /* stopOnTypeDefs parameter is true because because typedefs were
279278 * checked */
280279 if (s->usesType (type, true )) {
281- if (isOutputted (s)) {
280+ if (shouldOutput (s)) {
282281 return true ;
283282 }
284283 }
@@ -287,7 +286,7 @@ bool IR::isTypeUsed(const std::shared_ptr<Type> &type,
287286 /* stopOnTypeDefs parameter is true because because typedefs were
288287 * checked */
289288 if (u->usesType (type, true )) {
290- if (isOutputted (u)) {
289+ if (shouldOutput (u)) {
291290 return true ;
292291 }
293292 }
@@ -429,14 +428,14 @@ template <typename T>
429428bool IR::hasOutputtedDeclaration (
430429 const std::vector<std::shared_ptr<T>> &declarations) const {
431430 for (const auto &declaration : declarations) {
432- if (isOutputted (declaration)) {
431+ if (shouldOutput (declaration)) {
433432 return true ;
434433 }
435434 }
436435 return false ;
437436}
438437
439438template <typename T>
440- bool IR::isOutputted (const std::shared_ptr<T> &type) const {
439+ bool IR::shouldOutput (const std::shared_ptr<T> &type) const {
441440 return inMainFile (*type) || isTypeUsed (type, true );
442441}
0 commit comments