Skip to content

Commit 331dabe

Browse files
committed
Remove unused code
1 parent a0a616b commit 331dabe

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

bindgen/ir/IR.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,15 @@ std::shared_ptr<TypeDef> IR::addTypeDef(std::string name,
2121
return typeDefs.back();
2222
}
2323

24-
std::shared_ptr<Type> IR::addEnum(std::string name, const std::string &type,
25-
std::vector<Enumerator> enumerators,
26-
std::shared_ptr<Location> location) {
24+
void IR::addEnum(std::string name, const std::string &type,
25+
std::vector<Enumerator> enumerators,
26+
std::shared_ptr<Location> location) {
2727
std::shared_ptr<Enum> e =
2828
std::make_shared<Enum>(std::move(name), type, std::move(enumerators));
2929
enums.push_back(e);
3030
if (!e->isAnonymous()) {
3131
typeDefs.push_back(e->generateTypeDef(std::move(location)));
32-
return typeDefs.back();
3332
}
34-
return nullptr;
3533
}
3634

3735
void IR::addStruct(std::string name, std::vector<Field *> fields,

bindgen/ir/IR.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class IR {
2929
/**
3030
* @return type alias for the enum
3131
*/
32-
std::shared_ptr<Type> addEnum(std::string name, const std::string &type,
33-
std::vector<Enumerator> enumerators,
34-
std::shared_ptr<Location> location);
32+
void addEnum(std::string name, const std::string &type,
33+
std::vector<Enumerator> enumerators,
34+
std::shared_ptr<Location> location);
3535

3636
void addStruct(std::string name, std::vector<Field *> fields,
3737
uint64_t typeSize, std::shared_ptr<Location> location);

bindgen/visitor/TreeVisitor.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#include "TreeVisitor.h"
22

3-
std::set<std::string> locations;
4-
53
bool TreeVisitor::VisitFunctionDecl(clang::FunctionDecl *func) {
64
if (!astContext->getSourceManager().isInMainFile(func->getLocation())) {
75
/* include functions only from the original header */
@@ -71,8 +69,7 @@ bool TreeVisitor::VisitEnumDecl(clang::EnumDecl *enumdecl) {
7169
std::string scalaType = typeTranslator.getTypeFromTypeMap(
7270
enumdecl->getIntegerType().getUnqualifiedType().getAsString());
7371

74-
std::shared_ptr<Type> alias = ir.addEnum(
75-
name, scalaType, std::move(enumerators), getLocation(enumdecl));
72+
ir.addEnum(name, scalaType, std::move(enumerators), getLocation(enumdecl));
7673

7774
return true;
7875
}

0 commit comments

Comments
 (0)