From 0a96aea868cc269fbab920ebfb79666b673790a2 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Thu, 7 Feb 2013 19:36:29 +0100 Subject: [PATCH] Sort includes according to style guidelines: 1. Main include corresponding to .cpp file, if any. 2. DMD and LDC includes. 3. LLVM includes. 4. System includes. Also updated a few include guards to match the default format. --- driver/cl_options.cpp | 7 +-- driver/cl_options.h | 10 ++-- driver/configfile.cpp | 18 +++---- driver/configfile.h | 10 ++-- driver/ldmd.cpp | 8 ++-- driver/linker.cpp | 21 ++++---- driver/linker.h | 6 +-- driver/main.cpp | 70 +++++++++++++-------------- driver/toobj.cpp | 24 +++++----- driver/toobj.h | 8 +++- gen/aa.cpp | 20 ++++---- gen/aa.h | 11 ++++- gen/abi-generic.h | 9 ++-- gen/abi-ppc64.cpp | 9 ++-- gen/abi-ppc64.h | 8 ++-- gen/abi-x86-64.cpp | 19 ++++---- gen/abi-x86-64.h | 8 ++-- gen/abi-x86.cpp | 10 ++-- gen/abi-x86.h | 7 ++- gen/abi.cpp | 21 ++++---- gen/abi.h | 4 +- gen/arrays.cpp | 22 ++++----- gen/arrays.h | 14 ++++-- gen/binops.cpp | 10 ++-- gen/cl_helpers.cpp | 8 ++-- gen/cl_helpers.h | 7 ++- gen/classes.cpp | 12 ++--- gen/classes.h | 18 ++++--- gen/complex.cpp | 14 +++--- gen/complex.h | 26 +++++++--- gen/declarations.cpp | 11 ++--- gen/dvalue.cpp | 16 ++----- gen/dvalue.h | 2 +- gen/functions.cpp | 46 +++++++++--------- gen/functions.h | 8 ++-- gen/irstate.cpp | 15 +++--- gen/irstate.h | 12 ++--- gen/llvm.h | 6 +-- gen/llvmcompat.cpp | 2 +- gen/llvmhelpers.cpp | 42 ++++++++-------- gen/llvmhelpers.h | 7 ++- gen/logger.cpp | 8 ++-- gen/logger.h | 4 +- gen/module.cpp | 72 +++++++++++++--------------- gen/naked.cpp | 21 ++++---- gen/nested.cpp | 6 +-- gen/optimizer.cpp | 7 +-- gen/passes/SimplifyDRuntimeCalls.cpp | 1 - gen/pragma.cpp | 8 ++-- gen/pragma.h | 6 +-- gen/programs.cpp | 6 +-- gen/rttibuilder.cpp | 7 +-- gen/rttibuilder.h | 21 ++++---- gen/runtime.cpp | 32 ++++++------- gen/runtime.h | 6 +-- gen/statements.cpp | 48 +++++++++---------- gen/structs.cpp | 26 +++++----- gen/structs.h | 32 +++++++++---- gen/tocall.cpp | 17 +++---- gen/todebug.cpp | 25 +++++----- gen/todebug.h | 2 +- gen/toir.cpp | 44 ++++++++--------- gen/tollvm.cpp | 27 +++++------ gen/tollvm.h | 7 ++- gen/typeinf.h | 1 + gen/typinf.cpp | 40 +++++++--------- gen/utils.h | 4 +- gen/warnings.cpp | 5 +- gen/warnings.h | 9 ++-- ir/ir.h | 5 +- ir/irdsymbol.cpp | 3 +- ir/irfunction.cpp | 1 - ir/irfunction.h | 5 +- ir/irfuncty.cpp | 4 +- ir/irlandingpad.cpp | 8 ++-- ir/irlandingpad.h | 3 +- ir/irmodule.cpp | 2 +- ir/irstruct.cpp | 10 ++-- ir/irstruct.h | 3 +- utils/gen_gccbuiltins.cpp | 22 ++++----- 80 files changed, 550 insertions(+), 614 deletions(-) diff --git a/driver/cl_options.cpp b/driver/cl_options.cpp index c10e34c3..dda40e86 100644 --- a/driver/cl_options.cpp +++ b/driver/cl_options.cpp @@ -9,7 +9,8 @@ #include "driver/cl_options.h" #include "gen/cl_helpers.h" - +#include "gen/logger.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Target/TargetMachine.h" #if LDC_LLVM_VER >= 303 #include "llvm/IR/DataLayout.h" @@ -19,10 +20,6 @@ #include "llvm/Target/TargetData.h" #endif -#include "gen/logger.h" - -#include "llvm/Support/CommandLine.h" - namespace opts { // Positional options first, in order: diff --git a/driver/cl_options.h b/driver/cl_options.h index ca9b657f..605b21e3 100644 --- a/driver/cl_options.h +++ b/driver/cl_options.h @@ -12,17 +12,15 @@ // //===----------------------------------------------------------------------===// -#ifndef LDC_CL_OPTIONS_H -#define LDC_CL_OPTIONS_H +#ifndef LDC_DRIVER_CL_OPTIONS_H +#define LDC_DRIVER_CL_OPTIONS_H #include "mars.h" - +#include "llvm/Support/CodeGen.h" +#include "llvm/Support/CommandLine.h" #include #include -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/CodeGen.h" - namespace opts { namespace cl = llvm::cl; diff --git a/driver/configfile.cpp b/driver/configfile.cpp index 1af2f525..af3431f0 100644 --- a/driver/configfile.cpp +++ b/driver/configfile.cpp @@ -7,19 +7,15 @@ // //===----------------------------------------------------------------------===// -#include -#include -#include -#include - +#include "driver/configfile.h" +#include "mars.h" +#include "libconfig.h++" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" - -#include "libconfig.h++" - -#include "driver/configfile.h" - -#include "mars.h" +#include +#include +#include +#include namespace sys = llvm::sys; diff --git a/driver/configfile.h b/driver/configfile.h index 9465a877..391e9f8c 100644 --- a/driver/configfile.h +++ b/driver/configfile.h @@ -11,11 +11,13 @@ // //===----------------------------------------------------------------------===// -#ifndef LDC_CONF_CONFIGFILE_H -#define LDC_CONF_CONFIGFILE_H +#ifndef LDC_DRIVER_CONFIGFILE_H +#define LDC_DRIVER_CONFIGFILE_H -#include #include +#include + +namespace llvm { namespace sys { class Path; } } namespace libconfig { @@ -48,4 +50,4 @@ private: s_vector switches; }; -#endif // LDC_CONF_CONFIGFILE_H +#endif // LDC_DRIVER_CONFIGFILE_H diff --git a/driver/ldmd.cpp b/driver/ldmd.cpp index 495aa17b..498d1032 100644 --- a/driver/ldmd.cpp +++ b/driver/ldmd.cpp @@ -48,6 +48,10 @@ # error "Please define LDC_EXE_NAME to the name of the LDC executable to use." #endif +#include "llvm/Support/FileSystem.h" +#include "llvm/Support/Program.h" +#include "llvm/Support/SystemUtils.h" +#include "llvm/Support/raw_ostream.h" #include #include #include @@ -56,10 +60,6 @@ #include #include #include -#include "llvm/Support/FileSystem.h" -#include "llvm/Support/Program.h" -#include "llvm/Support/SystemUtils.h" -#include "llvm/Support/raw_ostream.h" #ifdef HAVE_SC_ARG_MAX # include diff --git a/driver/linker.cpp b/driver/linker.cpp index 07b62dc7..31351fc1 100644 --- a/driver/linker.cpp +++ b/driver/linker.cpp @@ -7,26 +7,23 @@ // //===----------------------------------------------------------------------===// +#include "driver/linker.h" +#include "mars.h" +#include "module.h" +#include "root.h" +#include "driver/cl_options.h" #include "gen/llvm.h" -#include "llvm/Linker.h" +#include "gen/logger.h" +#include "gen/optimizer.h" +#include "gen/programs.h" #include "llvm/ADT/Triple.h" +#include "llvm/Linker.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Program.h" #if _WIN32 #include "llvm/Support/SystemUtils.h" #endif -#include "root.h" -#include "mars.h" -#include "module.h" - -#include "gen/logger.h" -#include "gen/optimizer.h" -#include "gen/programs.h" - -#include "driver/linker.h" -#include "driver/cl_options.h" - ////////////////////////////////////////////////////////////////////////////// // Is this useful? diff --git a/driver/linker.h b/driver/linker.h index d5220224..404c3ddc 100644 --- a/driver/linker.h +++ b/driver/linker.h @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LDC_GEN_LINKER_H -#define LDC_GEN_LINKER_H +#ifndef LDC_DRIVER_LINKER_H +#define LDC_DRIVER_LINKER_H #include "llvm/Support/CommandLine.h" #include @@ -55,4 +55,4 @@ void deleteExecutable(); */ int runExecutable(); -#endif // LDC_GEN_LINKER_H +#endif // LDC_DRIVER_LINKER_H diff --git a/driver/main.cpp b/driver/main.cpp index f14ef747..babbac54 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -7,9 +7,33 @@ // //===----------------------------------------------------------------------===// -#include "gen/llvmcompat.h" +#include "id.h" +#include "json.h" +#include "mars.h" +#include "module.h" +#include "mtype.h" +#include "rmem.h" +#include "root.h" +#include "driver/cl_options.h" +#include "driver/configfile.h" +#include "driver/linker.h" +#include "driver/toobj.h" +#include "gen/cl_helpers.h" +#include "gen/irstate.h" +#include "gen/linkage.h" #include "gen/llvm.h" +#include "gen/llvmcompat.h" +#include "gen/logger.h" +#include "gen/metadata.h" +#include "gen/optimizer.h" +#include "gen/passes/Passes.h" #include "llvm/Linker.h" +#include "llvm/MC/SubtargetFeature.h" +#include "llvm/Support/Host.h" +#include "llvm/Support/TargetRegistry.h" +#include "llvm/Support/TargetSelect.h" +#include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetOptions.h" #if LDC_LLVM_VER >= 303 #include "llvm/LinkAllIR.h" #include "llvm/IR/LLVMContext.h" @@ -17,54 +41,26 @@ #include "llvm/LinkAllVMCore.h" #include "llvm/LLVMContext.h" #endif -#include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetOptions.h" -#include "llvm/Support/TargetSelect.h" -#include "llvm/Support/TargetRegistry.h" -#include "llvm/Support/Host.h" -#include "llvm/MC/SubtargetFeature.h" - -#include -#include #include #include - -#include "rmem.h" -#include "root.h" +#include +#include +#if POSIX +#include +#elif _WIN32 +#include +#endif // stricmp #if __GNUC__ && !_WIN32 #include "gnuc.h" #endif -#include "mars.h" -#include "module.h" -#include "mtype.h" -#include "id.h" +// Needs Type already declared. #include "cond.h" -#include "json.h" -#include "gen/logger.h" -#include "gen/linkage.h" -#include "gen/irstate.h" -#include "gen/optimizer.h" -#include "gen/metadata.h" -#include "gen/passes/Passes.h" - -#include "driver/linker.h" -#include "driver/cl_options.h" -#include "gen/cl_helpers.h" using namespace opts; -#include "driver/configfile.h" -#include "driver/toobj.h" - -#if POSIX -#include -#elif _WIN32 -#include -#endif - extern void getenv_setargv(const char *envvar, int *pargc, char** *pargv); extern void backend_init(); extern void backend_term(); diff --git a/driver/toobj.cpp b/driver/toobj.cpp index d19df8d5..2b455c04 100644 --- a/driver/toobj.cpp +++ b/driver/toobj.cpp @@ -7,26 +7,24 @@ // //===----------------------------------------------------------------------===// -#include -#include - +#include "driver/toobj.h" +#include "gen/irstate.h" +#include "gen/logger.h" +#include "gen/optimizer.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/PassManager.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/FormattedStream.h" +#include "llvm/Support/Program.h" +#include "llvm/Target/TargetMachine.h" #if LDC_LLVM_VER >= 303 #include "llvm/IR/Module.h" #else #include "llvm/Module.h" #endif -#include "llvm/PassManager.h" -#include "llvm/Support/Program.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/FormattedStream.h" -#include "llvm/Target/TargetMachine.h" - -#include "gen/irstate.h" -#include "gen/logger.h" -#include "gen/optimizer.h" - +#include +#include // fwd decl void emit_file(llvm::TargetMachine &Target, llvm::Module& m, llvm::raw_fd_ostream& Out, diff --git a/driver/toobj.h b/driver/toobj.h index bae370d8..03b9ddb8 100644 --- a/driver/toobj.h +++ b/driver/toobj.h @@ -11,8 +11,12 @@ // //===----------------------------------------------------------------------===// -#ifndef LDC_GEN_TOOBJ_H -#define LDC_GEN_TOOBJ_H +#ifndef LDC_DRIVER_TOOBJ_H +#define LDC_DRIVER_TOOBJ_H + +#include + +namespace llvm { class Module; } void writeModule(llvm::Module* m, std::string filename); diff --git a/gen/aa.cpp b/gen/aa.cpp index bc4d6927..a88b108e 100644 --- a/gen/aa.cpp +++ b/gen/aa.cpp @@ -7,20 +7,18 @@ // //===----------------------------------------------------------------------===// -#include "gen/llvm.h" - -#include "mtype.h" -#include "module.h" -#include "declaration.h" -#include "aggregate.h" - #include "gen/aa.h" -#include "gen/runtime.h" -#include "gen/tollvm.h" +#include "aggregate.h" +#include "declaration.h" +#include "module.h" +#include "mtype.h" +#include "gen/dvalue.h" +#include "gen/irstate.h" +#include "gen/llvm.h" #include "gen/llvmhelpers.h" #include "gen/logger.h" -#include "gen/irstate.h" -#include "gen/dvalue.h" +#include "gen/runtime.h" +#include "gen/tollvm.h" #include "ir/irmodule.h" #if DMDV2 diff --git a/gen/aa.h b/gen/aa.h index 0154f302..c0d5929c 100644 --- a/gen/aa.h +++ b/gen/aa.h @@ -11,13 +11,20 @@ // //===----------------------------------------------------------------------===// - #ifndef LDC_GEN_AA_H #define LDC_GEN_AA_H +#include "lexer.h" + +enum TOK; +struct DValue; +struct Loc; +struct Type; +namespace llvm { class Value; } + DValue* DtoAAIndex(Loc& loc, Type* type, DValue* aa, DValue* key, bool lvalue); DValue* DtoAAIn(Loc& loc, Type* type, DValue* aa, DValue* key); DValue* DtoAARemove(Loc& loc, DValue* aa, DValue* key); -LLValue* DtoAAEquals(Loc& loc, TOK op, DValue* l, DValue* r); +llvm::Value* DtoAAEquals(Loc& loc, TOK op, DValue* l, DValue* r); #endif // LDC_GEN_AA_H diff --git a/gen/abi-generic.h b/gen/abi-generic.h index b77fca44..995594c3 100644 --- a/gen/abi-generic.h +++ b/gen/abi-generic.h @@ -11,12 +11,15 @@ // //===----------------------------------------------------------------------===// -#ifndef LDC_GEN_ABI_GENERIC -#define LDC_GEN_ABI_GENERIC +#ifndef LDC_GEN_ABI_GENERIC_H +#define LDC_GEN_ABI_GENERIC_H +#include "gen/abi.h" +#include "gen/irstate.h" #include "gen/llvmhelpers.h" -#include "gen/tollvm.h" +#include "gen/logger.h" #include "gen/structs.h" +#include "gen/tollvm.h" /// Removes padding fields for (non-union-containing!) structs struct RemoveStructPadding : ABIRewrite { diff --git a/gen/abi-ppc64.cpp b/gen/abi-ppc64.cpp index 16e641fa..9d0fbc61 100644 --- a/gen/abi-ppc64.cpp +++ b/gen/abi-ppc64.cpp @@ -12,11 +12,12 @@ // //===----------------------------------------------------------------------===// +#include "gen/abi-ppc64.h" #include "gen/abi.h" -#include "gen/irstate.h" -#include "gen/tollvm.h" -#include "gen/llvmhelpers.h" #include "gen/dvalue.h" +#include "gen/irstate.h" +#include "gen/llvmhelpers.h" +#include "gen/tollvm.h" struct PPC64TargetABI : TargetABI { @@ -56,4 +57,4 @@ struct PPC64TargetABI : TargetABI { TargetABI* getPPC64TargetABI() { return new PPC64TargetABI(); -} \ No newline at end of file +} diff --git a/gen/abi-ppc64.h b/gen/abi-ppc64.h index de4e989a..367701af 100644 --- a/gen/abi-ppc64.h +++ b/gen/abi-ppc64.h @@ -11,13 +11,11 @@ // //===----------------------------------------------------------------------===// -#ifndef __LDC_GEN_ABI_PPC64_H__ -#define __LDC_GEN_ABI_PPC64_H__ - -#include "gen/abi.h" +#ifndef LDC_GEN_ABI_PPC64_H +#define LDC_GEN_ABI_PPC64_H +struct TargetABI; TargetABI* getPPC64TargetABI(); - #endif diff --git a/gen/abi-x86-64.cpp b/gen/abi-x86-64.cpp index fb11b248..4e902b64 100644 --- a/gen/abi-x86-64.cpp +++ b/gen/abi-x86-64.cpp @@ -43,21 +43,20 @@ // //===----------------------------------------------------------------------===// -#include "mtype.h" -#include "declaration.h" +#include "gen/abi-x86-64.h" #include "aggregate.h" - +#include "declaration.h" +#include "mtype.h" +#include "gen/abi-generic.h" +#include "gen/abi-x86-64.h" +#include "gen/abi.h" +#include "gen/dvalue.h" #include "gen/irstate.h" #include "gen/llvm.h" -#include "gen/tollvm.h" -#include "gen/logger.h" -#include "gen/dvalue.h" #include "gen/llvmhelpers.h" -#include "gen/abi.h" -#include "gen/abi-x86-64.h" -#include "gen/abi-generic.h" +#include "gen/logger.h" +#include "gen/tollvm.h" #include "ir/irfunction.h" - #include #include #include diff --git a/gen/abi-x86-64.h b/gen/abi-x86-64.h index 8ce2376a..fc4a10b9 100644 --- a/gen/abi-x86-64.h +++ b/gen/abi-x86-64.h @@ -11,13 +11,11 @@ // //===----------------------------------------------------------------------===// -#ifndef __LDC_GEN_ABI_X86_64_H__ -#define __LDC_GEN_ABI_X86_64_H__ - -#include "gen/abi.h" +#ifndef LDC_GEN_ABI_X86_64_H +#define LDC_GEN_ABI_X86_64_H +struct TargetABI; TargetABI* getX86_64TargetABI(); - #endif diff --git a/gen/abi-x86.cpp b/gen/abi-x86.cpp index 8f7c02d3..59edcfa5 100644 --- a/gen/abi-x86.cpp +++ b/gen/abi-x86.cpp @@ -8,16 +8,14 @@ //===----------------------------------------------------------------------===// #include "gen/llvm.h" - #include "mars.h" - +#include "gen/abi-generic.h" +#include "gen/abi.h" +#include "gen/dvalue.h" #include "gen/irstate.h" #include "gen/llvmhelpers.h" -#include "gen/tollvm.h" -#include "gen/abi.h" #include "gen/logger.h" -#include "gen/dvalue.h" -#include "gen/abi-generic.h" +#include "gen/tollvm.h" #include "ir/irfunction.h" #include "ir/irfuncty.h" diff --git a/gen/abi-x86.h b/gen/abi-x86.h index 70638e04..bd3312e3 100644 --- a/gen/abi-x86.h +++ b/gen/abi-x86.h @@ -11,11 +11,10 @@ // //===----------------------------------------------------------------------===// -#ifndef __LDC_GEN_ABI_X86_H__ -#define __LDC_GEN_ABI_X86_H__ - -#include "gen/abi.h" +#ifndef LDC_GEN_ABI_X86_H +#define LDC_GEN_ABI_X86_H +struct TargetABI; TargetABI* getX86TargetABI(); #endif diff --git a/gen/abi.cpp b/gen/abi.cpp index 346f9a35..9ec247a3 100644 --- a/gen/abi.cpp +++ b/gen/abi.cpp @@ -7,24 +7,21 @@ // //===----------------------------------------------------------------------===// -#include "gen/llvm.h" - -#include - -#include "mars.h" - -#include "gen/irstate.h" -#include "gen/llvmhelpers.h" -#include "gen/tollvm.h" #include "gen/abi.h" -#include "gen/logger.h" -#include "gen/dvalue.h" +#include "mars.h" #include "gen/abi-generic.h" #include "gen/abi-ppc64.h" -#include "gen/abi-x86.h" #include "gen/abi-x86-64.h" +#include "gen/abi-x86.h" +#include "gen/dvalue.h" +#include "gen/irstate.h" +#include "gen/llvm.h" +#include "gen/llvmhelpers.h" +#include "gen/logger.h" +#include "gen/tollvm.h" #include "ir/irfunction.h" #include "ir/irfuncty.h" +#include ////////////////////////////////////////////////////////////////////////////// diff --git a/gen/abi.h b/gen/abi.h index da15be9e..ee482054 100644 --- a/gen/abi.h +++ b/gen/abi.h @@ -14,8 +14,8 @@ // //===----------------------------------------------------------------------===// -#ifndef __LDC_GEN_ABI_H__ -#define __LDC_GEN_ABI_H__ +#ifndef LDC_GEN_ABI_H +#define LDC_GEN_ABI_H #include diff --git a/gen/arrays.cpp b/gen/arrays.cpp index 30a38f3f..609b5683 100644 --- a/gen/arrays.cpp +++ b/gen/arrays.cpp @@ -7,22 +7,20 @@ // //===----------------------------------------------------------------------===// -#include "gen/llvm.h" - -#include "mtype.h" -#include "module.h" -#include "dsymbol.h" +#include "gen/arrays.h" #include "aggregate.h" #include "declaration.h" +#include "dsymbol.h" #include "init.h" - -#include "gen/irstate.h" -#include "gen/tollvm.h" -#include "gen/llvmhelpers.h" -#include "gen/arrays.h" -#include "gen/runtime.h" -#include "gen/logger.h" +#include "module.h" +#include "mtype.h" #include "gen/dvalue.h" +#include "gen/irstate.h" +#include "gen/llvm.h" +#include "gen/llvmhelpers.h" +#include "gen/logger.h" +#include "gen/runtime.h" +#include "gen/tollvm.h" #include "ir/irmodule.h" #include "ir/irtypestruct.h" diff --git a/gen/arrays.h b/gen/arrays.h index 4d2d18a3..d32ac898 100644 --- a/gen/arrays.h +++ b/gen/arrays.h @@ -11,12 +11,18 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVMC_GEN_ARRAYS_H -#define LLVMC_GEN_ARRAYS_H +#ifndef LDC_GEN_ARRAYS_H +#define LDC_GEN_ARRAYS_H + +#include "lexer.h" +#include "gen/llvm.h" struct ArrayInitializer; - struct DSliceValue; +struct DValue; +struct Expression; +struct Loc; +struct Type; llvm::StructType* DtoArrayType(Type* arrayTy); llvm::StructType* DtoArrayType(LLType* elemTy); @@ -69,4 +75,4 @@ DValue* DtoCastArray(Loc& loc, DValue* val, Type* to); // generates an array bounds check void DtoArrayBoundsCheck(Loc& loc, DValue* arr, DValue* index, DValue* lowerBound = 0); -#endif // LLVMC_GEN_ARRAYS_H +#endif // LDC_GEN_ARRAYS_H diff --git a/gen/binops.cpp b/gen/binops.cpp index d4eeeb15..bcf32c76 100644 --- a/gen/binops.cpp +++ b/gen/binops.cpp @@ -8,15 +8,13 @@ //===----------------------------------------------------------------------===// #include "gen/llvm.h" - #include "declaration.h" - -#include "gen/irstate.h" -#include "gen/tollvm.h" -#include "gen/dvalue.h" -#include "gen/logger.h" #include "gen/complex.h" +#include "gen/dvalue.h" +#include "gen/irstate.h" #include "gen/llvmhelpers.h" +#include "gen/logger.h" +#include "gen/tollvm.h" ////////////////////////////////////////////////////////////////////////////// diff --git a/gen/cl_helpers.cpp b/gen/cl_helpers.cpp index dcfe59dc..1fba45a3 100644 --- a/gen/cl_helpers.cpp +++ b/gen/cl_helpers.cpp @@ -8,15 +8,13 @@ //===----------------------------------------------------------------------===// #include "gen/cl_helpers.h" - #include "mars.h" -#include "root.h" #include "rmem.h" - -#include // isupper, tolower +#include "root.h" #include -#include +#include // isupper, tolower #include +#include namespace opts { diff --git a/gen/cl_helpers.h b/gen/cl_helpers.h index 06bd195d..3870119c 100644 --- a/gen/cl_helpers.h +++ b/gen/cl_helpers.h @@ -12,13 +12,12 @@ // //===----------------------------------------------------------------------===// -#ifndef LDC_CL_HELPERS_H -#define LDC_CL_HELPERS_H - -#include +#ifndef LDC_GEN_CL_HELPERS_H +#define LDC_GEN_CL_HELPERS_H #include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" +#include template struct ArrayBase; typedef ArrayBase Strings; diff --git a/gen/classes.cpp b/gen/classes.cpp index d7374797..cf3535d9 100644 --- a/gen/classes.cpp +++ b/gen/classes.cpp @@ -8,18 +8,15 @@ //===----------------------------------------------------------------------===// #include "gen/llvm.h" - -#include "mtype.h" #include "aggregate.h" -#include "init.h" #include "declaration.h" - -#include "gen/dvalue.h" -#include "gen/irstate.h" - +#include "init.h" +#include "mtype.h" #include "gen/arrays.h" #include "gen/classes.h" +#include "gen/dvalue.h" #include "gen/functions.h" +#include "gen/irstate.h" #include "gen/llvmhelpers.h" #include "gen/logger.h" #include "gen/nested.h" @@ -28,7 +25,6 @@ #include "gen/structs.h" #include "gen/tollvm.h" #include "gen/utils.h" - #include "ir/irstruct.h" #include "ir/irtypeclass.h" diff --git a/gen/classes.h b/gen/classes.h index 27be1b99..a451443e 100644 --- a/gen/classes.h +++ b/gen/classes.h @@ -17,6 +17,12 @@ #include "gen/structs.h" +struct ClassDeclaration; +struct CtorDeclaration; +struct FuncDeclaration; +struct NewExp; +struct TypeClass; + /// Resolves the llvm type for a class declaration void DtoResolveClass(ClassDeclaration* cd); @@ -31,12 +37,12 @@ void DtoDefineClass(ClassDeclaration* cd); /// Builds the initializer of cd's ClassInfo. /// FIXME: this should be put into IrStruct and eventually IrClass. -LLConstant* DtoDefineClassInfo(ClassDeclaration* cd); +llvm::Constant* DtoDefineClassInfo(ClassDeclaration* cd); DValue* DtoNewClass(Loc loc, TypeClass* type, NewExp* newexp); -void DtoInitClass(TypeClass* tc, LLValue* dst); -DValue* DtoCallClassCtor(TypeClass* type, CtorDeclaration* ctor, Array* arguments, LLValue* mem); -void DtoFinalizeClass(LLValue* inst); +void DtoInitClass(TypeClass* tc, llvm::Value* dst); +DValue* DtoCallClassCtor(TypeClass* type, CtorDeclaration* ctor, Array* arguments, llvm::Value* mem); +void DtoFinalizeClass(llvm::Value* inst); DValue* DtoCastClass(DValue* val, Type* to); DValue* DtoDynamicCastObject(DValue* val, Type* to); @@ -44,8 +50,8 @@ DValue* DtoDynamicCastObject(DValue* val, Type* to); DValue* DtoCastInterfaceToObject(DValue* val, Type* to); DValue* DtoDynamicCastInterface(DValue* val, Type* to); -LLValue* DtoIndexClass(LLValue* src, ClassDeclaration* sd, VarDeclaration* vd); +llvm::Value* DtoIndexClass(llvm::Value* src, ClassDeclaration* sd, VarDeclaration* vd); -LLValue* DtoVirtualFunctionPointer(DValue* inst, FuncDeclaration* fdecl, char* name); +llvm::Value* DtoVirtualFunctionPointer(DValue* inst, FuncDeclaration* fdecl, char* name); #endif diff --git a/gen/complex.cpp b/gen/complex.cpp index 0f6d549d..f8875945 100644 --- a/gen/complex.cpp +++ b/gen/complex.cpp @@ -7,17 +7,15 @@ // //===----------------------------------------------------------------------===// -#include "gen/llvm.h" - -#include "mtype.h" -#include "declaration.h" - #include "gen/complex.h" -#include "gen/tollvm.h" -#include "gen/llvmhelpers.h" -#include "gen/irstate.h" +#include "declaration.h" +#include "mtype.h" #include "gen/dvalue.h" +#include "gen/irstate.h" +#include "gen/llvm.h" +#include "gen/llvmhelpers.h" #include "gen/logger.h" +#include "gen/tollvm.h" ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/gen/complex.h b/gen/complex.h index 046d8c66..4e1eaf1e 100644 --- a/gen/complex.h +++ b/gen/complex.h @@ -14,19 +14,33 @@ #ifndef LDC_GEN_COMPLEX_H #define LDC_GEN_COMPLEX_H +#include "lexer.h" +#include "longdouble.h" + +struct DValue; +struct Loc; +struct Type; +namespace llvm +{ + class Constant; + class StructType; + class Type; + class Value; +} + llvm::StructType* DtoComplexType(Type* t); -LLType* DtoComplexBaseType(Type* t); +llvm::Type* DtoComplexBaseType(Type* t); -LLConstant* DtoConstComplex(Type* t, longdouble re, longdouble im); +llvm::Constant* DtoConstComplex(Type* t, longdouble re, longdouble im); -LLConstant* DtoComplexShuffleMask(unsigned a, unsigned b); +llvm::Constant* DtoComplexShuffleMask(unsigned a, unsigned b); DValue* DtoComplex(Loc& loc, Type* to, DValue* val); -void DtoComplexSet(LLValue* c, LLValue* re, LLValue* im); +void DtoComplexSet(llvm::Value* c, llvm::Value* re, llvm::Value* im); void DtoGetComplexParts(Loc& loc, Type* to, DValue* c, DValue*& re, DValue*& im); -void DtoGetComplexParts(Loc& loc, Type* to, DValue* c, LLValue*& re, LLValue*& im); +void DtoGetComplexParts(Loc& loc, Type* to, DValue* c, llvm::Value*& re, llvm::Value*& im); DValue* DtoComplexAdd(Loc& loc, Type* type, DValue* lhs, DValue* rhs); DValue* DtoComplexSub(Loc& loc, Type* type, DValue* lhs, DValue* rhs); @@ -35,7 +49,7 @@ DValue* DtoComplexDiv(Loc& loc, Type* type, DValue* lhs, DValue* rhs); DValue* DtoComplexRem(Loc& loc, Type* type, DValue* lhs, DValue* rhs); DValue* DtoComplexNeg(Loc& loc, Type* type, DValue* val); -LLValue* DtoComplexEquals(Loc& loc, TOK op, DValue* lhs, DValue* rhs); +llvm::Value* DtoComplexEquals(Loc& loc, TOK op, DValue* lhs, DValue* rhs); DValue* DtoCastComplex(Loc& loc, DValue* val, Type* to); diff --git a/gen/declarations.cpp b/gen/declarations.cpp index 88b62a40..9de7b982 100644 --- a/gen/declarations.cpp +++ b/gen/declarations.cpp @@ -7,26 +7,23 @@ // //===----------------------------------------------------------------------===// -#include "gen/llvm.h" - #include "aggregate.h" #include "declaration.h" #include "enum.h" #include "id.h" +#include "init.h" #include "rmem.h" #include "template.h" -#include "init.h" - #include "gen/irstate.h" -#include "gen/tollvm.h" +#include "gen/llvm.h" #include "gen/llvmhelpers.h" #include "gen/logger.h" #include "gen/todebug.h" - +#include "gen/tollvm.h" #include "ir/ir.h" -#include "ir/irvar.h" #include "ir/irtype.h" #include "ir/irtypestruct.h" +#include "ir/irvar.h" /* ================================================================== */ diff --git a/gen/dvalue.cpp b/gen/dvalue.cpp index 9da16448..160bb4ce 100644 --- a/gen/dvalue.cpp +++ b/gen/dvalue.cpp @@ -7,16 +7,13 @@ // //===----------------------------------------------------------------------===// -#include "gen/llvm.h" - -#include "gen/tollvm.h" -#include "gen/irstate.h" -#include "gen/logger.h" #include "gen/dvalue.h" -#include "gen/llvmhelpers.h" - #include "declaration.h" - +#include "gen/irstate.h" +#include "gen/llvm.h" +#include "gen/llvmhelpers.h" +#include "gen/logger.h" +#include "gen/tollvm.h" ///////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////// @@ -95,6 +92,3 @@ LLValue* DConstValue::getRVal() assert(c); return c; } - -///////////////////////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/gen/dvalue.h b/gen/dvalue.h index 1e91bc82..03856249 100644 --- a/gen/dvalue.h +++ b/gen/dvalue.h @@ -17,8 +17,8 @@ #ifndef LDC_GEN_DVALUE_H #define LDC_GEN_DVALUE_H -#include #include "root.h" +#include struct Type; struct Dsymbol; diff --git a/gen/functions.cpp b/gen/functions.cpp index 96bad4fa..7bac905e 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -7,36 +7,34 @@ // //===----------------------------------------------------------------------===// +#include "gen/functions.h" +#include "aggregate.h" +#include "declaration.h" +#include "id.h" +#include "init.h" +#include "module.h" +#include "mtype.h" +#include "statement.h" +#include "template.h" +#include "gen/abi.h" +#include "gen/arrays.h" +#include "gen/classes.h" +#include "gen/dvalue.h" +#include "gen/irstate.h" #include "gen/llvm.h" -#include "llvm/Support/CFG.h" +#include "gen/llvmhelpers.h" +#include "gen/logger.h" +#include "gen/nested.h" +#include "gen/pragma.h" +#include "gen/runtime.h" +#include "gen/todebug.h" +#include "gen/tollvm.h" #if LDC_LLVM_VER >= 303 #include "llvm/IR/Intrinsics.h" #else #include "llvm/Intrinsics.h" #endif - -#include "mtype.h" -#include "aggregate.h" -#include "init.h" -#include "declaration.h" -#include "template.h" -#include "module.h" -#include "statement.h" -#include "id.h" - -#include "gen/irstate.h" -#include "gen/tollvm.h" -#include "gen/llvmhelpers.h" -#include "gen/runtime.h" -#include "gen/arrays.h" -#include "gen/logger.h" -#include "gen/functions.h" -#include "gen/todebug.h" -#include "gen/classes.h" -#include "gen/dvalue.h" -#include "gen/abi.h" -#include "gen/nested.h" -#include "gen/pragma.h" +#include "llvm/Support/CFG.h" #include #if LDC_LLVM_VER < 302 diff --git a/gen/functions.h b/gen/functions.h index 0be3a73c..f2a2c403 100644 --- a/gen/functions.h +++ b/gen/functions.h @@ -16,13 +16,15 @@ #include "mars.h" +struct DValue; +struct Expression; struct FuncDeclaration; -struct Type; - struct IRAsmBlock; - +struct Parameter; +struct Type; namespace llvm { + class FunctionType; class Value; } diff --git a/gen/irstate.cpp b/gen/irstate.cpp index 20748c9d..b81c9e1b 100644 --- a/gen/irstate.cpp +++ b/gen/irstate.cpp @@ -7,16 +7,13 @@ // //===----------------------------------------------------------------------===// -#include - -#include "gen/llvm.h" - -#include "mtype.h" -#include "declaration.h" -#include "statement.h" - #include "gen/irstate.h" -#include "tollvm.h" +#include "declaration.h" +#include "mtype.h" +#include "statement.h" +#include "gen/llvm.h" +#include "gen/tollvm.h" +#include IRState* gIR = 0; llvm::TargetMachine* gTargetMachine = 0; diff --git a/gen/irstate.h b/gen/irstate.h index cde25f24..9aa17124 100644 --- a/gen/irstate.h +++ b/gen/irstate.h @@ -15,17 +15,15 @@ #ifndef LDC_GEN_IRSTATE_H #define LDC_GEN_IRSTATE_H -#include -#include -#include -#include - -#include "root.h" #include "aggregate.h" - +#include "root.h" #include "ir/irfunction.h" #include "ir/irstruct.h" #include "ir/irvar.h" +#include +#include +#include +#include #if LDC_LLVM_VER >= 302 #include "llvm/DIBuilder.h" diff --git a/gen/llvm.h b/gen/llvm.h index f0b207f8..5db2fded 100644 --- a/gen/llvm.h +++ b/gen/llvm.h @@ -15,8 +15,8 @@ // //===----------------------------------------------------------------------===// -#ifndef GEN_LLVM_H -#define GEN_LLVM_H +#ifndef LDC_GEN_LLVM_H +#define LDC_GEN_LLVM_H #if LDC_LLVM_VER >= 303 #include "llvm/IR/Type.h" @@ -94,4 +94,4 @@ using llvm::IRBuilder; using llvm::APFloat; using llvm::APInt; -#endif // GEN_LLVM_H +#endif // LDC_GEN_LLVM_H diff --git a/gen/llvmcompat.cpp b/gen/llvmcompat.cpp index cb441463..17e0045c 100644 --- a/gen/llvmcompat.cpp +++ b/gen/llvmcompat.cpp @@ -8,8 +8,8 @@ //===----------------------------------------------------------------------===// #include "gen/llvmcompat.h" -#include "llvm/Config/llvm-config.h" #include "llvm/ADT/Triple.h" +#include "llvm/Config/llvm-config.h" #if LDC_LLVM_VER >= 303 #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 8c2e0dbd..a5e0df49 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -8,36 +8,32 @@ //===----------------------------------------------------------------------===// #include "gen/llvmhelpers.h" -#include "gen/llvm.h" - -#include "mars.h" -#include "init.h" -#include "id.h" #include "expression.h" -#include "template.h" +#include "id.h" +#include "init.h" +#include "mars.h" #include "module.h" - +#include "template.h" +#include "gen/arrays.h" +#include "gen/classes.h" +#include "gen/complex.h" +#include "gen/dvalue.h" +#include "gen/functions.h" +#include "gen/irstate.h" +#include "gen/llvm.h" +#include "gen/llvmcompat.h" +#include "gen/logger.h" +#include "gen/nested.h" +#include "gen/runtime.h" +#include "gen/todebug.h" +#include "gen/tollvm.h" +#include "gen/typeinf.h" +#include "ir/irmodule.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetMachine.h" #if LDC_LLVM_VER >= 301 #include "llvm/Transforms/Utils/ModuleUtils.h" #endif - -#include "gen/tollvm.h" -#include "gen/irstate.h" -#include "gen/runtime.h" -#include "gen/logger.h" -#include "gen/arrays.h" -#include "gen/dvalue.h" -#include "gen/complex.h" -#include "gen/classes.h" -#include "gen/functions.h" -#include "gen/typeinf.h" -#include "gen/todebug.h" -#include "gen/nested.h" -#include "ir/irmodule.h" -#include "gen/llvmcompat.h" - #include /****************************************************************************************/ diff --git a/gen/llvmhelpers.h b/gen/llvmhelpers.h index 7689e411..a3399c44 100644 --- a/gen/llvmhelpers.h +++ b/gen/llvmhelpers.h @@ -16,11 +16,10 @@ #ifndef LDC_GEN_LLVMHELPERS_H #define LDC_GEN_LLVMHELPERS_H -#include "gen/llvm.h" -#include "gen/dvalue.h" - -#include "statement.h" #include "mtype.h" +#include "statement.h" +#include "gen/dvalue.h" +#include "gen/llvm.h" // this is used for tracking try-finally, synchronized and volatile scopes struct EnclosingHandler diff --git a/gen/logger.cpp b/gen/logger.cpp index a16e94cf..aeeab3f2 100644 --- a/gen/logger.cpp +++ b/gen/logger.cpp @@ -7,17 +7,15 @@ // //===----------------------------------------------------------------------===// +#include "mars.h" +#include "llvm/Support/CommandLine.h" #include #include #include #include #include -#include #include - -#include "mars.h" - -#include "llvm/Support/CommandLine.h" +#include #if LDC_LLVM_VER >= 303 #include "llvm/IR/GlobalValue.h" diff --git a/gen/logger.h b/gen/logger.h index 52c12a43..e9683505 100644 --- a/gen/logger.h +++ b/gen/logger.h @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#ifndef _llvmd_gen_logger_h_ -#define _llvmd_gen_logger_h_ +#ifndef LDC_GEN_LOGGER_H +#define LDC_GEN_LOGGER_H #include diff --git a/gen/module.cpp b/gen/module.cpp index c458101d..671217bb 100644 --- a/gen/module.cpp +++ b/gen/module.cpp @@ -7,7 +7,41 @@ // //===----------------------------------------------------------------------===// +#include "aggregate.h" +#include "attrib.h" +#include "declaration.h" +#include "enum.h" +#include "id.h" +#include "import.h" +#include "init.h" +#include "mars.h" +#include "module.h" +#include "mtype.h" +#include "scope.h" +#include "statement.h" +#include "template.h" +#include "gen/abi.h" +#include "gen/arrays.h" +#include "gen/classes.h" +#include "gen/functions.h" +#include "gen/irstate.h" #include "gen/llvm.h" +#include "gen/llvmhelpers.h" +#include "gen/logger.h" +#include "gen/optimizer.h" +#include "gen/programs.h" +#include "gen/rttibuilder.h" +#include "gen/runtime.h" +#include "gen/structs.h" +#include "gen/todebug.h" +#include "gen/tollvm.h" +#include "ir/irdsymbol.h" +#include "ir/irmodule.h" +#include "ir/irtype.h" +#if !MODULEINFO_IS_STRUCT +#include "ir/irtypeclass.h" +#endif +#include "ir/irvar.h" #include "llvm/Analysis/Verifier.h" #include "llvm/LinkAllPasses.h" #if LDC_LLVM_VER >= 303 @@ -22,44 +56,6 @@ #endif #endif -#include "mars.h" -#include "module.h" -#include "mtype.h" -#include "declaration.h" -#include "statement.h" -#include "enum.h" -#include "aggregate.h" -#include "init.h" -#include "attrib.h" -#include "id.h" -#include "import.h" -#include "template.h" -#include "scope.h" - -#include "gen/abi.h" -#include "gen/arrays.h" -#include "gen/classes.h" -#include "gen/functions.h" -#include "gen/irstate.h" -#include "gen/llvmhelpers.h" -#include "gen/logger.h" -#include "gen/programs.h" -#include "gen/rttibuilder.h" -#include "gen/runtime.h" -#include "gen/structs.h" -#include "gen/todebug.h" -#include "gen/tollvm.h" -#include "gen/optimizer.h" - -#include "ir/irdsymbol.h" -#include "ir/irmodule.h" -#include "ir/irtype.h" -#include "ir/irvar.h" - -#if !MODULEINFO_IS_STRUCT -#include "ir/irtypeclass.h" -#endif - #if DMDV2 #define NEW_MODULEINFO_LAYOUT 1 #endif diff --git a/gen/naked.cpp b/gen/naked.cpp index c9e3baf6..63cce793 100644 --- a/gen/naked.cpp +++ b/gen/naked.cpp @@ -7,26 +7,23 @@ // //===----------------------------------------------------------------------===// +#include "expression.h" +#include "declaration.h" +#include "statement.h" +#include "template.h" +#include "gen/dvalue.h" +#include "gen/irstate.h" #include "gen/llvm.h" +#include "gen/llvmhelpers.h" +#include "gen/logger.h" +#include "gen/tollvm.h" #if LDC_LLVM_VER >= 303 #include "llvm/IR/InlineAsm.h" #else #include "llvm/InlineAsm.h" #endif - -#include "expression.h" -#include "statement.h" -#include "declaration.h" -#include "template.h" - #include -#include "gen/logger.h" -#include "gen/irstate.h" -#include "gen/llvmhelpers.h" -#include "gen/tollvm.h" -#include "gen/dvalue.h" - ////////////////////////////////////////////////////////////////////////////////////////// void Statement::toNakedIR(IRState *p) diff --git a/gen/nested.cpp b/gen/nested.cpp index 4166c6b6..e32e6447 100644 --- a/gen/nested.cpp +++ b/gen/nested.cpp @@ -8,15 +8,13 @@ //===----------------------------------------------------------------------===// #include "gen/nested.h" - #include "gen/dvalue.h" +#include "gen/functions.h" #include "gen/irstate.h" #include "gen/llvmhelpers.h" #include "gen/logger.h" -#include "gen/tollvm.h" -#include "gen/functions.h" #include "gen/todebug.h" - +#include "gen/tollvm.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/Support/CommandLine.h" namespace cl = llvm::cl; diff --git a/gen/optimizer.cpp b/gen/optimizer.cpp index 4f5ac5f4..fe01ff49 100644 --- a/gen/optimizer.cpp +++ b/gen/optimizer.cpp @@ -8,13 +8,12 @@ //===----------------------------------------------------------------------===// #include "gen/optimizer.h" +#include "mars.h" // error() #include "gen/cl_helpers.h" #include "gen/logger.h" - #include "gen/passes/Passes.h" - -#include "llvm/PassManager.h" #include "llvm/LinkAllPasses.h" +#include "llvm/PassManager.h" #if LDC_LLVM_VER >= 303 #include "llvm/IR/Module.h" #include "llvm/IR/DataLayout.h" @@ -35,8 +34,6 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/IPO/PassManagerBuilder.h" -#include "mars.h" // error() - using namespace llvm; // Allow the user to specify specific optimizations to run. diff --git a/gen/passes/SimplifyDRuntimeCalls.cpp b/gen/passes/SimplifyDRuntimeCalls.cpp index eeacab26..6747c377 100644 --- a/gen/passes/SimplifyDRuntimeCalls.cpp +++ b/gen/passes/SimplifyDRuntimeCalls.cpp @@ -17,7 +17,6 @@ #define DEBUG_TYPE "simplify-drtcalls" #include "Passes.h" - #include "llvm/Pass.h" #if LDC_LLVM_VER >= 303 #include "llvm/IR/Function.h" diff --git a/gen/pragma.cpp b/gen/pragma.cpp index 89b22ec5..85f293a5 100644 --- a/gen/pragma.cpp +++ b/gen/pragma.cpp @@ -9,11 +9,11 @@ #include "pragma.h" #include "attrib.h" -#include "id.h" -#include "expression.h" -#include "scope.h" -#include "module.h" #include "declaration.h" +#include "expression.h" +#include "id.h" +#include "module.h" +#include "scope.h" #include "template.h" #include "llvm/Support/CommandLine.h" diff --git a/gen/pragma.h b/gen/pragma.h index 6da5dc65..2763bd0b 100644 --- a/gen/pragma.h +++ b/gen/pragma.h @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef PRAGMA_H -#define PRAGMA_H +#ifndef LDC_GEN_PRAGMA_H +#define LDC_GEN_PRAGMA_H #include @@ -51,4 +51,4 @@ Pragma DtoGetPragma(Scope *sc, PragmaDeclaration *decl, std::string &arg1str); void DtoCheckPragma(PragmaDeclaration *decl, Dsymbol *sym, Pragma llvm_internal, const std::string &arg1str); -#endif // PRAGMA_H +#endif // LDC_GEN_PRAGMA_H diff --git a/gen/programs.cpp b/gen/programs.cpp index b36d2c8b..a4df987d 100644 --- a/gen/programs.cpp +++ b/gen/programs.cpp @@ -8,13 +8,11 @@ //===----------------------------------------------------------------------===// #include "gen/programs.h" - +#include "mars.h" // fatal() +#include "root.h" // error(char*) #include "llvm/Support/CommandLine.h" #include "llvm/Support/Program.h" -#include "root.h" // error(char*) -#include "mars.h" // fatal() - using namespace llvm; static cl::opt gcc("gcc", diff --git a/gen/rttibuilder.cpp b/gen/rttibuilder.cpp index 0aede9ff..7e327645 100644 --- a/gen/rttibuilder.cpp +++ b/gen/rttibuilder.cpp @@ -7,18 +7,15 @@ // //===----------------------------------------------------------------------===// -#include "gen/llvm.h" - +#include "gen/rttibuilder.h" #include "aggregate.h" #include "mtype.h" - #include "gen/arrays.h" #include "gen/irstate.h" #include "gen/linkage.h" +#include "gen/llvm.h" #include "gen/llvmhelpers.h" -#include "gen/rttibuilder.h" #include "gen/tollvm.h" - #include "ir/irstruct.h" RTTIBuilder::RTTIBuilder(AggregateDeclaration* base_class) diff --git a/gen/rttibuilder.h b/gen/rttibuilder.h index 5d7eeeb1..a539bb45 100644 --- a/gen/rttibuilder.h +++ b/gen/rttibuilder.h @@ -12,22 +12,25 @@ // //===----------------------------------------------------------------------===// -#ifndef __LDC_GEN_RTTIBUILDER_H__ -#define __LDC_GEN_RTTIBUILDER_H__ +#ifndef LDC_GEN_RTTIBUILDER_H +#define LDC_GEN_RTTIBUILDER_H +#include "llvm/ADT/SmallVector.h" #if LDC_LLVM_VER >= 303 #include "llvm/IR/Constant.h" #else #include "llvm/Constant.h" #endif -#include "llvm/ADT/SmallVector.h" -struct ClassDeclaration; struct AggregateDeclaration; -struct TypeClass; -struct Type; - +struct ClassDeclaration; +struct Dsymbol; +struct FuncDeclaration; +struct IrGlobal; struct IrStruct; +struct Type; +struct TypeClass; +namespace llvm { class StructType; } struct RTTIBuilder { @@ -75,10 +78,10 @@ struct RTTIBuilder /// Creates the initializer constant and assigns it to the global. void finalize(IrGlobal* tid); - void finalize(LLType* type, LLValue* value); + void finalize(llvm::Type* type, llvm::Value* value); /// Creates the initializer constant and assigns it to the global. - llvm::Constant* get_constant(LLStructType *initType); + llvm::Constant* get_constant(llvm::StructType* initType); }; #endif diff --git a/gen/runtime.cpp b/gen/runtime.cpp index df3a8758..3c63aa16 100644 --- a/gen/runtime.cpp +++ b/gen/runtime.cpp @@ -7,7 +7,22 @@ // //===----------------------------------------------------------------------===// +#include "gen/runtime.h" +#include "aggregate.h" +#include "dsymbol.h" +#include "lexer.h" +#include "mars.h" +#include "module.h" +#include "mtype.h" +#include "root.h" +#include "gen/irstate.h" #include "gen/llvm.h" +#include "gen/logger.h" +#include "gen/tollvm.h" +#include "ir/irtype.h" +#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/MemoryBuffer.h" #if LDC_LLVM_VER >= 303 #include "llvm/IR/Module.h" #include "llvm/IR/Attributes.h" @@ -15,23 +30,6 @@ #include "llvm/Module.h" #include "llvm/Attributes.h" #endif -#include "llvm/Bitcode/ReaderWriter.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/CommandLine.h" - -#include "root.h" -#include "mars.h" -#include "lexer.h" -#include "dsymbol.h" -#include "mtype.h" -#include "aggregate.h" -#include "module.h" - -#include "gen/runtime.h" -#include "gen/logger.h" -#include "gen/tollvm.h" -#include "gen/irstate.h" -#include "ir/irtype.h" #if LDC_LLVM_VER < 302 using namespace llvm::Attribute; diff --git a/gen/runtime.h b/gen/runtime.h index db494059..05e62c09 100644 --- a/gen/runtime.h +++ b/gen/runtime.h @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LDC_GEN_RUNTIME_H_ -#define LDC_GEN_RUNTIME_H_ +#ifndef LDC_GEN_RUNTIME_H +#define LDC_GEN_RUNTIME_H namespace llvm { @@ -40,4 +40,4 @@ llvm::GlobalVariable* LLVM_D_GetRuntimeGlobal(llvm::Module* target, const char* #define _adCmp "_adCmp2" #endif -#endif // LDC_GEN_RUNTIME_H_ +#endif // LDC_GEN_RUNTIME_H diff --git a/gen/statements.cpp b/gen/statements.cpp index 8c6fbeee..09fcefc3 100644 --- a/gen/statements.cpp +++ b/gen/statements.cpp @@ -7,39 +7,37 @@ // //===----------------------------------------------------------------------===// - -#include -#include -#include - +#include "init.h" +#include "mars.h" +#include "module.h" +#include "mtype.h" +#include "port.h" +#include "gen/abi.h" +#include "gen/arrays.h" +#include "gen/dvalue.h" +#include "gen/irstate.h" #include "gen/llvm.h" +#include "gen/llvmhelpers.h" +#include "gen/logger.h" +#include "gen/runtime.h" +#include "gen/todebug.h" +#include "gen/tollvm.h" +#include "ir/irfunction.h" +#include "ir/irlandingpad.h" +#include "ir/irmodule.h" +#include "llvm/Support/CFG.h" #if LDC_LLVM_VER >= 303 #include "llvm/IR/InlineAsm.h" #else #include "llvm/InlineAsm.h" #endif -#include "llvm/Support/CFG.h" +#include +#include +#include -#include "mars.h" -#include "init.h" -#include "mtype.h" +// Need to include this after the other DMD includes because of missing +// dependencies. #include "hdrgen.h" -#include "port.h" -#include "module.h" - -#include "gen/irstate.h" -#include "gen/logger.h" -#include "gen/tollvm.h" -#include "gen/llvmhelpers.h" -#include "gen/runtime.h" -#include "gen/arrays.h" -#include "gen/todebug.h" -#include "gen/dvalue.h" -#include "gen/abi.h" - -#include "ir/irfunction.h" -#include "ir/irmodule.h" -#include "ir/irlandingpad.h" ////////////////////////////////////////////////////////////////////////////// diff --git a/gen/structs.cpp b/gen/structs.cpp index 44ec0dd1..d428f113 100644 --- a/gen/structs.cpp +++ b/gen/structs.cpp @@ -7,29 +7,25 @@ // //===----------------------------------------------------------------------===// -#include - -#include "gen/llvm.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/Support/ManagedStatic.h" - -#include "mtype.h" #include "aggregate.h" -#include "init.h" #include "declaration.h" - -#include "gen/irstate.h" -#include "gen/tollvm.h" -#include "gen/llvmhelpers.h" +#include "init.h" +#include "mtype.h" #include "gen/arrays.h" -#include "gen/logger.h" -#include "gen/structs.h" #include "gen/dvalue.h" #include "gen/functions.h" +#include "gen/irstate.h" +#include "gen/llvm.h" +#include "gen/llvmhelpers.h" +#include "gen/logger.h" +#include "gen/structs.h" +#include "gen/tollvm.h" #include "gen/utils.h" - #include "ir/irstruct.h" #include "ir/irtypestruct.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/Support/ManagedStatic.h" +#include ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/gen/structs.h b/gen/structs.h index f0a77913..165a3d46 100644 --- a/gen/structs.h +++ b/gen/structs.h @@ -11,10 +11,23 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVMD_GEN_STRUCTS_H -#define LLVMD_GEN_STRUCTS_H +#ifndef LDC_GEN_STRUCTS_H +#define LDC_GEN_STRUCTS_H +#include "lexer.h" +#include + +struct DValue; +struct StructDeclaration; struct StructInitializer; +struct Type; +struct VarDeclaration; +namespace llvm +{ + class Constant; + class Type; + class Value; +} /** * Sets up codegen metadata and emits global data (.init, etc.), if needed. @@ -24,31 +37,30 @@ struct StructInitializer; void DtoResolveStruct(StructDeclaration* sd); /// Build constant struct initializer. -LLConstant* DtoConstStructInitializer(StructInitializer* si); +llvm::Constant* DtoConstStructInitializer(StructInitializer* si); /// Build values for a struct literal. std::vector DtoStructLiteralValues(const StructDeclaration* sd, - const std::vector& inits, - bool isConst = false); + const std::vector& inits, bool isConst = false); /// Returns a boolean=true if the two structs are equal. -LLValue* DtoStructEquals(TOK op, DValue* lhs, DValue* rhs); +llvm::Value* DtoStructEquals(TOK op, DValue* lhs, DValue* rhs); /// index a struct one level -LLValue* DtoIndexStruct(LLValue* src, StructDeclaration* sd, VarDeclaration* vd); +llvm::Value* DtoIndexStruct(llvm::Value* src, StructDeclaration* sd, VarDeclaration* vd); /// Return the type returned by DtoUnpaddedStruct called on a value of the /// specified type. /// Union types will get expanded into a struct, with a type for each member. -LLType* DtoUnpaddedStructType(Type* dty); +llvm::Type* DtoUnpaddedStructType(Type* dty); /// Return the struct value represented by v without the padding fields. /// Unions will be expanded, with a value for each member. /// Note: v must be a pointer to a struct, but the return value will be a /// first-class struct value. -LLValue* DtoUnpaddedStruct(Type* dty, LLValue* v); +llvm::Value* DtoUnpaddedStruct(Type* dty, llvm::Value* v); /// Undo the transformation performed by DtoUnpaddedStruct, writing to lval. -void DtoPaddedStruct(Type* dty, LLValue* v, LLValue* lval); +void DtoPaddedStruct(Type* dty, llvm::Value* v, llvm::Value* lval); #endif diff --git a/gen/tocall.cpp b/gen/tocall.cpp index 407517cb..23233ef9 100644 --- a/gen/tocall.cpp +++ b/gen/tocall.cpp @@ -7,21 +7,18 @@ // //===----------------------------------------------------------------------===// -#include "gen/llvm.h" - -#include "mtype.h" #include "declaration.h" #include "id.h" - -#include "gen/tollvm.h" -#include "gen/llvmhelpers.h" -#include "gen/irstate.h" +#include "mtype.h" +#include "gen/abi.h" #include "gen/dvalue.h" #include "gen/functions.h" -#include "gen/abi.h" -#include "gen/nested.h" - +#include "gen/irstate.h" +#include "gen/llvm.h" +#include "gen/llvmhelpers.h" #include "gen/logger.h" +#include "gen/nested.h" +#include "gen/tollvm.h" ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/gen/todebug.cpp b/gen/todebug.cpp index 6e0e80f2..e6605432 100644 --- a/gen/todebug.cpp +++ b/gen/todebug.cpp @@ -7,26 +7,23 @@ // //===----------------------------------------------------------------------===// +#include "gen/todebug.h" +#include "declaration.h" +#include "mars.h" +#include "module.h" +#include "gen/irstate.h" +#include "gen/linkage.h" #include "gen/llvm.h" +#include "gen/llvmhelpers.h" +#include "gen/logger.h" +#include "gen/tollvm.h" +#include "gen/utils.h" +#include "ir/irmodule.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" -#include "declaration.h" -#include "module.h" -#include "mars.h" - -#include "gen/todebug.h" -#include "gen/irstate.h" -#include "gen/tollvm.h" -#include "gen/logger.h" -#include "gen/llvmhelpers.h" -#include "gen/linkage.h" -#include "gen/utils.h" - -#include "ir/irmodule.h" - using namespace llvm::dwarf; ////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/gen/todebug.h b/gen/todebug.h index 0e572bae..94468aaa 100644 --- a/gen/todebug.h +++ b/gen/todebug.h @@ -14,8 +14,8 @@ #ifndef LDC_GEN_TODEBUG_H #define LDC_GEN_TODEBUG_H -#include "gen/tollvm.h" #include "gen/irstate.h" +#include "gen/tollvm.h" void RegisterDwarfSymbols(llvm::Module* mod); diff --git a/gen/toir.cpp b/gen/toir.cpp index 9ce08d40..016f5ad2 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -7,44 +7,40 @@ // //===----------------------------------------------------------------------===// -#include -#include -#include - -#include "gen/llvm.h" -#include "llvm/Support/CommandLine.h" - #include "attrib.h" +#include "enum.h" +#include "hdrgen.h" +#include "id.h" #include "init.h" #include "mtype.h" -#include "template.h" -#include "hdrgen.h" #include "port.h" #include "rmem.h" -#include "id.h" -#include "enum.h" - -#include "gen/irstate.h" -#include "gen/logger.h" -#include "gen/tollvm.h" -#include "gen/llvmhelpers.h" -#include "gen/runtime.h" +#include "template.h" +#include "gen/aa.h" #include "gen/arrays.h" -#include "gen/structs.h" #include "gen/classes.h" -#include "gen/typeinf.h" #include "gen/complex.h" #include "gen/dvalue.h" -#include "gen/aa.h" #include "gen/functions.h" -#include "gen/todebug.h" +#include "gen/irstate.h" +#include "gen/llvm.h" +#include "gen/llvmhelpers.h" +#include "gen/logger.h" #include "gen/nested.h" -#include "gen/utils.h" -#include "gen/warnings.h" #include "gen/optimizer.h" #include "gen/pragma.h" - +#include "gen/runtime.h" +#include "gen/structs.h" +#include "gen/todebug.h" +#include "gen/tollvm.h" +#include "gen/typeinf.h" +#include "gen/utils.h" +#include "gen/warnings.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/ManagedStatic.h" +#include +#include +#include llvm::cl::opt checkPrintf("check-printf-calls", llvm::cl::desc("Validate printf call format strings against arguments"), diff --git a/gen/tollvm.cpp b/gen/tollvm.cpp index e301eebd..85347fb9 100644 --- a/gen/tollvm.cpp +++ b/gen/tollvm.cpp @@ -7,30 +7,27 @@ // //===----------------------------------------------------------------------===// -#include "gen/llvm.h" - -#include "dsymbol.h" +#include "gen/tollvm.h" #include "aggregate.h" #include "declaration.h" -#include "init.h" +#include "dsymbol.h" #include "id.h" +#include "init.h" #include "module.h" - -#include "gen/tollvm.h" -#include "gen/irstate.h" -#include "gen/logger.h" -#include "gen/runtime.h" #include "gen/arrays.h" +#include "gen/classes.h" +#include "gen/complex.h" #include "gen/dvalue.h" #include "gen/functions.h" -#include "gen/structs.h" -#include "gen/classes.h" -#include "gen/typeinf.h" -#include "gen/complex.h" -#include "gen/llvmhelpers.h" +#include "gen/irstate.h" #include "gen/linkage.h" +#include "gen/llvm.h" +#include "gen/llvmhelpers.h" +#include "gen/logger.h" #include "gen/pragma.h" - +#include "gen/runtime.h" +#include "gen/structs.h" +#include "gen/typeinf.h" #include "ir/irtype.h" #include "ir/irtypeclass.h" #include "ir/irtypefunction.h" diff --git a/gen/tollvm.h b/gen/tollvm.h index 3b0ef8a9..4f473e45 100644 --- a/gen/tollvm.h +++ b/gen/tollvm.h @@ -16,12 +16,11 @@ #ifndef LDC_GEN_TOLLVM_H #define LDC_GEN_TOLLVM_H -#include "gen/llvm.h" -#include "lexer.h" -#include "mtype.h" #include "attrib.h" #include "declaration.h" - +#include "lexer.h" +#include "mtype.h" +#include "gen/llvm.h" #include "gen/structs.h" // D->LLVM type handling stuff diff --git a/gen/typeinf.h b/gen/typeinf.h index fe993a78..7a77ad5b 100644 --- a/gen/typeinf.h +++ b/gen/typeinf.h @@ -15,6 +15,7 @@ #ifndef LDC_GEN_TYPEINF_H #define LDC_GEN_TYPEINF_H +struct TypeInfoDeclaration; void DtoResolveTypeInfo(TypeInfoDeclaration* tid); void DtoDeclareTypeInfo(TypeInfoDeclaration* tid); void DtoConstInitTypeInfo(TypeInfoDeclaration* tid); diff --git a/gen/typinf.cpp b/gen/typinf.cpp index 784cd5ca..404c450d 100644 --- a/gen/typinf.cpp +++ b/gen/typinf.cpp @@ -20,39 +20,35 @@ // Copyright (c) 2007 by Tomas Lindquist Olsen // tomas at famolsen dk -#include -#include - -#include "gen/llvm.h" - +#include "aggregate.h" +#include "attrib.h" +#include "declaration.h" +#include "enum.h" +#include "expression.h" +#include "id.h" +#include "import.h" +#include "init.h" #include "mars.h" #include "module.h" #include "mtype.h" #include "scope.h" -#include "init.h" -#include "expression.h" -#include "attrib.h" -#include "declaration.h" #include "template.h" -#include "id.h" -#include "enum.h" -#include "import.h" -#include "aggregate.h" - -#include "gen/irstate.h" -#include "gen/logger.h" -#include "gen/runtime.h" -#include "gen/tollvm.h" -#include "gen/llvmhelpers.h" #include "gen/arrays.h" -#include "gen/structs.h" #include "gen/classes.h" +#include "gen/irstate.h" #include "gen/linkage.h" +#include "gen/llvm.h" +#include "gen/llvmhelpers.h" +#include "gen/logger.h" #include "gen/metadata.h" #include "gen/rttibuilder.h" - -#include "ir/irvar.h" +#include "gen/runtime.h" +#include "gen/structs.h" +#include "gen/tollvm.h" #include "ir/irtype.h" +#include "ir/irvar.h" +#include +#include #include /******************************************* diff --git a/gen/utils.h b/gen/utils.h index 8d7c1e6e..b2c57b24 100644 --- a/gen/utils.h +++ b/gen/utils.h @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef __LDC_GEN_UTILS_H__ -#define __LDC_GEN_UTILS_H__ +#ifndef LDC_GEN_UTILS_H +#define LDC_GEN_UTILS_H #include "root.h" diff --git a/gen/warnings.cpp b/gen/warnings.cpp index f3b59846..93268115 100644 --- a/gen/warnings.cpp +++ b/gen/warnings.cpp @@ -7,11 +7,8 @@ // //===----------------------------------------------------------------------===// -#include "mars.h" -#include "mtype.h" -#include "expression.h" - #include "gen/warnings.h" +#include "mtype.h" void warnInvalidPrintfCall(Loc loc, Expression* arguments, size_t nargs) { diff --git a/gen/warnings.h b/gen/warnings.h index 7367c6d2..f08c21b4 100644 --- a/gen/warnings.h +++ b/gen/warnings.h @@ -11,9 +11,12 @@ // //===----------------------------------------------------------------------===// -#ifndef __LDC_GEN_WARNINGS_H__ -#define __LDC_GEN_WARNINGS_H__ +#ifndef LDC_GEN_WARNINGS_H +#define LDC_GEN_WARNINGS_H + +#include "expression.h" +#include "mars.h" void warnInvalidPrintfCall(Loc loc, Expression* arguments, size_t nargs); -#endif // __LDC_GEN_WARNINGS_H__ +#endif // LDC_GEN_WARNINGS_H diff --git a/ir/ir.h b/ir/ir.h index dbca3572..ecf28dc7 100644 --- a/ir/ir.h +++ b/ir/ir.h @@ -16,10 +16,9 @@ #ifndef LDC_IR_IR_H #define LDC_IR_IR_H -#include - -#include "ir/irforw.h" #include "root.h" +#include "ir/irforw.h" +#include struct IRState; struct IrFunction; diff --git a/ir/irdsymbol.cpp b/ir/irdsymbol.cpp index 598001b9..290cfcbc 100644 --- a/ir/irdsymbol.cpp +++ b/ir/irdsymbol.cpp @@ -8,12 +8,11 @@ //===----------------------------------------------------------------------===// #include "gen/llvm.h" +#include "gen/logger.h" #include "ir/ir.h" #include "ir/irdsymbol.h" #include "ir/irvar.h" -#include "gen/logger.h" - std::set IrDsymbol::list; void IrDsymbol::resetAll() diff --git a/ir/irfunction.cpp b/ir/irfunction.cpp index 2f825850..cc49a65e 100644 --- a/ir/irfunction.cpp +++ b/ir/irfunction.cpp @@ -10,7 +10,6 @@ #include "gen/llvm.h" #include "gen/tollvm.h" #include "ir/irfunction.h" - #include FuncGen::FuncGen() diff --git a/ir/irfunction.h b/ir/irfunction.h index 0e4ef450..fcc1082d 100644 --- a/ir/irfunction.h +++ b/ir/irfunction.h @@ -19,10 +19,9 @@ #include "gen/llvm.h" #include "ir/ir.h" #include "ir/irlandingpad.h" - -#include -#include #include +#include +#include struct Statement; struct EnclosingHandler; diff --git a/ir/irfuncty.cpp b/ir/irfuncty.cpp index 05ed7d97..be66f086 100644 --- a/ir/irfuncty.cpp +++ b/ir/irfuncty.cpp @@ -8,13 +8,11 @@ //===----------------------------------------------------------------------===// #include "ir/irfuncty.h" - #include "mtype.h" - #include "gen/abi.h" #include "gen/dvalue.h" -#include "gen/logger.h" #include "gen/llvm.h" +#include "gen/logger.h" #include "gen/tollvm.h" #if LDC_LLVM_VER >= 303 diff --git a/ir/irlandingpad.cpp b/ir/irlandingpad.cpp index 900ff773..8f4c25ca 100644 --- a/ir/irlandingpad.cpp +++ b/ir/irlandingpad.cpp @@ -8,13 +8,13 @@ //===----------------------------------------------------------------------===// #include "gen/llvm.h" -#include "gen/tollvm.h" -#include "gen/irstate.h" -#include "gen/runtime.h" -#include "gen/logger.h" #include "gen/classes.h" +#include "gen/irstate.h" #include "gen/llvmhelpers.h" +#include "gen/logger.h" +#include "gen/runtime.h" #include "gen/todebug.h" +#include "gen/tollvm.h" #include "ir/irlandingpad.h" IRLandingPadInfo::IRLandingPadInfo(Catch* catchstmt_, llvm::BasicBlock* end_) : diff --git a/ir/irlandingpad.h b/ir/irlandingpad.h index e3789882..904a5cff 100644 --- a/ir/irlandingpad.h +++ b/ir/irlandingpad.h @@ -15,9 +15,8 @@ #ifndef LDC_IR_IRLANDINGPADINFO_H #define LDC_IR_IRLANDINGPADINFO_H -#include "ir/ir.h" #include "statement.h" - +#include "ir/ir.h" #include #include diff --git a/ir/irmodule.cpp b/ir/irmodule.cpp index 80d32a66..eab29ff8 100644 --- a/ir/irmodule.cpp +++ b/ir/irmodule.cpp @@ -8,8 +8,8 @@ //===----------------------------------------------------------------------===// #include "gen/llvm.h" -#include "gen/tollvm.h" #include "gen/irstate.h" +#include "gen/tollvm.h" #include "ir/irmodule.h" IrModule::IrModule(Module* module, const char* srcfilename) diff --git a/ir/irstruct.cpp b/ir/irstruct.cpp index 046e41b2..db7410e3 100644 --- a/ir/irstruct.cpp +++ b/ir/irstruct.cpp @@ -8,21 +8,17 @@ //===----------------------------------------------------------------------===// #include "gen/llvm.h" - -#include "mtype.h" #include "aggregate.h" #include "declaration.h" #include "init.h" - +#include "mtype.h" #include "gen/irstate.h" -#include "gen/tollvm.h" -#include "gen/logger.h" #include "gen/llvmhelpers.h" +#include "gen/logger.h" +#include "gen/tollvm.h" #include "gen/utils.h" - #include "ir/irstruct.h" #include "ir/irtypeclass.h" - #include ////////////////////////////////////////////////////////////////////////////// diff --git a/ir/irstruct.h b/ir/irstruct.h index 535f8807..28c8f01d 100644 --- a/ir/irstruct.h +++ b/ir/irstruct.h @@ -16,9 +16,8 @@ #define LDC_IR_IRSTRUCT_H #include "ir/ir.h" - -#include #include +#include // DMD forward declarations struct StructInitializer; diff --git a/utils/gen_gccbuiltins.cpp b/utils/gen_gccbuiltins.cpp index 5c095acb..de309440 100644 --- a/utils/gen_gccbuiltins.cpp +++ b/utils/gen_gccbuiltins.cpp @@ -13,22 +13,20 @@ // //===----------------------------------------------------------------------===// -#include -#include -#include - -#include -#include -#include - #include "llvm/TableGen/Main.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/PathV1.h" +#include "llvm/TableGen/Record.h" #if LDC_LLVM_VER < 302 #include "llvm/TableGen/TableGenAction.h" #endif -#include "llvm/TableGen/Record.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/PathV1.h" -#include "llvm/ADT/StringRef.h" +#include +#include +#include +#include +#include +#include using namespace std; using namespace llvm;