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.
This commit is contained in:
David Nadlinger
2013-02-07 21:20:55 +01:00
parent 5616753768
commit 0a96aea868
80 changed files with 550 additions and 614 deletions
+2 -5
View File
@@ -9,7 +9,8 @@
#include "driver/cl_options.h" #include "driver/cl_options.h"
#include "gen/cl_helpers.h" #include "gen/cl_helpers.h"
#include "gen/logger.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#if LDC_LLVM_VER >= 303 #if LDC_LLVM_VER >= 303
#include "llvm/IR/DataLayout.h" #include "llvm/IR/DataLayout.h"
@@ -19,10 +20,6 @@
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#endif #endif
#include "gen/logger.h"
#include "llvm/Support/CommandLine.h"
namespace opts { namespace opts {
// Positional options first, in order: // Positional options first, in order:
+4 -6
View File
@@ -12,17 +12,15 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LDC_CL_OPTIONS_H #ifndef LDC_DRIVER_CL_OPTIONS_H
#define LDC_CL_OPTIONS_H #define LDC_DRIVER_CL_OPTIONS_H
#include "mars.h" #include "mars.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Support/CommandLine.h"
#include <deque> #include <deque>
#include <vector> #include <vector>
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/CodeGen.h"
namespace opts { namespace opts {
namespace cl = llvm::cl; namespace cl = llvm::cl;
+7 -11
View File
@@ -7,19 +7,15 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include <iostream> #include "driver/configfile.h"
#include <string> #include "mars.h"
#include <cassert> #include "libconfig.h++"
#include <cstring>
#include "llvm/Support/FileSystem.h" #include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h" #include "llvm/Support/Path.h"
#include <cassert>
#include "libconfig.h++" #include <cstring>
#include <iostream>
#include "driver/configfile.h" #include <string>
#include "mars.h"
namespace sys = llvm::sys; namespace sys = llvm::sys;
+6 -4
View File
@@ -11,11 +11,13 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LDC_CONF_CONFIGFILE_H #ifndef LDC_DRIVER_CONFIGFILE_H
#define LDC_CONF_CONFIGFILE_H #define LDC_DRIVER_CONFIGFILE_H
#include <vector>
#include <string> #include <string>
#include <vector>
namespace llvm { namespace sys { class Path; } }
namespace libconfig namespace libconfig
{ {
@@ -48,4 +50,4 @@ private:
s_vector switches; s_vector switches;
}; };
#endif // LDC_CONF_CONFIGFILE_H #endif // LDC_DRIVER_CONFIGFILE_H
+4 -4
View File
@@ -48,6 +48,10 @@
# error "Please define LDC_EXE_NAME to the name of the LDC executable to use." # error "Please define LDC_EXE_NAME to the name of the LDC executable to use."
#endif #endif
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/SystemUtils.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert> #include <cassert>
#include <cerrno> #include <cerrno>
#include <climits> #include <climits>
@@ -56,10 +60,6 @@
#include <cstdlib> #include <cstdlib>
#include <numeric> #include <numeric>
#include <vector> #include <vector>
#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 #ifdef HAVE_SC_ARG_MAX
# include <unistd.h> # include <unistd.h>
+9 -12
View File
@@ -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 "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/ADT/Triple.h"
#include "llvm/Linker.h"
#include "llvm/Support/FileSystem.h" #include "llvm/Support/FileSystem.h"
#include "llvm/Support/Program.h" #include "llvm/Support/Program.h"
#if _WIN32 #if _WIN32
#include "llvm/Support/SystemUtils.h" #include "llvm/Support/SystemUtils.h"
#endif #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? // Is this useful?
+3 -3
View File
@@ -12,8 +12,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LDC_GEN_LINKER_H #ifndef LDC_DRIVER_LINKER_H
#define LDC_GEN_LINKER_H #define LDC_DRIVER_LINKER_H
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include <vector> #include <vector>
@@ -55,4 +55,4 @@ void deleteExecutable();
*/ */
int runExecutable(); int runExecutable();
#endif // LDC_GEN_LINKER_H #endif // LDC_DRIVER_LINKER_H
+33 -37
View File
@@ -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/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/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 #if LDC_LLVM_VER >= 303
#include "llvm/LinkAllIR.h" #include "llvm/LinkAllIR.h"
#include "llvm/IR/LLVMContext.h" #include "llvm/IR/LLVMContext.h"
@@ -17,54 +41,26 @@
#include "llvm/LinkAllVMCore.h" #include "llvm/LinkAllVMCore.h"
#include "llvm/LLVMContext.h" #include "llvm/LLVMContext.h"
#endif #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 <stdio.h>
#include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <limits.h> #include <limits.h>
#include <stdio.h>
#include "rmem.h" #include <stdlib.h>
#include "root.h" #if POSIX
#include <errno.h>
#elif _WIN32
#include <windows.h>
#endif
// stricmp // stricmp
#if __GNUC__ && !_WIN32 #if __GNUC__ && !_WIN32
#include "gnuc.h" #include "gnuc.h"
#endif #endif
#include "mars.h" // Needs Type already declared.
#include "module.h"
#include "mtype.h"
#include "id.h"
#include "cond.h" #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; using namespace opts;
#include "driver/configfile.h"
#include "driver/toobj.h"
#if POSIX
#include <errno.h>
#elif _WIN32
#include <windows.h>
#endif
extern void getenv_setargv(const char *envvar, int *pargc, char** *pargv); extern void getenv_setargv(const char *envvar, int *pargc, char** *pargv);
extern void backend_init(); extern void backend_init();
extern void backend_term(); extern void backend_term();
+11 -13
View File
@@ -7,26 +7,24 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include <cstddef> #include "driver/toobj.h"
#include <fstream> #include "gen/irstate.h"
#include "gen/logger.h"
#include "gen/optimizer.h"
#include "llvm/Analysis/Verifier.h" #include "llvm/Analysis/Verifier.h"
#include "llvm/Bitcode/ReaderWriter.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 #if LDC_LLVM_VER >= 303
#include "llvm/IR/Module.h" #include "llvm/IR/Module.h"
#else #else
#include "llvm/Module.h" #include "llvm/Module.h"
#endif #endif
#include "llvm/PassManager.h" #include <cstddef>
#include "llvm/Support/Program.h" #include <fstream>
#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"
// fwd decl // fwd decl
void emit_file(llvm::TargetMachine &Target, llvm::Module& m, llvm::raw_fd_ostream& Out, void emit_file(llvm::TargetMachine &Target, llvm::Module& m, llvm::raw_fd_ostream& Out,
+6 -2
View File
@@ -11,8 +11,12 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LDC_GEN_TOOBJ_H #ifndef LDC_DRIVER_TOOBJ_H
#define LDC_GEN_TOOBJ_H #define LDC_DRIVER_TOOBJ_H
#include <string>
namespace llvm { class Module; }
void writeModule(llvm::Module* m, std::string filename); void writeModule(llvm::Module* m, std::string filename);
+9 -11
View File
@@ -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/aa.h"
#include "gen/runtime.h" #include "aggregate.h"
#include "gen/tollvm.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/llvmhelpers.h"
#include "gen/logger.h" #include "gen/logger.h"
#include "gen/irstate.h" #include "gen/runtime.h"
#include "gen/dvalue.h" #include "gen/tollvm.h"
#include "ir/irmodule.h" #include "ir/irmodule.h"
#if DMDV2 #if DMDV2
+9 -2
View File
@@ -11,13 +11,20 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LDC_GEN_AA_H #ifndef LDC_GEN_AA_H
#define 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* DtoAAIndex(Loc& loc, Type* type, DValue* aa, DValue* key, bool lvalue);
DValue* DtoAAIn(Loc& loc, Type* type, DValue* aa, DValue* key); DValue* DtoAAIn(Loc& loc, Type* type, DValue* aa, DValue* key);
DValue* DtoAARemove(Loc& loc, 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 #endif // LDC_GEN_AA_H
+6 -3
View File
@@ -11,12 +11,15 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LDC_GEN_ABI_GENERIC #ifndef LDC_GEN_ABI_GENERIC_H
#define LDC_GEN_ABI_GENERIC #define LDC_GEN_ABI_GENERIC_H
#include "gen/abi.h"
#include "gen/irstate.h"
#include "gen/llvmhelpers.h" #include "gen/llvmhelpers.h"
#include "gen/tollvm.h" #include "gen/logger.h"
#include "gen/structs.h" #include "gen/structs.h"
#include "gen/tollvm.h"
/// Removes padding fields for (non-union-containing!) structs /// Removes padding fields for (non-union-containing!) structs
struct RemoveStructPadding : ABIRewrite { struct RemoveStructPadding : ABIRewrite {
+5 -4
View File
@@ -12,11 +12,12 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/abi-ppc64.h"
#include "gen/abi.h" #include "gen/abi.h"
#include "gen/irstate.h"
#include "gen/tollvm.h"
#include "gen/llvmhelpers.h"
#include "gen/dvalue.h" #include "gen/dvalue.h"
#include "gen/irstate.h"
#include "gen/llvmhelpers.h"
#include "gen/tollvm.h"
struct PPC64TargetABI : TargetABI { struct PPC64TargetABI : TargetABI {
@@ -56,4 +57,4 @@ struct PPC64TargetABI : TargetABI {
TargetABI* getPPC64TargetABI() TargetABI* getPPC64TargetABI()
{ {
return new PPC64TargetABI(); return new PPC64TargetABI();
} }
+3 -5
View File
@@ -11,13 +11,11 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __LDC_GEN_ABI_PPC64_H__ #ifndef LDC_GEN_ABI_PPC64_H
#define __LDC_GEN_ABI_PPC64_H__ #define LDC_GEN_ABI_PPC64_H
#include "gen/abi.h"
struct TargetABI;
TargetABI* getPPC64TargetABI(); TargetABI* getPPC64TargetABI();
#endif #endif
+9 -10
View File
@@ -43,21 +43,20 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "mtype.h" #include "gen/abi-x86-64.h"
#include "declaration.h"
#include "aggregate.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/irstate.h"
#include "gen/llvm.h" #include "gen/llvm.h"
#include "gen/tollvm.h"
#include "gen/logger.h"
#include "gen/dvalue.h"
#include "gen/llvmhelpers.h" #include "gen/llvmhelpers.h"
#include "gen/abi.h" #include "gen/logger.h"
#include "gen/abi-x86-64.h" #include "gen/tollvm.h"
#include "gen/abi-generic.h"
#include "ir/irfunction.h" #include "ir/irfunction.h"
#include <cassert> #include <cassert>
#include <map> #include <map>
#include <string> #include <string>
+3 -5
View File
@@ -11,13 +11,11 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __LDC_GEN_ABI_X86_64_H__ #ifndef LDC_GEN_ABI_X86_64_H
#define __LDC_GEN_ABI_X86_64_H__ #define LDC_GEN_ABI_X86_64_H
#include "gen/abi.h"
struct TargetABI;
TargetABI* getX86_64TargetABI(); TargetABI* getX86_64TargetABI();
#endif #endif
+4 -6
View File
@@ -8,16 +8,14 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h" #include "gen/llvm.h"
#include "mars.h" #include "mars.h"
#include "gen/abi-generic.h"
#include "gen/abi.h"
#include "gen/dvalue.h"
#include "gen/irstate.h" #include "gen/irstate.h"
#include "gen/llvmhelpers.h" #include "gen/llvmhelpers.h"
#include "gen/tollvm.h"
#include "gen/abi.h"
#include "gen/logger.h" #include "gen/logger.h"
#include "gen/dvalue.h" #include "gen/tollvm.h"
#include "gen/abi-generic.h"
#include "ir/irfunction.h" #include "ir/irfunction.h"
#include "ir/irfuncty.h" #include "ir/irfuncty.h"
+3 -4
View File
@@ -11,11 +11,10 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __LDC_GEN_ABI_X86_H__ #ifndef LDC_GEN_ABI_X86_H
#define __LDC_GEN_ABI_X86_H__ #define LDC_GEN_ABI_X86_H
#include "gen/abi.h"
struct TargetABI;
TargetABI* getX86TargetABI(); TargetABI* getX86TargetABI();
#endif #endif
+9 -12
View File
@@ -7,24 +7,21 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h"
#include <algorithm>
#include "mars.h"
#include "gen/irstate.h"
#include "gen/llvmhelpers.h"
#include "gen/tollvm.h"
#include "gen/abi.h" #include "gen/abi.h"
#include "gen/logger.h" #include "mars.h"
#include "gen/dvalue.h"
#include "gen/abi-generic.h" #include "gen/abi-generic.h"
#include "gen/abi-ppc64.h" #include "gen/abi-ppc64.h"
#include "gen/abi-x86.h"
#include "gen/abi-x86-64.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/irfunction.h"
#include "ir/irfuncty.h" #include "ir/irfuncty.h"
#include <algorithm>
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
+2 -2
View File
@@ -14,8 +14,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __LDC_GEN_ABI_H__ #ifndef LDC_GEN_ABI_H
#define __LDC_GEN_ABI_H__ #define LDC_GEN_ABI_H
#include <vector> #include <vector>
+10 -12
View File
@@ -7,22 +7,20 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h" #include "gen/arrays.h"
#include "mtype.h"
#include "module.h"
#include "dsymbol.h"
#include "aggregate.h" #include "aggregate.h"
#include "declaration.h" #include "declaration.h"
#include "dsymbol.h"
#include "init.h" #include "init.h"
#include "module.h"
#include "gen/irstate.h" #include "mtype.h"
#include "gen/tollvm.h"
#include "gen/llvmhelpers.h"
#include "gen/arrays.h"
#include "gen/runtime.h"
#include "gen/logger.h"
#include "gen/dvalue.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/irmodule.h"
#include "ir/irtypestruct.h" #include "ir/irtypestruct.h"
+10 -4
View File
@@ -11,12 +11,18 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LLVMC_GEN_ARRAYS_H #ifndef LDC_GEN_ARRAYS_H
#define LLVMC_GEN_ARRAYS_H #define LDC_GEN_ARRAYS_H
#include "lexer.h"
#include "gen/llvm.h"
struct ArrayInitializer; struct ArrayInitializer;
struct DSliceValue; struct DSliceValue;
struct DValue;
struct Expression;
struct Loc;
struct Type;
llvm::StructType* DtoArrayType(Type* arrayTy); llvm::StructType* DtoArrayType(Type* arrayTy);
llvm::StructType* DtoArrayType(LLType* elemTy); llvm::StructType* DtoArrayType(LLType* elemTy);
@@ -69,4 +75,4 @@ DValue* DtoCastArray(Loc& loc, DValue* val, Type* to);
// generates an array bounds check // generates an array bounds check
void DtoArrayBoundsCheck(Loc& loc, DValue* arr, DValue* index, DValue* lowerBound = 0); void DtoArrayBoundsCheck(Loc& loc, DValue* arr, DValue* index, DValue* lowerBound = 0);
#endif // LLVMC_GEN_ARRAYS_H #endif // LDC_GEN_ARRAYS_H
+4 -6
View File
@@ -8,15 +8,13 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h" #include "gen/llvm.h"
#include "declaration.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/complex.h"
#include "gen/dvalue.h"
#include "gen/irstate.h"
#include "gen/llvmhelpers.h" #include "gen/llvmhelpers.h"
#include "gen/logger.h"
#include "gen/tollvm.h"
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
+3 -5
View File
@@ -8,15 +8,13 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/cl_helpers.h" #include "gen/cl_helpers.h"
#include "mars.h" #include "mars.h"
#include "root.h"
#include "rmem.h" #include "rmem.h"
#include "root.h"
#include <cctype> // isupper, tolower
#include <algorithm> #include <algorithm>
#include <utility> #include <cctype> // isupper, tolower
#include <stdarg.h> #include <stdarg.h>
#include <utility>
namespace opts { namespace opts {
+3 -4
View File
@@ -12,13 +12,12 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LDC_CL_HELPERS_H #ifndef LDC_GEN_CL_HELPERS_H
#define LDC_CL_HELPERS_H #define LDC_GEN_CL_HELPERS_H
#include <string>
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h" #include "llvm/Support/Compiler.h"
#include <string>
template <typename TYPE> struct ArrayBase; template <typename TYPE> struct ArrayBase;
typedef ArrayBase<char> Strings; typedef ArrayBase<char> Strings;
+4 -8
View File
@@ -8,18 +8,15 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h" #include "gen/llvm.h"
#include "mtype.h"
#include "aggregate.h" #include "aggregate.h"
#include "init.h"
#include "declaration.h" #include "declaration.h"
#include "init.h"
#include "gen/dvalue.h" #include "mtype.h"
#include "gen/irstate.h"
#include "gen/arrays.h" #include "gen/arrays.h"
#include "gen/classes.h" #include "gen/classes.h"
#include "gen/dvalue.h"
#include "gen/functions.h" #include "gen/functions.h"
#include "gen/irstate.h"
#include "gen/llvmhelpers.h" #include "gen/llvmhelpers.h"
#include "gen/logger.h" #include "gen/logger.h"
#include "gen/nested.h" #include "gen/nested.h"
@@ -28,7 +25,6 @@
#include "gen/structs.h" #include "gen/structs.h"
#include "gen/tollvm.h" #include "gen/tollvm.h"
#include "gen/utils.h" #include "gen/utils.h"
#include "ir/irstruct.h" #include "ir/irstruct.h"
#include "ir/irtypeclass.h" #include "ir/irtypeclass.h"
+12 -6
View File
@@ -17,6 +17,12 @@
#include "gen/structs.h" #include "gen/structs.h"
struct ClassDeclaration;
struct CtorDeclaration;
struct FuncDeclaration;
struct NewExp;
struct TypeClass;
/// Resolves the llvm type for a class declaration /// Resolves the llvm type for a class declaration
void DtoResolveClass(ClassDeclaration* cd); void DtoResolveClass(ClassDeclaration* cd);
@@ -31,12 +37,12 @@ void DtoDefineClass(ClassDeclaration* cd);
/// Builds the initializer of cd's ClassInfo. /// Builds the initializer of cd's ClassInfo.
/// FIXME: this should be put into IrStruct and eventually IrClass. /// 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); DValue* DtoNewClass(Loc loc, TypeClass* type, NewExp* newexp);
void DtoInitClass(TypeClass* tc, LLValue* dst); void DtoInitClass(TypeClass* tc, llvm::Value* dst);
DValue* DtoCallClassCtor(TypeClass* type, CtorDeclaration* ctor, Array* arguments, LLValue* mem); DValue* DtoCallClassCtor(TypeClass* type, CtorDeclaration* ctor, Array* arguments, llvm::Value* mem);
void DtoFinalizeClass(LLValue* inst); void DtoFinalizeClass(llvm::Value* inst);
DValue* DtoCastClass(DValue* val, Type* to); DValue* DtoCastClass(DValue* val, Type* to);
DValue* DtoDynamicCastObject(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* DtoCastInterfaceToObject(DValue* val, Type* to);
DValue* DtoDynamicCastInterface(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 #endif
+6 -8
View File
@@ -7,17 +7,15 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h"
#include "mtype.h"
#include "declaration.h"
#include "gen/complex.h" #include "gen/complex.h"
#include "gen/tollvm.h" #include "declaration.h"
#include "gen/llvmhelpers.h" #include "mtype.h"
#include "gen/irstate.h"
#include "gen/dvalue.h" #include "gen/dvalue.h"
#include "gen/irstate.h"
#include "gen/llvm.h"
#include "gen/llvmhelpers.h"
#include "gen/logger.h" #include "gen/logger.h"
#include "gen/tollvm.h"
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
+20 -6
View File
@@ -14,19 +14,33 @@
#ifndef LDC_GEN_COMPLEX_H #ifndef LDC_GEN_COMPLEX_H
#define 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); 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); 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, 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* DtoComplexAdd(Loc& loc, Type* type, DValue* lhs, DValue* rhs);
DValue* DtoComplexSub(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* DtoComplexRem(Loc& loc, Type* type, DValue* lhs, DValue* rhs);
DValue* DtoComplexNeg(Loc& loc, Type* type, DValue* val); 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); DValue* DtoCastComplex(Loc& loc, DValue* val, Type* to);
+4 -7
View File
@@ -7,26 +7,23 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h"
#include "aggregate.h" #include "aggregate.h"
#include "declaration.h" #include "declaration.h"
#include "enum.h" #include "enum.h"
#include "id.h" #include "id.h"
#include "init.h"
#include "rmem.h" #include "rmem.h"
#include "template.h" #include "template.h"
#include "init.h"
#include "gen/irstate.h" #include "gen/irstate.h"
#include "gen/tollvm.h" #include "gen/llvm.h"
#include "gen/llvmhelpers.h" #include "gen/llvmhelpers.h"
#include "gen/logger.h" #include "gen/logger.h"
#include "gen/todebug.h" #include "gen/todebug.h"
#include "gen/tollvm.h"
#include "ir/ir.h" #include "ir/ir.h"
#include "ir/irvar.h"
#include "ir/irtype.h" #include "ir/irtype.h"
#include "ir/irtypestruct.h" #include "ir/irtypestruct.h"
#include "ir/irvar.h"
/* ================================================================== */ /* ================================================================== */
+5 -11
View File
@@ -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/dvalue.h"
#include "gen/llvmhelpers.h"
#include "declaration.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); assert(c);
return c; return c;
} }
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -17,8 +17,8 @@
#ifndef LDC_GEN_DVALUE_H #ifndef LDC_GEN_DVALUE_H
#define LDC_GEN_DVALUE_H #define LDC_GEN_DVALUE_H
#include <cassert>
#include "root.h" #include "root.h"
#include <cassert>
struct Type; struct Type;
struct Dsymbol; struct Dsymbol;
+22 -24
View File
@@ -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 "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 #if LDC_LLVM_VER >= 303
#include "llvm/IR/Intrinsics.h" #include "llvm/IR/Intrinsics.h"
#else #else
#include "llvm/Intrinsics.h" #include "llvm/Intrinsics.h"
#endif #endif
#include "llvm/Support/CFG.h"
#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 <iostream> #include <iostream>
#if LDC_LLVM_VER < 302 #if LDC_LLVM_VER < 302
+5 -3
View File
@@ -16,13 +16,15 @@
#include "mars.h" #include "mars.h"
struct DValue;
struct Expression;
struct FuncDeclaration; struct FuncDeclaration;
struct Type;
struct IRAsmBlock; struct IRAsmBlock;
struct Parameter;
struct Type;
namespace llvm namespace llvm
{ {
class FunctionType;
class Value; class Value;
} }
+6 -9
View File
@@ -7,16 +7,13 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include <cstdarg>
#include "gen/llvm.h"
#include "mtype.h"
#include "declaration.h"
#include "statement.h"
#include "gen/irstate.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 <cstdarg>
IRState* gIR = 0; IRState* gIR = 0;
llvm::TargetMachine* gTargetMachine = 0; llvm::TargetMachine* gTargetMachine = 0;
+5 -7
View File
@@ -15,17 +15,15 @@
#ifndef LDC_GEN_IRSTATE_H #ifndef LDC_GEN_IRSTATE_H
#define LDC_GEN_IRSTATE_H #define LDC_GEN_IRSTATE_H
#include <vector>
#include <deque>
#include <list>
#include <sstream>
#include "root.h"
#include "aggregate.h" #include "aggregate.h"
#include "root.h"
#include "ir/irfunction.h" #include "ir/irfunction.h"
#include "ir/irstruct.h" #include "ir/irstruct.h"
#include "ir/irvar.h" #include "ir/irvar.h"
#include <deque>
#include <list>
#include <sstream>
#include <vector>
#if LDC_LLVM_VER >= 302 #if LDC_LLVM_VER >= 302
#include "llvm/DIBuilder.h" #include "llvm/DIBuilder.h"
+3 -3
View File
@@ -15,8 +15,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef GEN_LLVM_H #ifndef LDC_GEN_LLVM_H
#define GEN_LLVM_H #define LDC_GEN_LLVM_H
#if LDC_LLVM_VER >= 303 #if LDC_LLVM_VER >= 303
#include "llvm/IR/Type.h" #include "llvm/IR/Type.h"
@@ -94,4 +94,4 @@ using llvm::IRBuilder;
using llvm::APFloat; using llvm::APFloat;
using llvm::APInt; using llvm::APInt;
#endif // GEN_LLVM_H #endif // LDC_GEN_LLVM_H
+1 -1
View File
@@ -8,8 +8,8 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvmcompat.h" #include "gen/llvmcompat.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/ADT/Triple.h" #include "llvm/ADT/Triple.h"
#include "llvm/Config/llvm-config.h"
#if LDC_LLVM_VER >= 303 #if LDC_LLVM_VER >= 303
#include "llvm/IR/DerivedTypes.h" #include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h" #include "llvm/IR/Function.h"
+19 -23
View File
@@ -8,36 +8,32 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvmhelpers.h" #include "gen/llvmhelpers.h"
#include "gen/llvm.h"
#include "mars.h"
#include "init.h"
#include "id.h"
#include "expression.h" #include "expression.h"
#include "template.h" #include "id.h"
#include "init.h"
#include "mars.h"
#include "module.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/MC/MCAsmInfo.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
#if LDC_LLVM_VER >= 301 #if LDC_LLVM_VER >= 301
#include "llvm/Transforms/Utils/ModuleUtils.h" #include "llvm/Transforms/Utils/ModuleUtils.h"
#endif #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 <stack> #include <stack>
/****************************************************************************************/ /****************************************************************************************/
+3 -4
View File
@@ -16,11 +16,10 @@
#ifndef LDC_GEN_LLVMHELPERS_H #ifndef LDC_GEN_LLVMHELPERS_H
#define LDC_GEN_LLVMHELPERS_H #define LDC_GEN_LLVMHELPERS_H
#include "gen/llvm.h"
#include "gen/dvalue.h"
#include "statement.h"
#include "mtype.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 // this is used for tracking try-finally, synchronized and volatile scopes
struct EnclosingHandler struct EnclosingHandler
+3 -5
View File
@@ -7,17 +7,15 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "mars.h"
#include "llvm/Support/CommandLine.h"
#include <cassert> #include <cassert>
#include <cstdarg> #include <cstdarg>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <fstream> #include <fstream>
#include <string>
#include <iostream> #include <iostream>
#include <string>
#include "mars.h"
#include "llvm/Support/CommandLine.h"
#if LDC_LLVM_VER >= 303 #if LDC_LLVM_VER >= 303
#include "llvm/IR/GlobalValue.h" #include "llvm/IR/GlobalValue.h"
+2 -2
View File
@@ -12,8 +12,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef _llvmd_gen_logger_h_ #ifndef LDC_GEN_LOGGER_H
#define _llvmd_gen_logger_h_ #define LDC_GEN_LOGGER_H
#include <iosfwd> #include <iosfwd>
+34 -38
View File
@@ -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/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/Analysis/Verifier.h"
#include "llvm/LinkAllPasses.h" #include "llvm/LinkAllPasses.h"
#if LDC_LLVM_VER >= 303 #if LDC_LLVM_VER >= 303
@@ -22,44 +56,6 @@
#endif #endif
#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 #if DMDV2
#define NEW_MODULEINFO_LAYOUT 1 #define NEW_MODULEINFO_LAYOUT 1
#endif #endif
+9 -12
View File
@@ -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/llvm.h"
#include "gen/llvmhelpers.h"
#include "gen/logger.h"
#include "gen/tollvm.h"
#if LDC_LLVM_VER >= 303 #if LDC_LLVM_VER >= 303
#include "llvm/IR/InlineAsm.h" #include "llvm/IR/InlineAsm.h"
#else #else
#include "llvm/InlineAsm.h" #include "llvm/InlineAsm.h"
#endif #endif
#include "expression.h"
#include "statement.h"
#include "declaration.h"
#include "template.h"
#include <cassert> #include <cassert>
#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) void Statement::toNakedIR(IRState *p)
+2 -4
View File
@@ -8,15 +8,13 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/nested.h" #include "gen/nested.h"
#include "gen/dvalue.h" #include "gen/dvalue.h"
#include "gen/functions.h"
#include "gen/irstate.h" #include "gen/irstate.h"
#include "gen/llvmhelpers.h" #include "gen/llvmhelpers.h"
#include "gen/logger.h" #include "gen/logger.h"
#include "gen/tollvm.h"
#include "gen/functions.h"
#include "gen/todebug.h" #include "gen/todebug.h"
#include "gen/tollvm.h"
#include "llvm/Analysis/ValueTracking.h" #include "llvm/Analysis/ValueTracking.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
namespace cl = llvm::cl; namespace cl = llvm::cl;
+2 -5
View File
@@ -8,13 +8,12 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/optimizer.h" #include "gen/optimizer.h"
#include "mars.h" // error()
#include "gen/cl_helpers.h" #include "gen/cl_helpers.h"
#include "gen/logger.h" #include "gen/logger.h"
#include "gen/passes/Passes.h" #include "gen/passes/Passes.h"
#include "llvm/PassManager.h"
#include "llvm/LinkAllPasses.h" #include "llvm/LinkAllPasses.h"
#include "llvm/PassManager.h"
#if LDC_LLVM_VER >= 303 #if LDC_LLVM_VER >= 303
#include "llvm/IR/Module.h" #include "llvm/IR/Module.h"
#include "llvm/IR/DataLayout.h" #include "llvm/IR/DataLayout.h"
@@ -35,8 +34,6 @@
#include "llvm/Transforms/IPO.h" #include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h" #include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "mars.h" // error()
using namespace llvm; using namespace llvm;
// Allow the user to specify specific optimizations to run. // Allow the user to specify specific optimizations to run.
-1
View File
@@ -17,7 +17,6 @@
#define DEBUG_TYPE "simplify-drtcalls" #define DEBUG_TYPE "simplify-drtcalls"
#include "Passes.h" #include "Passes.h"
#include "llvm/Pass.h" #include "llvm/Pass.h"
#if LDC_LLVM_VER >= 303 #if LDC_LLVM_VER >= 303
#include "llvm/IR/Function.h" #include "llvm/IR/Function.h"
+4 -4
View File
@@ -9,11 +9,11 @@
#include "pragma.h" #include "pragma.h"
#include "attrib.h" #include "attrib.h"
#include "id.h"
#include "expression.h"
#include "scope.h"
#include "module.h"
#include "declaration.h" #include "declaration.h"
#include "expression.h"
#include "id.h"
#include "module.h"
#include "scope.h"
#include "template.h" #include "template.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
+3 -3
View File
@@ -11,8 +11,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef PRAGMA_H #ifndef LDC_GEN_PRAGMA_H
#define PRAGMA_H #define LDC_GEN_PRAGMA_H
#include <string> #include <string>
@@ -51,4 +51,4 @@ Pragma DtoGetPragma(Scope *sc, PragmaDeclaration *decl, std::string &arg1str);
void DtoCheckPragma(PragmaDeclaration *decl, Dsymbol *sym, void DtoCheckPragma(PragmaDeclaration *decl, Dsymbol *sym,
Pragma llvm_internal, const std::string &arg1str); Pragma llvm_internal, const std::string &arg1str);
#endif // PRAGMA_H #endif // LDC_GEN_PRAGMA_H
+2 -4
View File
@@ -8,13 +8,11 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/programs.h" #include "gen/programs.h"
#include "mars.h" // fatal()
#include "root.h" // error(char*)
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include "llvm/Support/Program.h" #include "llvm/Support/Program.h"
#include "root.h" // error(char*)
#include "mars.h" // fatal()
using namespace llvm; using namespace llvm;
static cl::opt<std::string> gcc("gcc", static cl::opt<std::string> gcc("gcc",
+2 -5
View File
@@ -7,18 +7,15 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h" #include "gen/rttibuilder.h"
#include "aggregate.h" #include "aggregate.h"
#include "mtype.h" #include "mtype.h"
#include "gen/arrays.h" #include "gen/arrays.h"
#include "gen/irstate.h" #include "gen/irstate.h"
#include "gen/linkage.h" #include "gen/linkage.h"
#include "gen/llvm.h"
#include "gen/llvmhelpers.h" #include "gen/llvmhelpers.h"
#include "gen/rttibuilder.h"
#include "gen/tollvm.h" #include "gen/tollvm.h"
#include "ir/irstruct.h" #include "ir/irstruct.h"
RTTIBuilder::RTTIBuilder(AggregateDeclaration* base_class) RTTIBuilder::RTTIBuilder(AggregateDeclaration* base_class)
+12 -9
View File
@@ -12,22 +12,25 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __LDC_GEN_RTTIBUILDER_H__ #ifndef LDC_GEN_RTTIBUILDER_H
#define __LDC_GEN_RTTIBUILDER_H__ #define LDC_GEN_RTTIBUILDER_H
#include "llvm/ADT/SmallVector.h"
#if LDC_LLVM_VER >= 303 #if LDC_LLVM_VER >= 303
#include "llvm/IR/Constant.h" #include "llvm/IR/Constant.h"
#else #else
#include "llvm/Constant.h" #include "llvm/Constant.h"
#endif #endif
#include "llvm/ADT/SmallVector.h"
struct ClassDeclaration;
struct AggregateDeclaration; struct AggregateDeclaration;
struct TypeClass; struct ClassDeclaration;
struct Type; struct Dsymbol;
struct FuncDeclaration;
struct IrGlobal;
struct IrStruct; struct IrStruct;
struct Type;
struct TypeClass;
namespace llvm { class StructType; }
struct RTTIBuilder struct RTTIBuilder
{ {
@@ -75,10 +78,10 @@ struct RTTIBuilder
/// Creates the initializer constant and assigns it to the global. /// Creates the initializer constant and assigns it to the global.
void finalize(IrGlobal* tid); 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. /// Creates the initializer constant and assigns it to the global.
llvm::Constant* get_constant(LLStructType *initType); llvm::Constant* get_constant(llvm::StructType* initType);
}; };
#endif #endif
+15 -17
View File
@@ -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/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 #if LDC_LLVM_VER >= 303
#include "llvm/IR/Module.h" #include "llvm/IR/Module.h"
#include "llvm/IR/Attributes.h" #include "llvm/IR/Attributes.h"
@@ -15,23 +30,6 @@
#include "llvm/Module.h" #include "llvm/Module.h"
#include "llvm/Attributes.h" #include "llvm/Attributes.h"
#endif #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 #if LDC_LLVM_VER < 302
using namespace llvm::Attribute; using namespace llvm::Attribute;
+3 -3
View File
@@ -11,8 +11,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LDC_GEN_RUNTIME_H_ #ifndef LDC_GEN_RUNTIME_H
#define LDC_GEN_RUNTIME_H_ #define LDC_GEN_RUNTIME_H
namespace llvm namespace llvm
{ {
@@ -40,4 +40,4 @@ llvm::GlobalVariable* LLVM_D_GetRuntimeGlobal(llvm::Module* target, const char*
#define _adCmp "_adCmp2" #define _adCmp "_adCmp2"
#endif #endif
#endif // LDC_GEN_RUNTIME_H_ #endif // LDC_GEN_RUNTIME_H
+23 -25
View File
@@ -7,39 +7,37 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "init.h"
#include <stdio.h> #include "mars.h"
#include <math.h> #include "module.h"
#include <fstream> #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/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 #if LDC_LLVM_VER >= 303
#include "llvm/IR/InlineAsm.h" #include "llvm/IR/InlineAsm.h"
#else #else
#include "llvm/InlineAsm.h" #include "llvm/InlineAsm.h"
#endif #endif
#include "llvm/Support/CFG.h" #include <fstream>
#include <math.h>
#include <stdio.h>
#include "mars.h" // Need to include this after the other DMD includes because of missing
#include "init.h" // dependencies.
#include "mtype.h"
#include "hdrgen.h" #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"
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
+11 -15
View File
@@ -7,29 +7,25 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include <algorithm>
#include "gen/llvm.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/ManagedStatic.h"
#include "mtype.h"
#include "aggregate.h" #include "aggregate.h"
#include "init.h"
#include "declaration.h" #include "declaration.h"
#include "init.h"
#include "gen/irstate.h" #include "mtype.h"
#include "gen/tollvm.h"
#include "gen/llvmhelpers.h"
#include "gen/arrays.h" #include "gen/arrays.h"
#include "gen/logger.h"
#include "gen/structs.h"
#include "gen/dvalue.h" #include "gen/dvalue.h"
#include "gen/functions.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 "gen/utils.h"
#include "ir/irstruct.h" #include "ir/irstruct.h"
#include "ir/irtypestruct.h" #include "ir/irtypestruct.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/ManagedStatic.h"
#include <algorithm>
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
+22 -10
View File
@@ -11,10 +11,23 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LLVMD_GEN_STRUCTS_H #ifndef LDC_GEN_STRUCTS_H
#define LLVMD_GEN_STRUCTS_H #define LDC_GEN_STRUCTS_H
#include "lexer.h"
#include <vector>
struct DValue;
struct StructDeclaration;
struct StructInitializer; 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. * Sets up codegen metadata and emits global data (.init, etc.), if needed.
@@ -24,31 +37,30 @@ struct StructInitializer;
void DtoResolveStruct(StructDeclaration* sd); void DtoResolveStruct(StructDeclaration* sd);
/// Build constant struct initializer. /// Build constant struct initializer.
LLConstant* DtoConstStructInitializer(StructInitializer* si); llvm::Constant* DtoConstStructInitializer(StructInitializer* si);
/// Build values for a struct literal. /// Build values for a struct literal.
std::vector<llvm::Value*> DtoStructLiteralValues(const StructDeclaration* sd, std::vector<llvm::Value*> DtoStructLiteralValues(const StructDeclaration* sd,
const std::vector<llvm::Value*>& inits, const std::vector<llvm::Value*>& inits, bool isConst = false);
bool isConst = false);
/// Returns a boolean=true if the two structs are equal. /// 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 /// 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 /// Return the type returned by DtoUnpaddedStruct called on a value of the
/// specified type. /// specified type.
/// Union types will get expanded into a struct, with a type for each member. /// 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. /// Return the struct value represented by v without the padding fields.
/// Unions will be expanded, with a value for each member. /// 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 /// Note: v must be a pointer to a struct, but the return value will be a
/// first-class struct value. /// 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. /// 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 #endif
+7 -10
View File
@@ -7,21 +7,18 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h"
#include "mtype.h"
#include "declaration.h" #include "declaration.h"
#include "id.h" #include "id.h"
#include "mtype.h"
#include "gen/tollvm.h" #include "gen/abi.h"
#include "gen/llvmhelpers.h"
#include "gen/irstate.h"
#include "gen/dvalue.h" #include "gen/dvalue.h"
#include "gen/functions.h" #include "gen/functions.h"
#include "gen/abi.h" #include "gen/irstate.h"
#include "gen/nested.h" #include "gen/llvm.h"
#include "gen/llvmhelpers.h"
#include "gen/logger.h" #include "gen/logger.h"
#include "gen/nested.h"
#include "gen/tollvm.h"
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
+11 -14
View File
@@ -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/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/CodeGen/MachineModuleInfo.h"
#include "llvm/Support/Dwarf.h" #include "llvm/Support/Dwarf.h"
#include "llvm/Support/FileSystem.h" #include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.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; using namespace llvm::dwarf;
////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -14,8 +14,8 @@
#ifndef LDC_GEN_TODEBUG_H #ifndef LDC_GEN_TODEBUG_H
#define LDC_GEN_TODEBUG_H #define LDC_GEN_TODEBUG_H
#include "gen/tollvm.h"
#include "gen/irstate.h" #include "gen/irstate.h"
#include "gen/tollvm.h"
void RegisterDwarfSymbols(llvm::Module* mod); void RegisterDwarfSymbols(llvm::Module* mod);
+20 -24
View File
@@ -7,44 +7,40 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include <stdio.h>
#include <math.h>
#include <fstream>
#include "gen/llvm.h"
#include "llvm/Support/CommandLine.h"
#include "attrib.h" #include "attrib.h"
#include "enum.h"
#include "hdrgen.h"
#include "id.h"
#include "init.h" #include "init.h"
#include "mtype.h" #include "mtype.h"
#include "template.h"
#include "hdrgen.h"
#include "port.h" #include "port.h"
#include "rmem.h" #include "rmem.h"
#include "id.h" #include "template.h"
#include "enum.h" #include "gen/aa.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/arrays.h"
#include "gen/structs.h"
#include "gen/classes.h" #include "gen/classes.h"
#include "gen/typeinf.h"
#include "gen/complex.h" #include "gen/complex.h"
#include "gen/dvalue.h" #include "gen/dvalue.h"
#include "gen/aa.h"
#include "gen/functions.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/nested.h"
#include "gen/utils.h"
#include "gen/warnings.h"
#include "gen/optimizer.h" #include "gen/optimizer.h"
#include "gen/pragma.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 "llvm/Support/ManagedStatic.h"
#include <fstream>
#include <math.h>
#include <stdio.h>
llvm::cl::opt<bool> checkPrintf("check-printf-calls", llvm::cl::opt<bool> checkPrintf("check-printf-calls",
llvm::cl::desc("Validate printf call format strings against arguments"), llvm::cl::desc("Validate printf call format strings against arguments"),
+12 -15
View File
@@ -7,30 +7,27 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h" #include "gen/tollvm.h"
#include "dsymbol.h"
#include "aggregate.h" #include "aggregate.h"
#include "declaration.h" #include "declaration.h"
#include "init.h" #include "dsymbol.h"
#include "id.h" #include "id.h"
#include "init.h"
#include "module.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/arrays.h"
#include "gen/classes.h"
#include "gen/complex.h"
#include "gen/dvalue.h" #include "gen/dvalue.h"
#include "gen/functions.h" #include "gen/functions.h"
#include "gen/structs.h" #include "gen/irstate.h"
#include "gen/classes.h"
#include "gen/typeinf.h"
#include "gen/complex.h"
#include "gen/llvmhelpers.h"
#include "gen/linkage.h" #include "gen/linkage.h"
#include "gen/llvm.h"
#include "gen/llvmhelpers.h"
#include "gen/logger.h"
#include "gen/pragma.h" #include "gen/pragma.h"
#include "gen/runtime.h"
#include "gen/structs.h"
#include "gen/typeinf.h"
#include "ir/irtype.h" #include "ir/irtype.h"
#include "ir/irtypeclass.h" #include "ir/irtypeclass.h"
#include "ir/irtypefunction.h" #include "ir/irtypefunction.h"
+3 -4
View File
@@ -16,12 +16,11 @@
#ifndef LDC_GEN_TOLLVM_H #ifndef LDC_GEN_TOLLVM_H
#define LDC_GEN_TOLLVM_H #define LDC_GEN_TOLLVM_H
#include "gen/llvm.h"
#include "lexer.h"
#include "mtype.h"
#include "attrib.h" #include "attrib.h"
#include "declaration.h" #include "declaration.h"
#include "lexer.h"
#include "mtype.h"
#include "gen/llvm.h"
#include "gen/structs.h" #include "gen/structs.h"
// D->LLVM type handling stuff // D->LLVM type handling stuff
+1
View File
@@ -15,6 +15,7 @@
#ifndef LDC_GEN_TYPEINF_H #ifndef LDC_GEN_TYPEINF_H
#define LDC_GEN_TYPEINF_H #define LDC_GEN_TYPEINF_H
struct TypeInfoDeclaration;
void DtoResolveTypeInfo(TypeInfoDeclaration* tid); void DtoResolveTypeInfo(TypeInfoDeclaration* tid);
void DtoDeclareTypeInfo(TypeInfoDeclaration* tid); void DtoDeclareTypeInfo(TypeInfoDeclaration* tid);
void DtoConstInitTypeInfo(TypeInfoDeclaration* tid); void DtoConstInitTypeInfo(TypeInfoDeclaration* tid);
+18 -22
View File
@@ -20,39 +20,35 @@
// Copyright (c) 2007 by Tomas Lindquist Olsen // Copyright (c) 2007 by Tomas Lindquist Olsen
// tomas at famolsen dk // tomas at famolsen dk
#include <cstdio> #include "aggregate.h"
#include <cassert> #include "attrib.h"
#include "declaration.h"
#include "gen/llvm.h" #include "enum.h"
#include "expression.h"
#include "id.h"
#include "import.h"
#include "init.h"
#include "mars.h" #include "mars.h"
#include "module.h" #include "module.h"
#include "mtype.h" #include "mtype.h"
#include "scope.h" #include "scope.h"
#include "init.h"
#include "expression.h"
#include "attrib.h"
#include "declaration.h"
#include "template.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/arrays.h"
#include "gen/structs.h"
#include "gen/classes.h" #include "gen/classes.h"
#include "gen/irstate.h"
#include "gen/linkage.h" #include "gen/linkage.h"
#include "gen/llvm.h"
#include "gen/llvmhelpers.h"
#include "gen/logger.h"
#include "gen/metadata.h" #include "gen/metadata.h"
#include "gen/rttibuilder.h" #include "gen/rttibuilder.h"
#include "gen/runtime.h"
#include "ir/irvar.h" #include "gen/structs.h"
#include "gen/tollvm.h"
#include "ir/irtype.h" #include "ir/irtype.h"
#include "ir/irvar.h"
#include <cassert>
#include <cstdio>
#include <ir/irtypeclass.h> #include <ir/irtypeclass.h>
/******************************************* /*******************************************
+2 -2
View File
@@ -11,8 +11,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __LDC_GEN_UTILS_H__ #ifndef LDC_GEN_UTILS_H
#define __LDC_GEN_UTILS_H__ #define LDC_GEN_UTILS_H
#include "root.h" #include "root.h"
+1 -4
View File
@@ -7,11 +7,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "mars.h"
#include "mtype.h"
#include "expression.h"
#include "gen/warnings.h" #include "gen/warnings.h"
#include "mtype.h"
void warnInvalidPrintfCall(Loc loc, Expression* arguments, size_t nargs) void warnInvalidPrintfCall(Loc loc, Expression* arguments, size_t nargs)
{ {
+6 -3
View File
@@ -11,9 +11,12 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef __LDC_GEN_WARNINGS_H__ #ifndef LDC_GEN_WARNINGS_H
#define __LDC_GEN_WARNINGS_H__ #define LDC_GEN_WARNINGS_H
#include "expression.h"
#include "mars.h"
void warnInvalidPrintfCall(Loc loc, Expression* arguments, size_t nargs); void warnInvalidPrintfCall(Loc loc, Expression* arguments, size_t nargs);
#endif // __LDC_GEN_WARNINGS_H__ #endif // LDC_GEN_WARNINGS_H
+2 -3
View File
@@ -16,10 +16,9 @@
#ifndef LDC_IR_IR_H #ifndef LDC_IR_IR_H
#define LDC_IR_IR_H #define LDC_IR_IR_H
#include <deque>
#include "ir/irforw.h"
#include "root.h" #include "root.h"
#include "ir/irforw.h"
#include <deque>
struct IRState; struct IRState;
struct IrFunction; struct IrFunction;
+1 -2
View File
@@ -8,12 +8,11 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h" #include "gen/llvm.h"
#include "gen/logger.h"
#include "ir/ir.h" #include "ir/ir.h"
#include "ir/irdsymbol.h" #include "ir/irdsymbol.h"
#include "ir/irvar.h" #include "ir/irvar.h"
#include "gen/logger.h"
std::set<IrDsymbol*> IrDsymbol::list; std::set<IrDsymbol*> IrDsymbol::list;
void IrDsymbol::resetAll() void IrDsymbol::resetAll()
-1
View File
@@ -10,7 +10,6 @@
#include "gen/llvm.h" #include "gen/llvm.h"
#include "gen/tollvm.h" #include "gen/tollvm.h"
#include "ir/irfunction.h" #include "ir/irfunction.h"
#include <sstream> #include <sstream>
FuncGen::FuncGen() FuncGen::FuncGen()
+2 -3
View File
@@ -19,10 +19,9 @@
#include "gen/llvm.h" #include "gen/llvm.h"
#include "ir/ir.h" #include "ir/ir.h"
#include "ir/irlandingpad.h" #include "ir/irlandingpad.h"
#include <vector>
#include <stack>
#include <map> #include <map>
#include <stack>
#include <vector>
struct Statement; struct Statement;
struct EnclosingHandler; struct EnclosingHandler;
+1 -3
View File
@@ -8,13 +8,11 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "ir/irfuncty.h" #include "ir/irfuncty.h"
#include "mtype.h" #include "mtype.h"
#include "gen/abi.h" #include "gen/abi.h"
#include "gen/dvalue.h" #include "gen/dvalue.h"
#include "gen/logger.h"
#include "gen/llvm.h" #include "gen/llvm.h"
#include "gen/logger.h"
#include "gen/tollvm.h" #include "gen/tollvm.h"
#if LDC_LLVM_VER >= 303 #if LDC_LLVM_VER >= 303
+4 -4
View File
@@ -8,13 +8,13 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h" #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/classes.h"
#include "gen/irstate.h"
#include "gen/llvmhelpers.h" #include "gen/llvmhelpers.h"
#include "gen/logger.h"
#include "gen/runtime.h"
#include "gen/todebug.h" #include "gen/todebug.h"
#include "gen/tollvm.h"
#include "ir/irlandingpad.h" #include "ir/irlandingpad.h"
IRLandingPadInfo::IRLandingPadInfo(Catch* catchstmt_, llvm::BasicBlock* end_) : IRLandingPadInfo::IRLandingPadInfo(Catch* catchstmt_, llvm::BasicBlock* end_) :
+1 -2
View File
@@ -15,9 +15,8 @@
#ifndef LDC_IR_IRLANDINGPADINFO_H #ifndef LDC_IR_IRLANDINGPADINFO_H
#define LDC_IR_IRLANDINGPADINFO_H #define LDC_IR_IRLANDINGPADINFO_H
#include "ir/ir.h"
#include "statement.h" #include "statement.h"
#include "ir/ir.h"
#include <deque> #include <deque>
#include <stack> #include <stack>
+1 -1
View File
@@ -8,8 +8,8 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h" #include "gen/llvm.h"
#include "gen/tollvm.h"
#include "gen/irstate.h" #include "gen/irstate.h"
#include "gen/tollvm.h"
#include "ir/irmodule.h" #include "ir/irmodule.h"
IrModule::IrModule(Module* module, const char* srcfilename) IrModule::IrModule(Module* module, const char* srcfilename)
+3 -7
View File
@@ -8,21 +8,17 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "gen/llvm.h" #include "gen/llvm.h"
#include "mtype.h"
#include "aggregate.h" #include "aggregate.h"
#include "declaration.h" #include "declaration.h"
#include "init.h" #include "init.h"
#include "mtype.h"
#include "gen/irstate.h" #include "gen/irstate.h"
#include "gen/tollvm.h"
#include "gen/logger.h"
#include "gen/llvmhelpers.h" #include "gen/llvmhelpers.h"
#include "gen/logger.h"
#include "gen/tollvm.h"
#include "gen/utils.h" #include "gen/utils.h"
#include "ir/irstruct.h" #include "ir/irstruct.h"
#include "ir/irtypeclass.h" #include "ir/irtypeclass.h"
#include <algorithm> #include <algorithm>
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
+1 -2
View File
@@ -16,9 +16,8 @@
#define LDC_IR_IRSTRUCT_H #define LDC_IR_IRSTRUCT_H
#include "ir/ir.h" #include "ir/ir.h"
#include <vector>
#include <map> #include <map>
#include <vector>
// DMD forward declarations // DMD forward declarations
struct StructInitializer; struct StructInitializer;
+10 -12
View File
@@ -13,22 +13,20 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include <map>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "llvm/TableGen/Main.h" #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 #if LDC_LLVM_VER < 302
#include "llvm/TableGen/TableGenAction.h" #include "llvm/TableGen/TableGenAction.h"
#endif #endif
#include "llvm/TableGen/Record.h" #include <algorithm>
#include "llvm/Support/CommandLine.h" #include <assert.h>
#include "llvm/Support/PathV1.h" #include <map>
#include "llvm/ADT/StringRef.h" #include <stdio.h>
#include <string.h>
#include <string>
using namespace std; using namespace std;
using namespace llvm; using namespace llvm;