Skip to content

Commit

Permalink
Merge pull request souffle-lang#1635 from mmcgr/redundancy
Browse files Browse the repository at this point in the history
Remove TypeAttribute.cpp
  • Loading branch information
mmcgr authored Sep 14, 2020
2 parents 3396f3c + 6c14534 commit 33eea51
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 56 deletions.
1 change: 0 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ souffle_sources = \
GraphUtils.h \
LogStatement.h \
RelationTag.h \
TypeAttribute.cpp \
ast/Aggregator.h \
ast/AlgebraicDataType.h \
ast/Argument.h \
Expand Down
48 changes: 0 additions & 48 deletions src/TypeAttribute.cpp

This file was deleted.

20 changes: 13 additions & 7 deletions src/include/souffle/TypeAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#pragma once

#include "souffle/utility/MiscUtil.h"
#include <iostream>

namespace souffle {
Expand All @@ -34,12 +35,17 @@ enum class TypeAttribute {
};

// Printing of the TypeAttribute Enum.
// To be utilised in synthesizer.
std::ostream& operator<<(std::ostream& os, TypeAttribute T);

/**
* Check if type is numeric.
*/
bool isNumericType(TypeAttribute ramType);
inline std::ostream& operator<<(std::ostream& os, TypeAttribute T) {
switch (T) {
case TypeAttribute::Symbol: return os << "TypeAttribute::Symbol";
case TypeAttribute::Signed: return os << "TypeAttribute::Signed";
case TypeAttribute::Float: return os << "TypeAttribute::Float";
case TypeAttribute::Unsigned: return os << "TypeAttribute::Unsigned";
case TypeAttribute::Record: return os << "TypeAttribute::Record";
case TypeAttribute::ADT: return os << "TypeAttribute::ADT";
}

fatal("unhandled `TypeAttribute`");
}

} // end of namespace souffle

0 comments on commit 33eea51

Please sign in to comment.