Added LLVM-style license headers to all our files.

This commit is contained in:
David Nadlinger
2012-12-15 23:58:53 +01:00
parent 8b7320c7c2
commit 9458911839
106 changed files with 1207 additions and 85 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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 <iostream>
#include <string>
#include <cassert>

View File

@@ -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

View File

@@ -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."

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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 <cstddef>
#include <fstream>

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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__

View File

@@ -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"

View File

@@ -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__

View File

@@ -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 <algorithm>

View File

@@ -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__

View File

@@ -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"

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

View File

@@ -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 <cassert>
#include "root.h"

View File

@@ -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"

View File

@@ -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

View File

@@ -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 <cstdarg>

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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 <cassert>
#include <cstdarg>
#include <cstdio>

View File

@@ -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_

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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.
//
//===----------------------------------------------------------------------===//
//

View File

@@ -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

View File

@@ -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.
//
//===----------------------------------------------------------------------===//
//

View File

@@ -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.
//
//===----------------------------------------------------------------------===//
//

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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__

View File

@@ -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"

View File

@@ -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_

View File

@@ -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 <stdio.h>
#include <math.h>

View File

@@ -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 <algorithm>
#include "gen/llvm.h"

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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 <stdio.h>
#include <math.h>

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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__

View File

@@ -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"

View File

@@ -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__

View File

@@ -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

15
ir/ir.h
View File

@@ -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

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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__

View File

@@ -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"

View File

@@ -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__

View File

@@ -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"

Some files were not shown because too many files have changed in this diff Show More