From 9458911839877d3db7d03f5e05d13b05ccdccb45 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sat, 15 Dec 2012 23:58:53 +0100 Subject: [PATCH] Added LLVM-style license headers to all our files. --- driver/cl_options.cpp | 9 ++++ driver/cl_options.h | 14 +++++++ driver/configfile.cpp | 9 ++++ driver/configfile.h | 13 ++++++ driver/ldmd.cpp | 22 ++++++---- driver/linker.cpp | 9 ++++ driver/linker.h | 14 +++++++ driver/main.cpp | 12 ++++-- driver/toobj.cpp | 16 ++++---- driver/toobj.h | 13 ++++++ gen/aa.cpp | 9 ++++ gen/aa.h | 14 +++++++ gen/abi-generic.h | 13 ++++++ gen/abi-x86-64.cpp | 61 ++++++++++++++++------------ gen/abi-x86-64.h | 13 ++++++ gen/abi-x86.cpp | 9 ++++ gen/abi-x86.h | 13 ++++++ gen/abi.cpp | 9 ++++ gen/abi.h | 16 ++++++++ gen/arrays.cpp | 9 ++++ gen/arrays.h | 13 ++++++ gen/asm-x86-32.h | 15 ++++++- gen/asm-x86-64.h | 15 ++++++- gen/asmstmt.cpp | 10 ++++- gen/binops.cpp | 9 ++++ gen/cl_helpers.cpp | 9 ++++ gen/cl_helpers.h | 14 +++++++ gen/classes.cpp | 9 ++++ gen/classes.h | 14 +++++++ gen/complex.cpp | 9 ++++ gen/complex.h | 13 ++++++ gen/declarations.cpp | 9 ++++ gen/dvalue.cpp | 9 ++++ gen/dvalue.h | 22 +++++++--- gen/functions.cpp | 9 ++++ gen/functions.h | 13 ++++++ gen/irstate.cpp | 13 +++--- gen/irstate.h | 14 +++++++ gen/linkage.cpp | 9 ++++ gen/linkage.h | 13 ++++++ gen/llvm.h | 17 ++++++++ gen/llvmcompat.cpp | 8 ++++ gen/llvmcompat.h | 15 +++++++ gen/llvmhelpers.cpp | 9 ++++ gen/llvmhelpers.h | 15 +++++++ gen/logger.cpp | 9 ++++ gen/logger.h | 14 +++++++ gen/metadata.h | 13 ++++++ gen/module.cpp | 9 ++++ gen/naked.cpp | 9 ++++ gen/nested.cpp | 9 ++++ gen/nested.h | 14 +++++++ gen/optimizer.cpp | 9 ++++ gen/optimizer.h | 14 +++++++ gen/passes/GarbageCollect2Stack.cpp | 8 ++-- gen/passes/Passes.h | 13 ++++++ gen/passes/SimplifyDRuntimeCalls.cpp | 6 +-- gen/passes/StripExternals.cpp | 6 +-- gen/pragma.cpp | 9 ++++ gen/pragma.h | 13 ++++++ gen/programs.cpp | 9 ++++ gen/programs.h | 13 ++++++ gen/rttibuilder.cpp | 9 ++++ gen/rttibuilder.h | 14 +++++++ gen/runtime.cpp | 9 ++++ gen/runtime.h | 13 ++++++ gen/statements.cpp | 10 ++++- gen/structs.cpp | 9 ++++ gen/structs.h | 13 ++++++ gen/tocall.cpp | 9 ++++ gen/todebug.cpp | 9 ++++ gen/todebug.h | 13 ++++++ gen/toir.cpp | 15 +++---- gen/tollvm.cpp | 8 ++++ gen/tollvm.h | 15 +++++++ gen/typeinf.h | 14 +++++++ gen/typinf.cpp | 10 ++++- gen/utils.h | 13 ++++++ gen/warnings.cpp | 9 ++++ gen/warnings.h | 13 ++++++ ir/ir.cpp | 9 ++++ ir/ir.h | 15 ++++++- ir/irclass.cpp | 9 ++++ ir/irdsymbol.cpp | 9 ++++ ir/irdsymbol.h | 13 ++++++ ir/irforw.h | 14 +++++++ ir/irfunction.cpp | 8 ++++ ir/irfunction.h | 15 +++++++ ir/irfuncty.h | 15 +++++++ ir/irlandingpad.cpp | 9 ++++ ir/irlandingpad.h | 14 +++++++ ir/irmodule.cpp | 9 ++++ ir/irmodule.h | 14 +++++++ ir/irstruct.cpp | 9 ++++ ir/irstruct.h | 14 +++++++ ir/irtype.cpp | 9 ++++ ir/irtype.h | 16 ++++++++ ir/irtypeclass.cpp | 9 ++++ ir/irtypeclass.h | 13 ++++++ ir/irtypefunction.cpp | 9 ++++ ir/irtypefunction.h | 13 ++++++ ir/irtypestruct.cpp | 9 ++++ ir/irtypestruct.h | 14 +++++++ ir/irvar.cpp | 9 ++++ ir/irvar.h | 14 +++++++ utils/gen_gccbuiltins.cpp | 17 +++++++- 106 files changed, 1207 insertions(+), 85 deletions(-) diff --git a/driver/cl_options.cpp b/driver/cl_options.cpp index 0a10e807..7ff729da 100644 --- a/driver/cl_options.cpp +++ b/driver/cl_options.cpp @@ -1,3 +1,12 @@ +//===-- cl_options.cpp ----------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "driver/cl_options.h" #include "gen/cl_helpers.h" diff --git a/driver/cl_options.h b/driver/cl_options.h index 2fed81b0..ca9b657f 100644 --- a/driver/cl_options.h +++ b/driver/cl_options.h @@ -1,3 +1,17 @@ +//===-- driver/cl_options.h - LDC command line options ----------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Defines the LDC command line options as handled using the LLVM command +// line parsing library. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_CL_OPTIONS_H #define LDC_CL_OPTIONS_H diff --git a/driver/configfile.cpp b/driver/configfile.cpp index 25f3440e..1af2f525 100644 --- a/driver/configfile.cpp +++ b/driver/configfile.cpp @@ -1,3 +1,12 @@ +//===-- configfile.cpp ----------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include #include #include diff --git a/driver/configfile.h b/driver/configfile.h index 95a6fa2a..9465a877 100644 --- a/driver/configfile.h +++ b/driver/configfile.h @@ -1,3 +1,16 @@ +//===-- driver/configfile.h - LDC config file handling ----------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Handles reading and parsing of an LDC config file (ldc.conf/ldc2.conf). +// +//===----------------------------------------------------------------------===// + #ifndef LDC_CONF_CONFIGFILE_H #define LDC_CONF_CONFIGFILE_H diff --git a/driver/ldmd.cpp b/driver/ldmd.cpp index e506a921..5d4e0701 100644 --- a/driver/ldmd.cpp +++ b/driver/ldmd.cpp @@ -1,11 +1,15 @@ -/** - * Wrapper allowing use of LDC as drop-in replacement for DMD. - * - * Copyright (c) 2012 by the LDC Team. - * - * Command line parsing code originally - * Copyright (c) 1999-2012 by Digital Mars. - */ +//===-- ldmd.cpp - Drop-in DMD replacement wrapper for LDC ----------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license, except for the +// command line handling code, which originated from DMD. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Wrapper allowing use of LDC as drop-in replacement for DMD. +// // The reason why full command line parsing is required instead of just // rewriting the names of a few switches is an annoying impedance mismatch // between the way how DMD handles arguments and the LLVM command line library: @@ -37,6 +41,8 @@ // Note: This program inherited ugly C-style string handling and memory leaks // from DMD, but this should not be a problem due to the short-livedness of // the process. +// +//===----------------------------------------------------------------------===// #ifndef LDC_EXE_NAME # error "Please define LDC_EXE_NAME to the name of the LDC executable to use." diff --git a/driver/linker.cpp b/driver/linker.cpp index 381dad36..71e068a6 100644 --- a/driver/linker.cpp +++ b/driver/linker.cpp @@ -1,3 +1,12 @@ +//===-- linker.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "llvm/Linker.h" #include "llvm/ADT/Triple.h" diff --git a/driver/linker.h b/driver/linker.h index e2844732..d5220224 100644 --- a/driver/linker.h +++ b/driver/linker.h @@ -1,3 +1,17 @@ +//===-- driver/linker.h - Linker invocation ---------------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Handles locating and executing the system linker for generating +// libraries/executables. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_LINKER_H #define LDC_GEN_LINKER_H diff --git a/driver/main.cpp b/driver/main.cpp index db382d60..257d7ed5 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -1,7 +1,11 @@ -// Pulled out of dmd/mars.c - -// some things are taken from llvm's llc tool -// which uses the llvm license +//===-- main.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// #include "gen/llvmcompat.h" #include "gen/llvm.h" diff --git a/driver/toobj.cpp b/driver/toobj.cpp index 7150da1b..3e084a7b 100644 --- a/driver/toobj.cpp +++ b/driver/toobj.cpp @@ -1,11 +1,11 @@ - -// Copyright (c) 1999-2004 by Digital Mars -// All Rights Reserved -// written by Walter Bright -// www.digitalmars.com -// License for redistribution is by either the Artistic License -// in artistic.txt, or the GNU General Public License in gnu.txt. -// See the included readme.txt for details. +//===-- toobj.cpp ---------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// #include #include diff --git a/driver/toobj.h b/driver/toobj.h index ecc4c0a5..bae370d8 100644 --- a/driver/toobj.h +++ b/driver/toobj.h @@ -1,3 +1,16 @@ +//===-- driver/toobj.h - Object file emission -------------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Handles emission of "finished" LLVM modules to on-disk object files. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_TOOBJ_H #define LDC_GEN_TOOBJ_H diff --git a/gen/aa.cpp b/gen/aa.cpp index 1fc02f86..ab1c01ec 100644 --- a/gen/aa.cpp +++ b/gen/aa.cpp @@ -1,3 +1,12 @@ +//===-- aa.cpp ------------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "mtype.h" diff --git a/gen/aa.h b/gen/aa.h index d5e72eb5..0154f302 100644 --- a/gen/aa.h +++ b/gen/aa.h @@ -1,3 +1,17 @@ +//===-- gen/aa.h - Associative array codegen helpers ------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Helpers for generating calls to associative array runtime functions. +// +//===----------------------------------------------------------------------===// + + #ifndef LDC_GEN_AA_H #define LDC_GEN_AA_H diff --git a/gen/abi-generic.h b/gen/abi-generic.h index b104c143..b77fca44 100644 --- a/gen/abi-generic.h +++ b/gen/abi-generic.h @@ -1,3 +1,16 @@ +//===-- gen/abi-generic.h - Generic Target ABI helpers ----------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Contains helpers for handling rewrites common to more than one target ABI. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_ABI_GENERIC #define LDC_GEN_ABI_GENERIC diff --git a/gen/abi-x86-64.cpp b/gen/abi-x86-64.cpp index fa9b7c96..547fa374 100644 --- a/gen/abi-x86-64.cpp +++ b/gen/abi-x86-64.cpp @@ -1,30 +1,37 @@ -/* TargetABI implementation for x86-64. - * Written for LDC by Frits van Bommel in 2009. - * - * extern(C) implements the C calling convention for x86-64, as found in - * http://www.x86-64.org/documentation/abi-0.99.pdf - * - * Note: - * Where a discrepancy was found between llvm-gcc and the ABI documentation, - * llvm-gcc behavior was used for compatibility (after it was verified that - * regular gcc has the same behavior). - * - * LLVM gets it right for most types, but complex numbers and structs need some - * help. To make sure it gets those right we essentially bitcast small structs - * to a type to which LLVM assigns the appropriate registers, and pass that - * instead. Structs that are required to be passed in memory are explicitly - * marked with the ByVal attribute to ensure no part of them ends up in - * registers when only a subset of the desired registers are available. - * - * We don't perform the same transformation for D-specific types that contain - * multiple parts, such as dynamic arrays and delegates. They're passed as if - * the parts were passed as separate parameters. This helps make things like - * printf("%.*s", o.toString()) work as expected; if we didn't do this that - * wouldn't work if there were 4 other integer/pointer arguments before the - * toString() call because the string got bumped to memory with one integer - * register still free. Keeping it untransformed puts the length in a register - * and the pointer in memory, as printf expects it. - */ +//===-- abi-x86-64.cpp ----------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// extern(C) implements the C calling convention for x86-64, as found in +// http://www.x86-64.org/documentation/abi-0.99.pdf +// +// Note: +// Where a discrepancy was found between llvm-gcc and the ABI documentation, +// llvm-gcc behavior was used for compatibility (after it was verified that +// regular gcc has the same behavior). +// +// LLVM gets it right for most types, but complex numbers and structs need some +// help. To make sure it gets those right we essentially bitcast small structs +// to a type to which LLVM assigns the appropriate registers, and pass that +// instead. Structs that are required to be passed in memory are explicitly +// marked with the ByVal attribute to ensure no part of them ends up in +// registers when only a subset of the desired registers are available. +// +// We don't perform the same transformation for D-specific types that contain +// multiple parts, such as dynamic arrays and delegates. They're passed as if +// the parts were passed as separate parameters. This helps make things like +// printf("%.*s", o.toString()) work as expected; if we didn't do this that +// wouldn't work if there were 4 other integer/pointer arguments before the +// toString() call because the string got bumped to memory with one integer +// register still free. Keeping it untransformed puts the length in a register +// and the pointer in memory, as printf expects it. +// +//===----------------------------------------------------------------------===// #include "mtype.h" #include "declaration.h" diff --git a/gen/abi-x86-64.h b/gen/abi-x86-64.h index d5ad76cc..8ce2376a 100644 --- a/gen/abi-x86-64.h +++ b/gen/abi-x86-64.h @@ -1,3 +1,16 @@ +//===-- gen/abi-x86-64.h - x86_64 ABI description ---------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// The ABI implementation used for 64 bit x86 (i.e. x86_64/AMD64/x64) targets. +// +//===----------------------------------------------------------------------===// + #ifndef __LDC_GEN_ABI_X86_64_H__ #define __LDC_GEN_ABI_X86_64_H__ diff --git a/gen/abi-x86.cpp b/gen/abi-x86.cpp index 1be10a85..a5b768e0 100644 --- a/gen/abi-x86.cpp +++ b/gen/abi-x86.cpp @@ -1,3 +1,12 @@ +//===-- abi-x86.cpp -------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "mars.h" diff --git a/gen/abi-x86.h b/gen/abi-x86.h index 0fe6a2a8..70638e04 100644 --- a/gen/abi-x86.h +++ b/gen/abi-x86.h @@ -1,3 +1,16 @@ +//===-- gen/abi-x86.h - x86 ABI description ---------------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// The ABI implementation used for 32 bit x86 targets. +// +//===----------------------------------------------------------------------===// + #ifndef __LDC_GEN_ABI_X86_H__ #define __LDC_GEN_ABI_X86_H__ diff --git a/gen/abi.cpp b/gen/abi.cpp index 67761579..64850688 100644 --- a/gen/abi.cpp +++ b/gen/abi.cpp @@ -1,3 +1,12 @@ +//===-- abi.cpp -----------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include diff --git a/gen/abi.h b/gen/abi.h index 48a7fe48..9eda79a7 100644 --- a/gen/abi.h +++ b/gen/abi.h @@ -1,3 +1,19 @@ +//===-- gen/abi.h - Target ABI description for IR generation ----*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// This interface is used by the IR generation code to accomodate any +// additional transformations necessary for the given target ABI (the direct +// LLVM IR representation for C structs unfortunately does not always lead to +// the right ABI, for example on x86_64). +// +//===----------------------------------------------------------------------===// + #ifndef __LDC_GEN_ABI_H__ #define __LDC_GEN_ABI_H__ diff --git a/gen/arrays.cpp b/gen/arrays.cpp index a39744c4..058f8a79 100644 --- a/gen/arrays.cpp +++ b/gen/arrays.cpp @@ -1,3 +1,12 @@ +//===-- arrays.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "mtype.h" diff --git a/gen/arrays.h b/gen/arrays.h index 409cf123..4d2d18a3 100644 --- a/gen/arrays.h +++ b/gen/arrays.h @@ -1,3 +1,16 @@ +//===-- gen/arrays.h - D array codegen helpers ------------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Helper functions for manipulating D dynamic array (slice) types/values. +// +//===----------------------------------------------------------------------===// + #ifndef LLVMC_GEN_ARRAYS_H #define LLVMC_GEN_ARRAYS_H diff --git a/gen/asm-x86-32.h b/gen/asm-x86-32.h index 31882afb..064d0843 100644 --- a/gen/asm-x86-32.h +++ b/gen/asm-x86-32.h @@ -1,5 +1,16 @@ -// Taken from GDC source tree. Original by David Friedman. -// Released under the Artistic License found in dmd/artistic.txt +//===-- gen/asm-x86-32.h - x86 inline assembler handling --------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file originates from work by David Friedman for GDC released under +// the GPL 2 and Artistic licenses. See the LICENSE file for details. +// +//===----------------------------------------------------------------------===// +// +// Parses "DMD-style" x86 inline assembly blocks and converts them to +// GDC/LLVM inline assembler syntax. +// +//===----------------------------------------------------------------------===// #include "id.h" #if defined(_MSC_VER) diff --git a/gen/asm-x86-64.h b/gen/asm-x86-64.h index 88e1a42b..92c23e4d 100644 --- a/gen/asm-x86-64.h +++ b/gen/asm-x86-64.h @@ -1,5 +1,16 @@ -// Taken from GDC source tree. Original by David Friedman. -// Released under the Artistic License found in dmd/artistic.txt +//===-- gen/asm-x86-64.h - x86_64 inline assembler handling -----*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file originates from work by David Friedman for GDC released under +// the GPL 2 and Artistic licenses. See the LICENSE file for details. +// +//===----------------------------------------------------------------------===// +// +// Parses "DMD-style" x86_64 inline assembly blocks and converts them to +// GDC/LLVM inline assembler syntax. +// +//===----------------------------------------------------------------------===// #include "id.h" #if defined(_MSC_VER) diff --git a/gen/asmstmt.cpp b/gen/asmstmt.cpp index 145942a5..957e8b63 100644 --- a/gen/asmstmt.cpp +++ b/gen/asmstmt.cpp @@ -1,5 +1,11 @@ -// Taken from GDC source tree. Original by David Friedman. -// Released under the Artistic License found in dmd/artistic.txt +//===-- asmstmt.cpp -------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file originates from work by David Friedman for GDC released under +// the GPL 2 and Artistic licenses. See the LICENSE file for details. +// +//===----------------------------------------------------------------------===// #include "gen/llvm.h" #include "llvm/InlineAsm.h" diff --git a/gen/binops.cpp b/gen/binops.cpp index 6829660c..098171ef 100644 --- a/gen/binops.cpp +++ b/gen/binops.cpp @@ -1,3 +1,12 @@ +//===-- binops.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "declaration.h" diff --git a/gen/cl_helpers.cpp b/gen/cl_helpers.cpp index 6b09c384..dcfe59dc 100644 --- a/gen/cl_helpers.cpp +++ b/gen/cl_helpers.cpp @@ -1,3 +1,12 @@ +//===-- cl_helpers.cpp ----------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/cl_helpers.h" #include "mars.h" diff --git a/gen/cl_helpers.h b/gen/cl_helpers.h index 03205661..06bd195d 100644 --- a/gen/cl_helpers.h +++ b/gen/cl_helpers.h @@ -1,3 +1,17 @@ +//===-- gen/cl_helpers.h - Command line processing helpers ------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Helpers to augment the LLVM command line parsing library with some extra +// functionality. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_CL_HELPERS_H #define LDC_CL_HELPERS_H diff --git a/gen/classes.cpp b/gen/classes.cpp index 2e268bea..de904edc 100644 --- a/gen/classes.cpp +++ b/gen/classes.cpp @@ -1,3 +1,12 @@ +//===-- classes.cpp -------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "mtype.h" diff --git a/gen/classes.h b/gen/classes.h index 4c65084f..27be1b99 100644 --- a/gen/classes.h +++ b/gen/classes.h @@ -1,3 +1,17 @@ +//===-- gen/classes.h - D class code generation -----------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Functions for generating LLVM types and init/TypeInfo/etc. values from D +// class declarations and handling class instance values. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_CLASSES_H #define LDC_GEN_CLASSES_H diff --git a/gen/complex.cpp b/gen/complex.cpp index 948b617b..6c01e3d6 100644 --- a/gen/complex.cpp +++ b/gen/complex.cpp @@ -1,3 +1,12 @@ +//===-- complex.cpp -------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "mtype.h" diff --git a/gen/complex.h b/gen/complex.h index a7533e35..abdffe6c 100644 --- a/gen/complex.h +++ b/gen/complex.h @@ -1,3 +1,16 @@ +//===-- gen/cl_helpers.h - Complex number code generation -------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Functions for generating code for D complex number operations. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_COMPLEX_H #define LDC_GEN_COMPLEX_H diff --git a/gen/declarations.cpp b/gen/declarations.cpp index ff0c0476..8d5a5b02 100644 --- a/gen/declarations.cpp +++ b/gen/declarations.cpp @@ -1,3 +1,12 @@ +//===-- declarations.cpp --------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "aggregate.h" diff --git a/gen/dvalue.cpp b/gen/dvalue.cpp index e0057654..05ef76af 100644 --- a/gen/dvalue.cpp +++ b/gen/dvalue.cpp @@ -1,3 +1,12 @@ +//===-- dvalue.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "gen/tollvm.h" diff --git a/gen/dvalue.h b/gen/dvalue.h index 55255a5f..fa1982e2 100644 --- a/gen/dvalue.h +++ b/gen/dvalue.h @@ -1,12 +1,22 @@ +//===-- gen/dvalue.h - D value abstractions ---------------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// These classes are used for generating the IR. They encapsulate an LLVM value +// together with a D type and provide an uniform interface for the most common +// operations. When more specialize handling is necessary, they hold enough +// information to do-the-right-thing (TM). +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_DVALUE_H #define LDC_GEN_DVALUE_H -/* -These classes are used for generating the IR. They encapsulate D values and -provide a common interface to the most common operations. When more specialized -handling is necessary, they hold enough information to do-the-right-thing (TM) -*/ - #include #include "root.h" diff --git a/gen/functions.cpp b/gen/functions.cpp index 9d54407e..1912d350 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -1,3 +1,12 @@ +//===-- functions.cpp -----------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "llvm/Support/CFG.h" #include "llvm/Intrinsics.h" diff --git a/gen/functions.h b/gen/functions.h index 390422f1..0be3a73c 100644 --- a/gen/functions.h +++ b/gen/functions.h @@ -1,3 +1,16 @@ +//===-- gen/functions.h - D function codegen --------------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Code generation for D function types and bodies. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_FUNCTIONS_H #define LDC_GEN_FUNCTIONS_H diff --git a/gen/irstate.cpp b/gen/irstate.cpp index ffd22751..94835a71 100644 --- a/gen/irstate.cpp +++ b/gen/irstate.cpp @@ -1,8 +1,11 @@ -/* DMDFE backend stubs - * This file contains the implementations of the backend routines. - * For dmdfe these do nothing but print a message saying the module - * has been parsed. Substitute your own behaviors for these routimes. - */ +//===-- irstate.cpp -------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// #include diff --git a/gen/irstate.h b/gen/irstate.h index 2a19aaac..009b8238 100644 --- a/gen/irstate.h +++ b/gen/irstate.h @@ -1,3 +1,17 @@ +//===-- gen/irstate.h - Global codegen state --------------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the global state used and modified when generating the +// code (i.e. LLVM IR) for a given D module. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_IRSTATE_H #define LDC_GEN_IRSTATE_H diff --git a/gen/linkage.cpp b/gen/linkage.cpp index ba77f90f..6f75a881 100644 --- a/gen/linkage.cpp +++ b/gen/linkage.cpp @@ -1,3 +1,12 @@ +//===-- linkage.cpp -------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "linkage.h" LLGlobalValue::LinkageTypes templateLinkage; diff --git a/gen/linkage.h b/gen/linkage.h index ccd0eac0..7bbea3dc 100644 --- a/gen/linkage.h +++ b/gen/linkage.h @@ -1,3 +1,16 @@ +//===-- gen/linkage.h - Common linkage types --------------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Linkage types used for certain constructs (templates, TypeInfo). +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_LINKAGE_H #define LDC_GEN_LINKAGE_H diff --git a/gen/llvm.h b/gen/llvm.h index aa137e1b..b6cc1a89 100644 --- a/gen/llvm.h +++ b/gen/llvm.h @@ -1,3 +1,20 @@ +//===-- gen/llvm.h - Common LLVM includes and aliases -----------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Pulls in commonly used LLVM headers and provides shorthands for some LLVM +// types. +// +// TODO: Consider removing this file; the aliases mostly make code more +// cumbersome to read for people familiar with LLVM anyway. +// +//===----------------------------------------------------------------------===// + #ifndef GEN_LLVM_H #define GEN_LLVM_H diff --git a/gen/llvmcompat.cpp b/gen/llvmcompat.cpp index 0c48c3e5..bc4adc5d 100644 --- a/gen/llvmcompat.cpp +++ b/gen/llvmcompat.cpp @@ -1,3 +1,11 @@ +//===-- llvmcompat.cpp ----------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// #include "gen/llvmcompat.h" #include "llvm/Config/llvm-config.h" diff --git a/gen/llvmcompat.h b/gen/llvmcompat.h index 161168c6..b73d346a 100644 --- a/gen/llvmcompat.h +++ b/gen/llvmcompat.h @@ -1,3 +1,18 @@ +//===-- gen/llvmcompat.h - LLVM API compatibilty shims ----------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Provides a central place to handle API changes between supported LLVM +// versions. +// +//===----------------------------------------------------------------------===// + + #ifdef _MSC_VER #pragma once #endif diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 114e2fd8..9be258bb 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -1,3 +1,12 @@ +//===-- llvmhelpers.cpp ---------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvmhelpers.h" #include "gen/llvm.h" diff --git a/gen/llvmhelpers.h b/gen/llvmhelpers.h index e911aad3..f05e2d35 100644 --- a/gen/llvmhelpers.h +++ b/gen/llvmhelpers.h @@ -1,3 +1,18 @@ +//===-- gen/llvmhelpers.h - General LLVM codegen helpers --------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// General codegen helper constructs. +// +// TODO: Merge with gen/tollvm.h, then refactor into sensible parts. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_LLVMHELPERS_H #define LDC_GEN_LLVMHELPERS_H diff --git a/gen/logger.cpp b/gen/logger.cpp index 6b4736f5..6f737c46 100644 --- a/gen/logger.cpp +++ b/gen/logger.cpp @@ -1,3 +1,12 @@ +//===-- logger.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include #include #include diff --git a/gen/logger.h b/gen/logger.h index 62069859..52c12a43 100644 --- a/gen/logger.h +++ b/gen/logger.h @@ -1,3 +1,17 @@ +//===-- gen/logger.h - Codegen debug logging --------------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Defines a common interface for logging debug information during code +// generation. +// +//===----------------------------------------------------------------------===// + #ifndef _llvmd_gen_logger_h_ #define _llvmd_gen_logger_h_ diff --git a/gen/metadata.h b/gen/metadata.h index a9525ed2..394ec8f7 100644 --- a/gen/metadata.h +++ b/gen/metadata.h @@ -1,3 +1,16 @@ +//===-- gen/metadata.h - LDC-specific LLVM metadata definitions -*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Defines the types of LLVM metadata used for D-specific optimization passes. +// +//===----------------------------------------------------------------------===// + #if USE_METADATA #ifndef LDC_GEN_METADATA_H diff --git a/gen/module.cpp b/gen/module.cpp index da6e1a50..6a57a3b6 100644 --- a/gen/module.cpp +++ b/gen/module.cpp @@ -1,3 +1,12 @@ +//===-- module.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Module.h" diff --git a/gen/naked.cpp b/gen/naked.cpp index 3863afc0..fbe201ff 100644 --- a/gen/naked.cpp +++ b/gen/naked.cpp @@ -1,3 +1,12 @@ +//===-- naked.cpp ---------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "llvm/InlineAsm.h" diff --git a/gen/nested.cpp b/gen/nested.cpp index de5cbe8a..b8a12940 100644 --- a/gen/nested.cpp +++ b/gen/nested.cpp @@ -1,3 +1,12 @@ +//===-- nested.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/nested.h" #include "gen/dvalue.h" diff --git a/gen/nested.h b/gen/nested.h index 91f0a002..3eaa6fa9 100644 --- a/gen/nested.h +++ b/gen/nested.h @@ -1,3 +1,17 @@ +//===-- gen/nested.h - Nested context handling ------------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Functions for creating nested contexts for nested D types/functions and +// extracting the values from them. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_NESTED_H #define LDC_GEN_NESTED_H diff --git a/gen/optimizer.cpp b/gen/optimizer.cpp index 09976693..b98f5380 100644 --- a/gen/optimizer.cpp +++ b/gen/optimizer.cpp @@ -1,3 +1,12 @@ +//===-- optimizer.cpp -----------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/optimizer.h" #include "gen/cl_helpers.h" #include "gen/logger.h" diff --git a/gen/optimizer.h b/gen/optimizer.h index a45d22f4..8f4950e1 100644 --- a/gen/optimizer.h +++ b/gen/optimizer.h @@ -1,3 +1,17 @@ +//===-- gen/optimizer.h - LLVM IR optimization ------------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Handles the optimization of the generated LLVM modules according to the +// specified optimization level. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_OPTIMIZER_H #define LDC_GEN_OPTIMIZER_H diff --git a/gen/passes/GarbageCollect2Stack.cpp b/gen/passes/GarbageCollect2Stack.cpp index 9d6607e5..30a2c4ed 100644 --- a/gen/passes/GarbageCollect2Stack.cpp +++ b/gen/passes/GarbageCollect2Stack.cpp @@ -1,11 +1,11 @@ #if USE_METADATA -//===- GarbageCollect2Stack - Optimize calls to the D garbage collector ---===// +//===-- GarbageCollect2Stack.cpp - Promote or remove GC allocations -------===// // -// The LLVM D Compiler +// LDC – the LLVM D compiler // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. // //===----------------------------------------------------------------------===// // diff --git a/gen/passes/Passes.h b/gen/passes/Passes.h index 5117fd40..16368762 100644 --- a/gen/passes/Passes.h +++ b/gen/passes/Passes.h @@ -1,3 +1,16 @@ +//===-- gen/passes/Passes.h - LDC-specific LLVM passes ----------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Functions for creating the LDC-specific LLVM optimizer passes. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_PASSES_H #define LDC_PASSES_H diff --git a/gen/passes/SimplifyDRuntimeCalls.cpp b/gen/passes/SimplifyDRuntimeCalls.cpp index 98d7978a..ecf9f534 100644 --- a/gen/passes/SimplifyDRuntimeCalls.cpp +++ b/gen/passes/SimplifyDRuntimeCalls.cpp @@ -1,9 +1,9 @@ -//===- SimplifyDRuntimeCalls - Optimize calls to the D runtime library ----===// +//===-- SimplifyDRuntimeCalls.cpp - Optimize druntime calls ---------------===// // -// The LLVM D Compiler +// LDC – the LLVM D compiler // // This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// License. See the LICENSE file for details. // //===----------------------------------------------------------------------===// // diff --git a/gen/passes/StripExternals.cpp b/gen/passes/StripExternals.cpp index d971fcf5..fdd0dd85 100644 --- a/gen/passes/StripExternals.cpp +++ b/gen/passes/StripExternals.cpp @@ -1,9 +1,9 @@ //===-- StripExternals.cpp - Strip available_externally symbols -----------===// // -// The LLVM D Compiler +// LDC – the LLVM D compiler // -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. // //===----------------------------------------------------------------------===// // diff --git a/gen/pragma.cpp b/gen/pragma.cpp index fd1bcb6b..cff212a0 100644 --- a/gen/pragma.cpp +++ b/gen/pragma.cpp @@ -1,3 +1,12 @@ +//===-- pragma.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "pragma.h" #include "attrib.h" #include "id.h" diff --git a/gen/pragma.h b/gen/pragma.h index 8ff39401..a8b9631f 100644 --- a/gen/pragma.h +++ b/gen/pragma.h @@ -1,3 +1,16 @@ +//===-- gen/pragma.h - LDC-specific pragma handling -------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Code for handling the LDC-specific pragmas. +// +//===----------------------------------------------------------------------===// + #ifndef PRAGMA_H #define PRAGMA_H diff --git a/gen/programs.cpp b/gen/programs.cpp index 401ab193..b36d2c8b 100644 --- a/gen/programs.cpp +++ b/gen/programs.cpp @@ -1,3 +1,12 @@ +//===-- programs.cpp ------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/programs.h" #include "llvm/Support/CommandLine.h" diff --git a/gen/programs.h b/gen/programs.h index c0cc44a6..fda3f9de 100644 --- a/gen/programs.h +++ b/gen/programs.h @@ -1,3 +1,16 @@ +//===-- gen/programs.h - External tool discovery ----------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Functions for discovering the external tools used for linking, etc. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_PROGRAMS_H #define LDC_GEN_PROGRAMS_H diff --git a/gen/rttibuilder.cpp b/gen/rttibuilder.cpp index 985dcc97..0aede9ff 100644 --- a/gen/rttibuilder.cpp +++ b/gen/rttibuilder.cpp @@ -1,3 +1,12 @@ +//===-- rttibuilder.cpp ---------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "aggregate.h" diff --git a/gen/rttibuilder.h b/gen/rttibuilder.h index 98f2598b..8bb47b29 100644 --- a/gen/rttibuilder.h +++ b/gen/rttibuilder.h @@ -1,3 +1,17 @@ +//===-- gen/rttibuilder.h - TypeInfo generation helper ----------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// This class is used to build the global TypeInfo/ClassInfo/... constants +// required for the D runtime type information system. +// +//===----------------------------------------------------------------------===// + #ifndef __LDC_GEN_RTTIBUILDER_H__ #define __LDC_GEN_RTTIBUILDER_H__ diff --git a/gen/runtime.cpp b/gen/runtime.cpp index 0bf9d0e0..069f87fe 100644 --- a/gen/runtime.cpp +++ b/gen/runtime.cpp @@ -1,3 +1,12 @@ +//===-- runtime.cpp -------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "llvm/Module.h" #include "llvm/Attributes.h" diff --git a/gen/runtime.h b/gen/runtime.h index 21c8841a..6d60c57d 100644 --- a/gen/runtime.h +++ b/gen/runtime.h @@ -1,3 +1,16 @@ +//===-- gen/runtime.h - D runtime function handlers -------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Code for handling the compiler support functions from the D runtime library. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_RUNTIME_H_ #define LDC_GEN_RUNTIME_H_ diff --git a/gen/statements.cpp b/gen/statements.cpp index 2d1072a4..00f5fb62 100644 --- a/gen/statements.cpp +++ b/gen/statements.cpp @@ -1,4 +1,12 @@ -// Statements: D -> LLVM glue +//===-- statements.cpp ----------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include #include diff --git a/gen/structs.cpp b/gen/structs.cpp index 96380838..96adac01 100644 --- a/gen/structs.cpp +++ b/gen/structs.cpp @@ -1,3 +1,12 @@ +//===-- structs.cpp -------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include #include "gen/llvm.h" diff --git a/gen/structs.h b/gen/structs.h index 8fc116fa..f0a77913 100644 --- a/gen/structs.h +++ b/gen/structs.h @@ -1,3 +1,16 @@ +//===-- gen/structs.h - D struct codegen ------------------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Functions for D struct codegen. +// +//===----------------------------------------------------------------------===// + #ifndef LLVMD_GEN_STRUCTS_H #define LLVMD_GEN_STRUCTS_H diff --git a/gen/tocall.cpp b/gen/tocall.cpp index d5c6e8ca..bf3dc9ed 100644 --- a/gen/tocall.cpp +++ b/gen/tocall.cpp @@ -1,3 +1,12 @@ +//===-- tocall.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "mtype.h" diff --git a/gen/todebug.cpp b/gen/todebug.cpp index fb981f33..e50f9b6c 100644 --- a/gen/todebug.cpp +++ b/gen/todebug.cpp @@ -1,3 +1,12 @@ +//===-- todebug.cpp -------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/Support/Dwarf.h" diff --git a/gen/todebug.h b/gen/todebug.h index ec69bc2f..0e572bae 100644 --- a/gen/todebug.h +++ b/gen/todebug.h @@ -1,3 +1,16 @@ +//===-- gen/todebug.h - Symbolic debug information generation ---*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Handles generation of symbolic debug information using LLVM's DWARF support. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_TODEBUG_H #define LDC_GEN_TODEBUG_H diff --git a/gen/toir.cpp b/gen/toir.cpp index db0234be..8d68ded1 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -1,10 +1,11 @@ -// Backend stubs - -/* DMDFE backend stubs - * This file contains the implementations of the backend routines. - * For dmdfe these do nothing but print a message saying the module - * has been parsed. Substitute your own behaviors for these routimes. - */ +//===-- toir.cpp ----------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// #include #include diff --git a/gen/tollvm.cpp b/gen/tollvm.cpp index 20fe312a..a3e9139a 100644 --- a/gen/tollvm.cpp +++ b/gen/tollvm.cpp @@ -1,3 +1,11 @@ +//===-- tollvm.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// #include "gen/llvm.h" diff --git a/gen/tollvm.h b/gen/tollvm.h index eb9cbce1..5e0530a9 100644 --- a/gen/tollvm.h +++ b/gen/tollvm.h @@ -1,3 +1,18 @@ +//===-- gen/tollvm.h - General LLVM codegen helpers -------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// General codegen helper constructs. +// +// TODO: Merge with gen/llvmhelpers.h, then refactor into sensible parts. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_TOLLVM_H #define LDC_GEN_TOLLVM_H diff --git a/gen/typeinf.h b/gen/typeinf.h index 7e688886..fe993a78 100644 --- a/gen/typeinf.h +++ b/gen/typeinf.h @@ -1,3 +1,17 @@ +//===-- gen/typinf.h - TypeInfo declaration codegen -------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Codegen for the TypeInfo types/constants required by the D run-time type +// information system. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_GEN_TYPEINF_H #define LDC_GEN_TYPEINF_H diff --git a/gen/typinf.cpp b/gen/typinf.cpp index 1d1a17a1..02c375e3 100644 --- a/gen/typinf.cpp +++ b/gen/typinf.cpp @@ -1,4 +1,12 @@ - +//===-- typinf.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file mostly consists of code under the BSD-style LDC license, but some +// parts have been derived from DMD as noted below. See the LICENSE file for +// details. +// +//===----------------------------------------------------------------------===// // Copyright (c) 1999-2004 by Digital Mars // All Rights Reserved diff --git a/gen/utils.h b/gen/utils.h index b4a3b4b5..8d7c1e6e 100644 --- a/gen/utils.h +++ b/gen/utils.h @@ -1,3 +1,16 @@ +//===-- gen/utils.h - Utilities for handling frontend types -----*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Some utilities for handling front-end types in a more C++-like fashion. +// +//===----------------------------------------------------------------------===// + #ifndef __LDC_GEN_UTILS_H__ #define __LDC_GEN_UTILS_H__ diff --git a/gen/warnings.cpp b/gen/warnings.cpp index 450e43d8..f3b59846 100644 --- a/gen/warnings.cpp +++ b/gen/warnings.cpp @@ -1,3 +1,12 @@ +//===-- warnings.cpp ------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "mars.h" #include "mtype.h" #include "expression.h" diff --git a/gen/warnings.h b/gen/warnings.h index 13ed63c1..7367c6d2 100644 --- a/gen/warnings.h +++ b/gen/warnings.h @@ -1,3 +1,16 @@ +//===-- gen/warnings.h - LDC-specific warning handling ----------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Functionality for emitting additional warnings during codegen. +// +//===----------------------------------------------------------------------===// + #ifndef __LDC_GEN_WARNINGS_H__ #define __LDC_GEN_WARNINGS_H__ diff --git a/ir/ir.cpp b/ir/ir.cpp index 339b1a23..6dc953c0 100644 --- a/ir/ir.cpp +++ b/ir/ir.cpp @@ -1,3 +1,12 @@ +//===-- ir.cpp ------------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #if LDC_LLVM_VER >= 302 #include "llvm/DataLayout.h" #else diff --git a/ir/ir.h b/ir/ir.h index 3f60780c..dbca3572 100644 --- a/ir/ir.h +++ b/ir/ir.h @@ -1,4 +1,17 @@ -// this head contains stuff used by all the IR +//===-- ir/ir.h - Base definitions for codegen metadata ---------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Declares the base class for all codegen info classes and the top-level Ir +// class. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_IR_IR_H #define LDC_IR_IR_H diff --git a/ir/irclass.cpp b/ir/irclass.cpp index 3d92881f..248d4e42 100644 --- a/ir/irclass.cpp +++ b/ir/irclass.cpp @@ -1,3 +1,12 @@ +//===-- irclass.cpp -------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" diff --git a/ir/irdsymbol.cpp b/ir/irdsymbol.cpp index e0480aa8..598001b9 100644 --- a/ir/irdsymbol.cpp +++ b/ir/irdsymbol.cpp @@ -1,3 +1,12 @@ +//===-- irdsymbol.cpp -----------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "ir/ir.h" #include "ir/irdsymbol.h" diff --git a/ir/irdsymbol.h b/ir/irdsymbol.h index 94b0fd18..ca9a0124 100644 --- a/ir/irdsymbol.h +++ b/ir/irdsymbol.h @@ -1,3 +1,16 @@ +//===-- ir/irdsymbol.h - Codegen state for D symbols ------------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Represents the status of a D symbol on its way though the codegen process. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_IR_IRDSYMBOL_H #define LDC_IR_IRDSYMBOL_H diff --git a/ir/irforw.h b/ir/irforw.h index 720d2790..87b46330 100644 --- a/ir/irforw.h +++ b/ir/irforw.h @@ -1,3 +1,17 @@ +//===-- ir/irforw.h - Forward declarations used in ir/ code ----*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Some common forward declarations for use in ir/ headers. +// +//===----------------------------------------------------------------------===// + + #ifndef LDC_IR_IRFORW_H #define LDC_IR_IRFORW_H diff --git a/ir/irfunction.cpp b/ir/irfunction.cpp index 99a59f69..c103755f 100644 --- a/ir/irfunction.cpp +++ b/ir/irfunction.cpp @@ -1,3 +1,11 @@ +//===-- irfunction.cpp ----------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// #include "gen/llvm.h" #include "gen/tollvm.h" diff --git a/ir/irfunction.h b/ir/irfunction.h index 03cb12cd..74acb488 100644 --- a/ir/irfunction.h +++ b/ir/irfunction.h @@ -1,3 +1,18 @@ +//===-- ir/irfunction.h - Codegen state for D functions ---------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Represents the status of a D function/method/... on its way through the +// codegen process. +// +//===----------------------------------------------------------------------===// + + #ifndef LDC_IR_IRFUNCTION_H #define LDC_IR_IRFUNCTION_H diff --git a/ir/irfuncty.h b/ir/irfuncty.h index 22fbdf2e..1ce0a0b8 100644 --- a/ir/irfuncty.h +++ b/ir/irfuncty.h @@ -1,3 +1,18 @@ +//===-- ir/irfuncty.h - Function type codegen metadata ----------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Additional information attached to a function type during codegen. Handles +// LLVM attributes attached to a function and its parameters, etc. +// +//===----------------------------------------------------------------------===// + + #ifndef LDC_IR_IRFUNCTY_H #define LDC_IR_IRFUNCTY_H diff --git a/ir/irlandingpad.cpp b/ir/irlandingpad.cpp index 491d5089..900ff773 100644 --- a/ir/irlandingpad.cpp +++ b/ir/irlandingpad.cpp @@ -1,3 +1,12 @@ +//===-- irlandingpad.cpp --------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "gen/tollvm.h" #include "gen/irstate.h" diff --git a/ir/irlandingpad.h b/ir/irlandingpad.h index 78e3f37f..e3789882 100644 --- a/ir/irlandingpad.h +++ b/ir/irlandingpad.h @@ -1,3 +1,17 @@ +//===-- ir/irlandingpad.h - Codegen state for EH blocks ---------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// State kept while doing codegen for a single "EH block" consisting of +// of several catch/finally/cleanup clauses. Handles nesting of these blocks. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_IR_IRLANDINGPADINFO_H #define LDC_IR_IRLANDINGPADINFO_H diff --git a/ir/irmodule.cpp b/ir/irmodule.cpp index 64bcd254..80d32a66 100644 --- a/ir/irmodule.cpp +++ b/ir/irmodule.cpp @@ -1,3 +1,12 @@ +//===-- irmodule.cpp ------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "gen/tollvm.h" #include "gen/irstate.h" diff --git a/ir/irmodule.h b/ir/irmodule.h index af12d904..8fcd2d6e 100644 --- a/ir/irmodule.h +++ b/ir/irmodule.h @@ -1,3 +1,17 @@ +//===-- ir/irmodule.h - Codegen state for top-level D modules ---*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Represents the state of a D module on its way through code generation. Also +// see the TODO in gen/module.cpp – parts of IRState really belong here. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_IR_IRMODULE_H #define LDC_IR_IRMODULE_H diff --git a/ir/irstruct.cpp b/ir/irstruct.cpp index 9dc1a192..046e41b2 100644 --- a/ir/irstruct.cpp +++ b/ir/irstruct.cpp @@ -1,3 +1,12 @@ +//===-- irstruct.cpp ------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "mtype.h" diff --git a/ir/irstruct.h b/ir/irstruct.h index 49faf2c5..cb0c6f32 100644 --- a/ir/irstruct.h +++ b/ir/irstruct.h @@ -1,3 +1,17 @@ +//===-- ir/irstruct.h - Codegen state for D aggregates ----------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Represents the state of a D aggregate (struct/class) on its way through +// codegen, also managing the associated init and RTTI symbols. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_IR_IRSTRUCT_H #define LDC_IR_IRSTRUCT_H diff --git a/ir/irtype.cpp b/ir/irtype.cpp index 45f60455..499e855d 100644 --- a/ir/irtype.cpp +++ b/ir/irtype.cpp @@ -1,3 +1,12 @@ +//===-- irtype.cpp --------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "llvm/DerivedTypes.h" #include "llvm/LLVMContext.h" #include "mars.h" diff --git a/ir/irtype.h b/ir/irtype.h index 743737b4..cb5dd090 100644 --- a/ir/irtype.h +++ b/ir/irtype.h @@ -1,3 +1,19 @@ +//===-- ir/irtype.h - IrType base and primitive types -----------*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// The types derived from IrType are used to attach LLVM type information and +// other codegen metadata (e.g. for vtbl resolution) to frontend Types. There +// is an 1:1 correspondence between Type and IrType instances. +// +//===----------------------------------------------------------------------===// + + #ifndef __LDC_IR_IRTYPE_H__ #define __LDC_IR_IRTYPE_H__ diff --git a/ir/irtypeclass.cpp b/ir/irtypeclass.cpp index ebe61715..c1d5435e 100644 --- a/ir/irtypeclass.cpp +++ b/ir/irtypeclass.cpp @@ -1,3 +1,12 @@ +//===-- irtypeclass.cpp ---------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "llvm/DerivedTypes.h" #include "aggregate.h" diff --git a/ir/irtypeclass.h b/ir/irtypeclass.h index 8459b6d8..6e6c5b43 100644 --- a/ir/irtypeclass.h +++ b/ir/irtypeclass.h @@ -1,3 +1,16 @@ +//===-- ir/irtypeclass.h - IrType implementation for D classes --*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Provides the IrType subclass used to represent D classes. +// +//===----------------------------------------------------------------------===// + #ifndef __LDC_IR_IRTYPECLASS_H__ #define __LDC_IR_IRTYPECLASS_H__ diff --git a/ir/irtypefunction.cpp b/ir/irtypefunction.cpp index 6707d0d8..7ffeaf7b 100644 --- a/ir/irtypefunction.cpp +++ b/ir/irtypefunction.cpp @@ -1,3 +1,12 @@ +//===-- irtypefunction.cpp ------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "llvm/DerivedTypes.h" #include "mtype.h" diff --git a/ir/irtypefunction.h b/ir/irtypefunction.h index 14bfda5c..528b07a3 100644 --- a/ir/irtypefunction.h +++ b/ir/irtypefunction.h @@ -1,3 +1,16 @@ +//===-- ir/irtypefunction.h - IrType subclasses for callables ---*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Provides the IrType subclasses used to represent D function/delegate types. +// +//===----------------------------------------------------------------------===// + #ifndef __LDC_IR_IRTYPEFUNCTION_H__ #define __LDC_IR_IRTYPEFUNCTION_H__ diff --git a/ir/irtypestruct.cpp b/ir/irtypestruct.cpp index 2cd128ed..0990c2b9 100644 --- a/ir/irtypestruct.cpp +++ b/ir/irtypestruct.cpp @@ -1,3 +1,12 @@ +//===-- irtypestruct.cpp --------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "llvm/DerivedTypes.h" #include "aggregate.h" diff --git a/ir/irtypestruct.h b/ir/irtypestruct.h index 7417fc0c..d1ad3e72 100644 --- a/ir/irtypestruct.h +++ b/ir/irtypestruct.h @@ -1,3 +1,17 @@ +//===-- ir/irtypestruct.h - IrType subclasses for aggregates ----*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Provides the IrType subclasses used to represent D struct types +// (see irtypeclass.h for the class version). +// +//===----------------------------------------------------------------------===// + #ifndef __LDC_IR_IRTYPESTRUCT_H__ #define __LDC_IR_IRTYPESTRUCT_H__ diff --git a/ir/irvar.cpp b/ir/irvar.cpp index e338f123..5b8ec6b0 100644 --- a/ir/irvar.cpp +++ b/ir/irvar.cpp @@ -1,3 +1,12 @@ +//===-- irvar.cpp ---------------------------------------------------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// + #include "gen/llvm.h" #include "declaration.h" #include "gen/irstate.h" diff --git a/ir/irvar.h b/ir/irvar.h index 680c112b..dbd29dd2 100644 --- a/ir/irvar.h +++ b/ir/irvar.h @@ -1,3 +1,17 @@ +//===-- ir/irdsymbol.h - Codegen state for D vars/fields/params -*- C++ -*-===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// Classes for representing the status of D variables on their way though the +// codegen process. +// +//===----------------------------------------------------------------------===// + #ifndef LDC_IR_IRVAR_H #define LDC_IR_IRVAR_H diff --git a/utils/gen_gccbuiltins.cpp b/utils/gen_gccbuiltins.cpp index 96c48967..b92d9585 100644 --- a/utils/gen_gccbuiltins.cpp +++ b/utils/gen_gccbuiltins.cpp @@ -1,3 +1,18 @@ +//===-- gen_gccbuiltins.cpp - GCC builtin module generator ----------------===// +// +// LDC – the LLVM D compiler +// +// This file is distributed under the BSD-style LDC license. See the LICENSE +// file for details. +// +//===----------------------------------------------------------------------===// +// +// This tool reads the GCC builtin definitions from LLVM's Intrinsics.td for +// a given architecture and accordingly generates a ldc.gccbuiltins_ +// module for using them from D code. +// +//===----------------------------------------------------------------------===// + #include #include #include @@ -59,7 +74,7 @@ string dtype(Record* rec) string attributes(ListInit* propertyList) { - string prop = propertyList->getSize() ? + string prop = propertyList->getSize() ? propertyList->getElementAsRecord(0)->getName() : ""; return