Commit 02de697c authored by Kevin Modzelewski's avatar Kevin Modzelewski

Clean up includes in a vain attempt to improve compilation speed

It looks like the culprit is IRBuilder<>
parent 3462e587
......@@ -19,6 +19,8 @@
#include "llvm/ExecutionEngine/JITEventListener.h"
#include "llvm/ExecutionEngine/ObjectImage.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "core/util.h"
......@@ -170,6 +172,9 @@ class RegistryEventListener : public llvm::JITEventListener {
}
};
GlobalState::GlobalState() : context(llvm::getGlobalContext()) {
};
llvm::JITEventListener* makeRegistryListener() {
return new RegistryEventListener();
}
......
......@@ -17,15 +17,20 @@
#include <unordered_map>
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
//#include "llvm/IR/IRBuilder.h"
#include "core/types.h"
#include "codegen/gcbuilder.h"
#include "codegen/runtime_hooks.h"
namespace llvm {
class ExecutionEngine;
class JITEventListener;
class LLVMContext;
class Module;
class TargetMachine;
}
namespace pyston {
class PystonJITEventListener;
......@@ -74,8 +79,7 @@ struct GlobalState {
GlobalFuncs funcs;
GlobalState() : context(llvm::getGlobalContext()) {
};
GlobalState();
};
extern GlobalState g;
......
......@@ -16,11 +16,13 @@
#include <sstream>
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Support/raw_ostream.h"
#include "core/options.h"
#include "core/types.h"
#include "codegen/compvars.h"
#include "codegen/gcbuilder.h"
#include "codegen/patchpoints.h"
#include "codegen/irgen.h"
#include "codegen/irgen/util.h"
......@@ -32,6 +34,13 @@
namespace pyston {
std::string ValuedCompilerType<llvm::Value*>::debugName() {
std::string rtn;
llvm::raw_string_ostream os(rtn);
llvmType()->print(os);
return rtn;
}
struct RawInstanceMethod {
CompilerVariable *obj, *func;
......
......@@ -18,8 +18,6 @@
#include <vector>
#include <stdint.h>
#include "llvm/Support/raw_ostream.h"
#include "core/types.h"
#include "codegen/codegen.h"
......@@ -27,6 +25,7 @@
namespace pyston {
class CompilerType;
class IREmitter;
extern ConcreteCompilerType *INT, *BOXED_INT, *FLOAT, *BOXED_FLOAT, *VOID, *UNKNOWN, *BOOL, *STR, *NONE, *LIST, *SLICE, *MODULE, *DICT, *BOOL, *BOXED_BOOL, *BOXED_TUPLE;
extern CompilerType* UNDEF;
......@@ -136,12 +135,8 @@ template <>
class ValuedCompilerType<llvm::Value*> : public _ValuedCompilerType<llvm::Value*> {
public:
virtual llvm::Type* llvmType() = 0;
virtual std::string debugName() {
std::string rtn;
llvm::raw_string_ostream os(rtn);
llvmType()->print(os);
return rtn;
}
virtual std::string debugName();
virtual bool isFitBy(BoxedClass*) {
printf("isFitBy not defined for %s\n", debugName().c_str());
abort();
......@@ -303,10 +298,10 @@ class ValuedCompilerVariable : public CompilerVariable {
}
};
template <>
inline ConcreteCompilerVariable::ValuedCompilerVariable(ConcreteCompilerType *type, llvm::Value* value, bool grabbed) : CompilerVariable(grabbed), type(type), value(value) {
assert(value->getType() == type->llvmType());
}
//template <>
//inline ConcreteCompilerVariable::ValuedCompilerVariable(ConcreteCompilerType *type, llvm::Value* value, bool grabbed) : CompilerVariable(grabbed), type(type), value(value) {
//assert(value->getType() == type->llvmType());
//}
CompilerVariable* makeInt(int64_t);
CompilerVariable* makeFloat(double);
......
......@@ -32,6 +32,7 @@
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Target/TargetMachine.h"
#include "codegen/codegen.h"
......
......@@ -15,7 +15,9 @@
#ifndef PYSTON_CODEGEN_GCBUILDER_H
#define PYSTON_CODEGEN_GCBUILDER_H
#include "llvm/IR/Value.h"
namespace llvm {
class Value;
}
namespace pyston {
......
......@@ -20,7 +20,10 @@
#include "llvm/DIBuilder.h"
#include "llvm/PassManager.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Transforms/Instrumentation.h"
#include "llvm/Transforms/Scalar.h"
......@@ -33,6 +36,7 @@
#include "codegen/codegen.h"
#include "codegen/compvars.h"
#include "codegen/gcbuilder.h"
#include "codegen/irgen.h"
#include "codegen/patchpoints.h"
#include "codegen/osrentry.h"
......
......@@ -16,7 +16,8 @@
#define PYSTON_CODEGEN_IRGEN_H
#include "llvm/IR/Function.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IRBuilder.h"
#include "core/types.h"
......@@ -26,8 +27,9 @@
namespace pyston {
class AST_expr;
class GCBuilder;
class IREmitter;
class MyInserter : public llvm::IRBuilderDefaultInserter<true> {
private:
IREmitter *emitter;
......
......@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/Support/raw_ostream.h"
#include "core/common.h"
......
......@@ -13,17 +13,12 @@
// limitations under the License.
#include "llvm/DIBuilder.h"
#include "llvm/PassManager.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Verifier.h"
#include "llvm/IR/Module.h"
#include "core/ast.h"
#include "core/cfg.h"
#include "core/util.h"
#include "codegen/codegen.h"
#include "codegen/compvars.h"
#include "codegen/osrentry.h"
#include "codegen/patchpoints.h"
......
......@@ -15,6 +15,9 @@
#include <sstream>
#include <unordered_map>
#include "llvm/IR/Constants.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/InstIterator.h"
#include "llvm/Transforms/Utils/Cloning.h"
......
......@@ -17,6 +17,8 @@
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "core/common.h"
#include "core/stats.h"
......
......@@ -18,17 +18,14 @@
#include <set>
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/InstIterator.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/InstIterator.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include "core/common.h"
#include "core/options.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