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,
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
3735void 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 {
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);
Original file line number Diff line number Diff line change 11#include " TreeVisitor.h"
22
3- std::set<std::string> locations;
4-
53bool 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}
You can’t perform that action at this time.
0 commit comments