Commit 204b1da6 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Separate the CompilerType objects from the class definitions

Most code wants to have access to the basic types (INT, STR, etc)
but doesn't need to know anything about what methods they support.

Move the commonly-accessed parts of compvars.h into the always-included
core/types.h, and remove almost all of the includes of compvars.h
parent 68a74ef9
......@@ -21,6 +21,7 @@
#include "analysis/fpc.h"
#include "analysis/scoping_analysis.h"
#include "codegen/codegen.h"
#include "codegen/compvars.h"
#include "codegen/type_recording.h"
#include "core/ast.h"
#include "core/cfg.h"
......
......@@ -18,7 +18,6 @@
#include <unordered_map>
#include <vector>
#include "codegen/compvars.h"
#include "core/types.h"
namespace pyston {
......
......@@ -22,7 +22,6 @@
#include "Python.h"
#include "codegen/compvars.h"
#include "core/threading.h"
#include "core/types.h"
#include "runtime/objmodel.h"
......
......@@ -23,7 +23,6 @@
#include "Python.h"
#include "capi/types.h"
#include "codegen/compvars.h"
#include "core/threading.h"
#include "core/types.h"
#include "runtime/objmodel.h"
......
......@@ -28,10 +28,6 @@ class OpInfo;
class CompilerType;
class IREmitter;
extern ConcreteCompilerType* INT, *BOXED_INT, *LONG, *FLOAT, *BOXED_FLOAT, *VOID, *UNKNOWN, *BOOL, *STR, *NONE, *LIST,
*SLICE, *MODULE, *DICT, *BOOL, *BOXED_BOOL, *BOXED_TUPLE, *SET, *FROZENSET, *CLOSURE, *GENERATOR, *BOXED_COMPLEX;
extern CompilerType* UNDEF;
class CompilerType {
public:
virtual ~CompilerType() {}
......@@ -348,7 +344,6 @@ CompilerVariable* makeFunction(IREmitter& emitter, CLFunction*, CompilerVariable
ConcreteCompilerVariable* undefVariable();
CompilerVariable* makeTuple(const std::vector<CompilerVariable*>& elts);
ConcreteCompilerType* typeFromClass(BoxedClass*);
CompilerType* typeOfClassobj(BoxedClass*);
CompilerType* makeTupleType(const std::vector<CompilerType*>& elt_types);
CompilerType* makeFuncType(ConcreteCompilerType* rtn_type, const std::vector<ConcreteCompilerType*>& arg_types);
......
......@@ -35,7 +35,6 @@
#include "llvm/Transforms/Utils/Cloning.h"
#include "codegen/codegen.h"
#include "codegen/compvars.h"
#include "codegen/dis.h"
#include "codegen/memmgr.h"
#include "codegen/profiling/profiling.h"
......
......@@ -20,7 +20,6 @@
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IRBuilder.h"
#include "codegen/compvars.h"
#include "core/types.h"
namespace pyston {
......
......@@ -24,6 +24,7 @@
#include "llvm/IR/DebugInfo.h"
#include "codegen/codegen.h"
#include "codegen/compvars.h"
#include "codegen/irgen/hooks.h"
#include "codegen/llvm_interpreter.h"
......
......@@ -92,8 +92,14 @@ enum EffortLevel {
};
}
class CompilerType;
template <class V> class ValuedCompilerType;
typedef ValuedCompilerType<llvm::Value*> ConcreteCompilerType;
ConcreteCompilerType* typeFromClass(BoxedClass*);
extern ConcreteCompilerType* INT, *BOXED_INT, *LONG, *FLOAT, *BOXED_FLOAT, *VOID, *UNKNOWN, *BOOL, *STR, *NONE, *LIST,
*SLICE, *MODULE, *DICT, *BOOL, *BOXED_BOOL, *BOXED_TUPLE, *SET, *FROZENSET, *CLOSURE, *GENERATOR, *BOXED_COMPLEX;
extern CompilerType* UNDEF;
class CompilerVariable;
template <class V> class ValuedCompilerVariable;
......
......@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "codegen/compvars.h"
#include "core/common.h"
#include "core/types.h"
#include "gc/collector.h"
......
......@@ -18,7 +18,6 @@
#include "llvm/Support/FileSystem.h"
#include "codegen/compvars.h"
#include "codegen/irgen/hooks.h"
#include "codegen/parser.h"
#include "core/ast.h"
......
......@@ -17,7 +17,6 @@
#include <sys/stat.h>
#include <unistd.h>
#include "codegen/compvars.h"
#include "core/types.h"
#include "gc/collector.h"
#include "runtime/inline/boxing.h"
......
......@@ -15,7 +15,6 @@
#include <algorithm>
#include <cmath>
#include "codegen/compvars.h"
#include "core/types.h"
#include "gc/collector.h"
#include "runtime/inline/boxing.h"
......
......@@ -14,7 +14,6 @@
#include <stddef.h>
#include "codegen/compvars.h"
#include "core/threading.h"
#include "core/types.h"
#include "runtime/objmodel.h"
......
......@@ -17,7 +17,6 @@
#include <err.h>
#include <sys/time.h>
#include "codegen/compvars.h"
#include "core/threading.h"
#include "core/types.h"
#include "runtime/objmodel.h"
......
......@@ -19,7 +19,6 @@
#include "Python.h"
#include "capi/types.h"
#include "codegen/compvars.h"
#include "core/threading.h"
#include "core/types.h"
#include "runtime/import.h"
......
......@@ -16,7 +16,6 @@
#include <sstream>
#include "codegen/compvars.h"
#include "core/types.h"
#include "gc/collector.h"
#include "runtime/objmodel.h"
......
......@@ -14,7 +14,6 @@
#include "runtime/complex.h"
#include "codegen/compvars.h"
#include "core/types.h"
#include "runtime/float.h"
#include "runtime/inline/boxing.h"
......
......@@ -14,7 +14,6 @@
#include "runtime/dict.h"
#include "codegen/compvars.h"
#include "core/common.h"
#include "core/stats.h"
#include "core/types.h"
......
......@@ -15,7 +15,6 @@
#include <cstring>
#include <sstream>
#include "codegen/compvars.h"
#include "core/common.h"
#include "core/stats.h"
#include "core/types.h"
......
......@@ -15,7 +15,6 @@
#include <cmath>
#include <cstring>
#include "codegen/compvars.h"
#include "core/types.h"
#include "runtime/inline/boxing.h"
#include "runtime/objmodel.h"
......
......@@ -19,7 +19,6 @@
#include <cstring>
#include <ucontext.h>
#include "codegen/compvars.h"
#include "codegen/llvm_interpreter.h"
#include "core/ast.h"
#include "core/common.h"
......
......@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "codegen/compvars.h"
#include "core/types.h"
#include "runtime/objmodel.h"
#include "runtime/types.h"
......
......@@ -17,7 +17,6 @@
#include <cmath>
#include <sstream>
#include "codegen/compvars.h"
#include "core/common.h"
#include "core/options.h"
#include "core/stats.h"
......
......@@ -17,7 +17,6 @@
#include <cmath>
#include <sstream>
#include "codegen/compvars.h"
#include "core/common.h"
#include "core/options.h"
#include "core/stats.h"
......
......@@ -18,7 +18,6 @@
#include <cstring>
#include <sstream>
#include "codegen/compvars.h"
#include "core/ast.h"
#include "core/common.h"
#include "core/stats.h"
......
......@@ -18,7 +18,6 @@
#include <gmp.h>
#include <sstream>
#include "codegen/compvars.h"
#include "core/common.h"
#include "core/options.h"
#include "core/stats.h"
......
......@@ -16,7 +16,6 @@
#include <sstream>
#include "codegen/compvars.h"
#include "gc/collector.h"
#include "runtime/objmodel.h"
......
......@@ -20,7 +20,6 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "codegen/compvars.h"
#include "core/common.h"
#include "core/types.h"
#include "core/util.h"
......
......@@ -16,7 +16,6 @@
#include <sstream>
#include "codegen/compvars.h"
#include "core/types.h"
#include "gc/collector.h"
#include "runtime/objmodel.h"
......
......@@ -16,7 +16,6 @@
#include <sstream>
#include "codegen/compvars.h"
#include "core/ast.h"
#include "core/common.h"
#include "core/stats.h"
......
......@@ -22,7 +22,6 @@
#include <sstream>
#include <stdint.h>
#include "codegen/compvars.h"
#include "core/options.h"
#include "core/stats.h"
#include "core/types.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment