Skip to content

Commit 40a4d0e

Browse files
committed
Do not save type translations
1 parent 15a89db commit 40a4d0e

File tree

3 files changed

+0
-17
lines changed

3 files changed

+0
-17
lines changed

bindgen/TypeTranslator.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ TypeTranslator::TypeTranslator(clang::ASTContext *ctx_) : ctx(ctx_), typeMap() {
2727
typeMap["char32_t"] = "native.CChar32";
2828
typeMap["float"] = "native.CFloat";
2929
typeMap["double"] = "native.CDouble";
30-
typeMap["void*"] = "native.Ptr[Byte]";
3130
}
3231

3332
std::string
@@ -172,7 +171,3 @@ std::string TypeTranslator::Translate(const clang::QualType &qtpe,
172171
}
173172
}
174173
}
175-
176-
void TypeTranslator::AddTranslation(std::string from, std::string to) {
177-
typeMap[from] = to;
178-
}

bindgen/TypeTranslator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class TypeTranslator {
1111

1212
public:
1313
explicit TypeTranslator(clang::ASTContext *ctx);
14-
void AddTranslation(std::string from, std::string to);
1514

1615
/**
1716
* @brief Translate the qualified type from c to a scala type

bindgen/visitor/TreeVisitor.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ bool TreeVisitor::VisitEnumDecl(clang::EnumDecl *enumdecl) {
5858
name = enumdecl->getTypedefNameForAnonDecl()->getNameAsString();
5959
}
6060

61-
if (!name.empty()) {
62-
// Replace "enum x" with enum_x in scala
63-
typeTranslator.AddTranslation("enum " + name, "enum_" + name);
64-
}
65-
6661
std::vector<Enumerator> enumerators;
6762

6863
for (const clang::EnumConstantDecl *en : enumdecl->enumerators()) {
@@ -100,9 +95,6 @@ bool TreeVisitor::VisitRecordDecl(clang::RecordDecl *record) {
10095
}
10196

10297
void TreeVisitor::handleUnion(clang::RecordDecl *record, std::string name) {
103-
// Replace "union x" with union_x in scala
104-
typeTranslator.AddTranslation("union " + name, "union_" + name);
105-
10698
uint64_t maxSize = 0;
10799

108100
std::vector<Field> fields;
@@ -130,9 +122,6 @@ void TreeVisitor::handleStruct(clang::RecordDecl *record, std::string name) {
130122
llvm::errs().flush();
131123
}
132124

133-
// Replace "struct x" with struct_x in scala
134-
typeTranslator.AddTranslation("struct " + name, newName);
135-
136125
int fieldCnt = 0;
137126
std::vector<Field> fields;
138127

0 commit comments

Comments
 (0)