diff --git a/opts/ClassIMPCache.cpp b/opts/ClassIMPCache.cpp index e43b97e..5f420d8 100644 --- a/opts/ClassIMPCache.cpp +++ b/opts/ClassIMPCache.cpp @@ -1,13 +1,6 @@ #include "llvm/Pass.h" -#include "llvm/Function.h" -#include "llvm/Module.h" -#include "llvm/LLVMContext.h" -#include "llvm/Instructions.h" -#include "llvm/Constants.h" -#include "llvm/GlobalVariable.h" #include "llvm/Support/CallSite.h" #include "llvm/Analysis/LoopInfo.h" -#include "llvm/DefaultPasses.h" #include "ObjectiveCOpts.h" #include "IMPCacher.h" #include diff --git a/opts/ClassLookupCache.cpp b/opts/ClassLookupCache.cpp index b5d4fce..e41aabe 100644 --- a/opts/ClassLookupCache.cpp +++ b/opts/ClassLookupCache.cpp @@ -1,13 +1,6 @@ -#include "llvm/Pass.h" -#include "llvm/Function.h" -#include "llvm/Module.h" -#include "llvm/Instructions.h" -#include "llvm/Constants.h" -#include "llvm/GlobalVariable.h" #include "llvm/ADT/StringMap.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" -#include "llvm/DefaultPasses.h" #include "ObjectiveCOpts.h" #include diff --git a/opts/ClassMethodInliner.cpp b/opts/ClassMethodInliner.cpp index 5451fe0..7d061f3 100644 --- a/opts/ClassMethodInliner.cpp +++ b/opts/ClassMethodInliner.cpp @@ -1,14 +1,6 @@ -#include "llvm/Pass.h" -#include "llvm/Function.h" -#include "llvm/Module.h" -#include "llvm/Instructions.h" #include "llvm/Support/CallSite.h" -#include "llvm/Constants.h" -#include "llvm/LLVMContext.h" -#include "llvm/GlobalVariable.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/InlineCost.h" -#include "llvm/DefaultPasses.h" #include "ObjectiveCOpts.h" #include "IMPCacher.h" #include diff --git a/opts/IMPCacher.cpp b/opts/IMPCacher.cpp index 062dcbe..5b354c1 100644 --- a/opts/IMPCacher.cpp +++ b/opts/IMPCacher.cpp @@ -1,12 +1,5 @@ #include "llvm/Analysis/Verifier.h" #include "IMPCacher.h" -#include "llvm/Pass.h" -#include "llvm/Function.h" -#include "llvm/Module.h" -#include "llvm/Instructions.h" -#include "llvm/Constants.h" -#include "llvm/LLVMContext.h" -#include "llvm/Metadata.h" #include "llvm/Support/CallSite.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h" diff --git a/opts/IvarPass.cpp b/opts/IvarPass.cpp index c9376fd..5760963 100644 --- a/opts/IvarPass.cpp +++ b/opts/IvarPass.cpp @@ -1,12 +1,5 @@ -#include "llvm/Pass.h" -#include "llvm/Function.h" -#include "llvm/Module.h" -#include "llvm/Instructions.h" -#include "llvm/GlobalAlias.h" -#include "llvm/GlobalVariable.h" -#include "llvm/Constants.h" +#include "LLVMCompat.h" #include "llvm/Analysis/Verifier.h" -#include "llvm/DefaultPasses.h" #include "llvm/ADT/DenseSet.h" #include "ObjectiveCOpts.h" #include diff --git a/opts/LLVMCompat.h b/opts/LLVMCompat.h index df2e5fe..f20fdd0 100644 --- a/opts/LLVMCompat.h +++ b/opts/LLVMCompat.h @@ -7,13 +7,34 @@ #ifndef __LANGUAGEKIT_LLVM_HACKS__ #define __LANGUAGEKIT_LLVM_HACKS__ +#if LLVM_MAJOR < 3 || (LLVM_MAJOR >=3 && LLVM_MINOR <= 2) +#if LLVM_MAJOR < 3 || (LLVM_MAJOR >=3 && LLVM_MINOR <= 1) +#include +#else +#include +#endif +#include +#include +#include #include #include #include -#if LLVM_MAJOR < 3 || (LLVM_MAJOR >=3 && LLVM_MINOR < 2) -#include +#include +#include +#include +#include #else -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif diff --git a/opts/LoopIMPCachePass.cpp b/opts/LoopIMPCachePass.cpp index 92d7fb4..317a04c 100644 --- a/opts/LoopIMPCachePass.cpp +++ b/opts/LoopIMPCachePass.cpp @@ -1,12 +1,6 @@ -#include "llvm/LLVMContext.h" -#include "llvm/Pass.h" -#include "llvm/Function.h" -#include "llvm/Module.h" -#include "llvm/Instructions.h" -#include "llvm/Constants.h" +#include "LLVMCompat.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/Verifier.h" -#include "llvm/DefaultPasses.h" #include "ObjectiveCOpts.h" #include "IMPCacher.h" #include diff --git a/opts/ObjectiveCOpts.cpp b/opts/ObjectiveCOpts.cpp index 9cc6404..fa585f7 100644 --- a/opts/ObjectiveCOpts.cpp +++ b/opts/ObjectiveCOpts.cpp @@ -1,8 +1,7 @@ -#include "llvm/Pass.h" -#include "llvm/Module.h" +#include "LLVMCompat.h" #if LLVM_MAJOR >= 3 -#include "llvm/Transforms/IPO/PassManagerBuilder.h" -#include "llvm/PassManager.h" +#include +#include #endif #include "ObjectiveCOpts.h" diff --git a/opts/TypeFeedback.cpp b/opts/TypeFeedback.cpp index 3d197c5..e2988a0 100644 --- a/opts/TypeFeedback.cpp +++ b/opts/TypeFeedback.cpp @@ -1,10 +1,5 @@ -#include "llvm/Constants.h" -#include "llvm/Pass.h" -#include "llvm/Module.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/Support/CallSite.h" -#include "llvm/Linker.h" +#include +#include #include using namespace llvm; diff --git a/opts/TypeFeedbackDrivenInliner.cpp b/opts/TypeFeedbackDrivenInliner.cpp index 1047548..050c8be 100644 --- a/opts/TypeFeedbackDrivenInliner.cpp +++ b/opts/TypeFeedbackDrivenInliner.cpp @@ -1,8 +1,4 @@ -#include "llvm/Constants.h" -#include "llvm/Pass.h" -#include "llvm/Module.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" +#include "LLVMCompat.h" #include "llvm/Analysis/InlineCost.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/Linker.h" diff --git a/opts/TypeInfoProvider.h b/opts/TypeInfoProvider.h index cd112d8..be50c36 100644 --- a/opts/TypeInfoProvider.h +++ b/opts/TypeInfoProvider.h @@ -1,11 +1,5 @@ +#include "LLVMCompat.h" #include "IMPCacher.h" -#include "llvm/Pass.h" -#include "llvm/Function.h" -#include "llvm/Module.h" -#include "llvm/Instructions.h" -#include "llvm/Constants.h" -#include "llvm/LLVMContext.h" -#include "llvm/Metadata.h" #include "llvm/Support/CallSite.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/Transforms/Utils/Cloning.h"