From a11459bc313212d2eed1b29aedfdfab04ffbc1ae Mon Sep 17 00:00:00 2001 From: kai Date: Sun, 6 Jan 2013 17:17:30 +0100 Subject: [PATCH] "The Great Renaming" continues. More changes to match the renamed files of LLVM 3.3. --- dmd2/module.c | 6 ++++++ driver/cl_options.cpp | 4 +++- driver/main.cpp | 4 ++++ gen/asmstmt.cpp | 4 ++++ gen/functions.cpp | 4 ++++ gen/llvm.h | 11 +++++++---- gen/llvmcompat.cpp | 9 ++++++++- gen/logger.cpp | 4 ++++ gen/metadata.h | 4 ++++ gen/module.cpp | 9 +++++++-- gen/naked.cpp | 4 ++++ gen/optimizer.cpp | 9 +++++---- gen/passes/GarbageCollect2Stack.cpp | 8 +++----- gen/passes/SimplifyDRuntimeCalls.cpp | 8 +++----- gen/passes/StripExternals.cpp | 4 ++++ gen/rttibuilder.h | 4 ++++ gen/runtime.cpp | 5 +++++ gen/statements.cpp | 4 ++++ ir/ir.cpp | 4 +++- ir/irclass.cpp | 5 +++++ ir/irtype.cpp | 5 +++++ ir/irtype.h | 4 ++++ ir/irtypeclass.cpp | 4 ++++ ir/irtypeclass.h | 4 ++++ ir/irtypefunction.cpp | 4 ++++ ir/irtypestruct.cpp | 4 ++++ ir/irvar.h | 4 ++++ 27 files changed, 120 insertions(+), 23 deletions(-) diff --git a/dmd2/module.c b/dmd2/module.c index 135b8571..4d363c9d 100644 --- a/dmd2/module.c +++ b/dmd2/module.c @@ -47,9 +47,15 @@ #endif #if IN_LLVM +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/Type.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/DerivedTypes.h" +#else #include "llvm/Type.h" #include "llvm/LLVMContext.h" #include "llvm/DerivedTypes.h" +#endif #include "llvm/Support/CommandLine.h" #include diff --git a/driver/cl_options.cpp b/driver/cl_options.cpp index 537eba64..c0be7631 100644 --- a/driver/cl_options.cpp +++ b/driver/cl_options.cpp @@ -11,7 +11,9 @@ #include "gen/cl_helpers.h" #include "llvm/Target/TargetMachine.h" -#if LDC_LLVM_VER >= 302 +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/DataLayout.h" +#elif LDC_LLVM_VER == 302 #include "llvm/DataLayout.h" #else #include "llvm/Target/TargetData.h" diff --git a/driver/main.cpp b/driver/main.cpp index e2618598..73b2b0ca 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -11,7 +11,11 @@ #include "gen/llvm.h" #include "llvm/LinkAllVMCore.h" #include "llvm/Linker.h" +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/LLVMContext.h" +#else #include "llvm/LLVMContext.h" +#endif #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Support/TargetSelect.h" diff --git a/gen/asmstmt.cpp b/gen/asmstmt.cpp index 7c117ca0..0bf99941 100644 --- a/gen/asmstmt.cpp +++ b/gen/asmstmt.cpp @@ -8,7 +8,11 @@ //===----------------------------------------------------------------------===// #include "gen/llvm.h" +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/InlineAsm.h" +#else #include "llvm/InlineAsm.h" +#endif //#include "d-gcc-includes.h" //#include "total.h" diff --git a/gen/functions.cpp b/gen/functions.cpp index f77bbaa6..4d5ed2e0 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -9,7 +9,11 @@ #include "gen/llvm.h" #include "llvm/Support/CFG.h" +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/Intrinsics.h" +#else #include "llvm/Intrinsics.h" +#endif #include "mtype.h" #include "aggregate.h" diff --git a/gen/llvm.h b/gen/llvm.h index 7fda1d71..f0b207f8 100644 --- a/gen/llvm.h +++ b/gen/llvm.h @@ -29,6 +29,9 @@ #include "llvm/IR/Module.h" #include "llvm/IR/Value.h" #include "llvm/IR/Attributes.h" +#include "llvm/IR/DataLayout.h" +#include "llvm/IR/IRBuilder.h" +#include "llvm/DebugInfo.h" #else #include "llvm/Type.h" #include "llvm/DerivedTypes.h" @@ -40,17 +43,17 @@ #include "llvm/Module.h" #include "llvm/Value.h" #include "llvm/Attributes.h" -#endif - -#if LDC_LLVM_VER >= 302 +#if LDC_LLVM_VER == 302 #include "llvm/DataLayout.h" -#include "llvm/DebugInfo.h" #include "llvm/IRBuilder.h" +#include "llvm/DebugInfo.h" #else #include "llvm/Target/TargetData.h" #include "llvm/Analysis/DebugInfo.h" #include "llvm/Support/IRBuilder.h" #endif +#endif + #include "gen/llvmcompat.h" diff --git a/gen/llvmcompat.cpp b/gen/llvmcompat.cpp index 96bd86f6..5ad3561c 100644 --- a/gen/llvmcompat.cpp +++ b/gen/llvmcompat.cpp @@ -10,14 +10,21 @@ #include "gen/llvmcompat.h" #include "llvm/Config/llvm-config.h" #include "llvm/ADT/Triple.h" +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Module.h" +#include "llvm/IR/IRBuilder.h" +#else #include "llvm/DerivedTypes.h" #include "llvm/Function.h" #include "llvm/Module.h" -#if LDC_LLVM_VER >= 302 +#if LDC_LLVM_VER == 302 #include "llvm/IRBuilder.h" #else #include "llvm/Support/IRBuilder.h" #endif +#endif #include #if LDC_LLVM_VER == 300 diff --git a/gen/logger.cpp b/gen/logger.cpp index 6f737c46..a16e94cf 100644 --- a/gen/logger.cpp +++ b/gen/logger.cpp @@ -19,7 +19,11 @@ #include "llvm/Support/CommandLine.h" +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/GlobalValue.h" +#else #include "llvm/GlobalValue.h" +#endif #include "llvm/Support/Casting.h" #include "llvm/Support/raw_os_ostream.h" #include "llvm/Assembly/Writer.h" diff --git a/gen/metadata.h b/gen/metadata.h index 1239946a..d2523907 100644 --- a/gen/metadata.h +++ b/gen/metadata.h @@ -17,7 +17,11 @@ #define LDC_GEN_METADATA_H // MDNode was moved into its own header, and contains Value*s +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/Metadata.h" +#else #include "llvm/Metadata.h" +#endif typedef llvm::Value MDNodeField; #define METADATA_LINKAGE_TYPE llvm::GlobalValue::WeakODRLinkage diff --git a/gen/module.cpp b/gen/module.cpp index 70031fcf..f09157d8 100644 --- a/gen/module.cpp +++ b/gen/module.cpp @@ -9,13 +9,18 @@ #include "gen/llvm.h" #include "llvm/Analysis/Verifier.h" -#include "llvm/Module.h" #include "llvm/LinkAllPasses.h" -#if LDC_LLVM_VER >= 302 +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/Module.h" +#include "llvm/IR/DataLayout.h" +#else +#include "llvm/Module.h" +#if LDC_LLVM_VER == 302 #include "llvm/DataLayout.h" #else #include "llvm/Target/TargetData.h" #endif +#endif #include "mars.h" #include "module.h" diff --git a/gen/naked.cpp b/gen/naked.cpp index fbe201ff..24fac77b 100644 --- a/gen/naked.cpp +++ b/gen/naked.cpp @@ -8,7 +8,11 @@ //===----------------------------------------------------------------------===// #include "gen/llvm.h" +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/InlineAsm.h" +#else #include "llvm/InlineAsm.h" +#endif #include "expression.h" #include "statement.h" diff --git a/gen/optimizer.cpp b/gen/optimizer.cpp index 8dbc2d04..4f5ac5f4 100644 --- a/gen/optimizer.cpp +++ b/gen/optimizer.cpp @@ -17,16 +17,17 @@ #include "llvm/LinkAllPasses.h" #if LDC_LLVM_VER >= 303 #include "llvm/IR/Module.h" +#include "llvm/IR/DataLayout.h" #else #include "llvm/Module.h" -#endif -#include "llvm/ADT/Triple.h" -#include "llvm/Analysis/Verifier.h" -#if LDC_LLVM_VER >= 302 +#if LDC_LLVM_VER == 302 #include "llvm/DataLayout.h" #else #include "llvm/Target/TargetData.h" #endif +#endif +#include "llvm/ADT/Triple.h" +#include "llvm/Analysis/Verifier.h" #include "llvm/Target/TargetLibraryInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/CommandLine.h" diff --git a/gen/passes/GarbageCollect2Stack.cpp b/gen/passes/GarbageCollect2Stack.cpp index d32c8c9b..65f3bd3c 100644 --- a/gen/passes/GarbageCollect2Stack.cpp +++ b/gen/passes/GarbageCollect2Stack.cpp @@ -27,14 +27,17 @@ #include "llvm/IR/Constants.h" #include "llvm/IR/Intrinsics.h" #include "llvm/IR/IRBuilder.h" +#include "llvm/IR/DataLayout.h" #else #include "llvm/Module.h" #include "llvm/Constants.h" #include "llvm/Intrinsics.h" #if LDC_LLVM_VER == 302 #include "llvm/IRBuilder.h" +#include "llvm/DataLayout.h" #else #include "llvm/Support/IRBuilder.h" +#include "llvm/Target/TargetData.h" #endif #endif #include "llvm/Support/CallSite.h" @@ -42,11 +45,6 @@ #include "llvm/Analysis/CallGraph.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/ValueTracking.h" -#if LDC_LLVM_VER >= 302 -#include "llvm/DataLayout.h" -#else -#include "llvm/Target/TargetData.h" -#endif #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" diff --git a/gen/passes/SimplifyDRuntimeCalls.cpp b/gen/passes/SimplifyDRuntimeCalls.cpp index 2d5e0293..eeacab26 100644 --- a/gen/passes/SimplifyDRuntimeCalls.cpp +++ b/gen/passes/SimplifyDRuntimeCalls.cpp @@ -23,22 +23,20 @@ #include "llvm/IR/Function.h" #include "llvm/IR/Intrinsics.h" #include "llvm/IR/IRBuilder.h" +#include "llvm/IR/DataLayout.h" #else #include "llvm/Function.h" #include "llvm/Intrinsics.h" #if LDC_LLVM_VER == 302 #include "llvm/IRBuilder.h" +#include "llvm/DataLayout.h" #else #include "llvm/Support/IRBuilder.h" +#include "llvm/Target/TargetData.h" #endif #endif #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/ValueTracking.h" -#if LDC_LLVM_VER >= 302 -#include "llvm/DataLayout.h" -#else -#include "llvm/Target/TargetData.h" -#endif #include "llvm/ADT/StringMap.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Compiler.h" diff --git a/gen/passes/StripExternals.cpp b/gen/passes/StripExternals.cpp index fdd0dd85..adcb9a1d 100644 --- a/gen/passes/StripExternals.cpp +++ b/gen/passes/StripExternals.cpp @@ -19,7 +19,11 @@ #include "Passes.h" +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/Module.h" +#else #include "llvm/Module.h" +#endif #include "llvm/Pass.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Compiler.h" diff --git a/gen/rttibuilder.h b/gen/rttibuilder.h index 8bb47b29..5d7eeeb1 100644 --- a/gen/rttibuilder.h +++ b/gen/rttibuilder.h @@ -15,7 +15,11 @@ #ifndef __LDC_GEN_RTTIBUILDER_H__ #define __LDC_GEN_RTTIBUILDER_H__ +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/Constant.h" +#else #include "llvm/Constant.h" +#endif #include "llvm/ADT/SmallVector.h" struct ClassDeclaration; diff --git a/gen/runtime.cpp b/gen/runtime.cpp index 2ce14705..033a521c 100644 --- a/gen/runtime.cpp +++ b/gen/runtime.cpp @@ -8,8 +8,13 @@ //===----------------------------------------------------------------------===// #include "gen/llvm.h" +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/Module.h" +#include "llvm/IR/Attributes.h" +#else #include "llvm/Module.h" #include "llvm/Attributes.h" +#endif #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/CommandLine.h" diff --git a/gen/statements.cpp b/gen/statements.cpp index 99ee6d29..5dc6ce95 100644 --- a/gen/statements.cpp +++ b/gen/statements.cpp @@ -13,7 +13,11 @@ #include #include "gen/llvm.h" +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/InlineAsm.h" +#else #include "llvm/InlineAsm.h" +#endif #include "llvm/Support/CFG.h" #include "mars.h" diff --git a/ir/ir.cpp b/ir/ir.cpp index 6dc953c0..e50246da 100644 --- a/ir/ir.cpp +++ b/ir/ir.cpp @@ -7,7 +7,9 @@ // //===----------------------------------------------------------------------===// -#if LDC_LLVM_VER >= 302 +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/DataLayout.h" +#elif LDC_LLVM_VER == 302 #include "llvm/DataLayout.h" #else #include "llvm/Target/TargetData.h" diff --git a/ir/irclass.cpp b/ir/irclass.cpp index ad8349c8..9214773e 100644 --- a/ir/irclass.cpp +++ b/ir/irclass.cpp @@ -7,8 +7,13 @@ // //===----------------------------------------------------------------------===// +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/Constants.h" +#include "llvm/IR/DerivedTypes.h" +#else #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#endif #include "llvm/ADT/SmallString.h" #include "aggregate.h" diff --git a/ir/irtype.cpp b/ir/irtype.cpp index 4d92eb47..29eae044 100644 --- a/ir/irtype.cpp +++ b/ir/irtype.cpp @@ -7,8 +7,13 @@ // //===----------------------------------------------------------------------===// +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/LLVMContext.h" +#else #include "llvm/DerivedTypes.h" #include "llvm/LLVMContext.h" +#endif #include "mars.h" #include "mtype.h" #include "gen/irstate.h" diff --git a/ir/irtype.h b/ir/irtype.h index a85a760b..14e5c6a7 100644 --- a/ir/irtype.h +++ b/ir/irtype.h @@ -16,7 +16,11 @@ #ifndef __LDC_IR_IRTYPE_H__ #define __LDC_IR_IRTYPE_H__ +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/Type.h" +#else #include "llvm/Type.h" +#endif ////////////////////////////////////////////////////////////////////////////// diff --git a/ir/irtypeclass.cpp b/ir/irtypeclass.cpp index 90eca230..49635811 100644 --- a/ir/irtypeclass.cpp +++ b/ir/irtypeclass.cpp @@ -7,7 +7,11 @@ // //===----------------------------------------------------------------------===// +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/DerivedTypes.h" +#else #include "llvm/DerivedTypes.h" +#endif #include "aggregate.h" #include "declaration.h" diff --git a/ir/irtypeclass.h b/ir/irtypeclass.h index 346e3068..11b1371a 100644 --- a/ir/irtypeclass.h +++ b/ir/irtypeclass.h @@ -15,7 +15,11 @@ #define __LDC_IR_IRTYPECLASS_H__ #include "ir/irtypestruct.h" +#if LDC_LLVM_VER >= 303 +#include +#else #include +#endif /// class IrTypeClass : public IrTypeAggr diff --git a/ir/irtypefunction.cpp b/ir/irtypefunction.cpp index 1479814b..66fda0c2 100644 --- a/ir/irtypefunction.cpp +++ b/ir/irtypefunction.cpp @@ -7,7 +7,11 @@ // //===----------------------------------------------------------------------===// +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/DerivedTypes.h" +#else #include "llvm/DerivedTypes.h" +#endif #include "mtype.h" #include "gen/irstate.h" diff --git a/ir/irtypestruct.cpp b/ir/irtypestruct.cpp index 4b5edbe6..e46cdc9d 100644 --- a/ir/irtypestruct.cpp +++ b/ir/irtypestruct.cpp @@ -7,7 +7,11 @@ // //===----------------------------------------------------------------------===// +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/DerivedTypes.h" +#else #include "llvm/DerivedTypes.h" +#endif #include "aggregate.h" #include "declaration.h" diff --git a/ir/irvar.h b/ir/irvar.h index dbd29dd2..8b12e8b3 100644 --- a/ir/irvar.h +++ b/ir/irvar.h @@ -16,7 +16,11 @@ #define LDC_IR_IRVAR_H #include "ir/ir.h" +#if LDC_LLVM_VER >= 303 +#include "llvm/IR/Type.h" +#else #include "llvm/Type.h" +#endif struct IrFuncTyArg;