File tree Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -21,17 +21,15 @@ std::shared_ptr<TypeDef> IR::addTypeDef(std::string name,
21
21
return typeDefs.back ();
22
22
}
23
23
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) {
27
27
std::shared_ptr<Enum> e =
28
28
std::make_shared<Enum>(std::move (name), type, std::move (enumerators));
29
29
enums.push_back (e);
30
30
if (!e->isAnonymous ()) {
31
31
typeDefs.push_back (e->generateTypeDef (std::move (location)));
32
- return typeDefs.back ();
33
32
}
34
- return nullptr ;
35
33
}
36
34
37
35
void IR::addStruct (std::string name, std::vector<Field *> fields,
Original file line number Diff line number Diff line change @@ -29,9 +29,9 @@ class IR {
29
29
/* *
30
30
* @return type alias for the enum
31
31
*/
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);
35
35
36
36
void addStruct (std::string name, std::vector<Field *> fields,
37
37
uint64_t typeSize, std::shared_ptr<Location> location);
Original file line number Diff line number Diff line change 1
1
#include " TreeVisitor.h"
2
2
3
- std::set<std::string> locations;
4
-
5
3
bool TreeVisitor::VisitFunctionDecl (clang::FunctionDecl *func) {
6
4
if (!astContext->getSourceManager ().isInMainFile (func->getLocation ())) {
7
5
/* include functions only from the original header */
@@ -71,8 +69,7 @@ bool TreeVisitor::VisitEnumDecl(clang::EnumDecl *enumdecl) {
71
69
std::string scalaType = typeTranslator.getTypeFromTypeMap (
72
70
enumdecl->getIntegerType ().getUnqualifiedType ().getAsString ());
73
71
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));
76
73
77
74
return true ;
78
75
}
You can’t perform that action at this time.
0 commit comments