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