First merge of 2.064 beta.

This corresponds to DMD commit a913ce4bc59a94a022a27e390fc841f4aededffb.

Doesn't build Phobos yet.
This commit is contained in:
David Nadlinger
2013-10-19 23:21:53 +02:00
committed by Kai Nacke
parent c400d180d2
commit cb341586e3
130 changed files with 13566 additions and 9190 deletions

View File

@@ -1,5 +1,5 @@
// Copyright (c) 1999-2012 by Digital Mars
// Copyright (c) 1999-2013 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
@@ -14,20 +14,20 @@
#pragma once
#endif
struct Dsymbol;
struct ScopeDsymbol;
struct Identifier;
struct Module;
struct Statement;
struct SwitchStatement;
struct TryFinallyStatement;
struct LabelStatement;
struct ForeachStatement;
struct ClassDeclaration;
struct AggregateDeclaration;
struct FuncDeclaration;
class Dsymbol;
class ScopeDsymbol;
class Identifier;
class Module;
class Statement;
class SwitchStatement;
class TryFinallyStatement;
class LabelStatement;
class ForeachStatement;
class ClassDeclaration;
class AggregateDeclaration;
class FuncDeclaration;
struct DocComment;
struct TemplateInstance;
class TemplateInstance;
#if IN_LLVM
struct EnclosingHandler;
@@ -51,22 +51,26 @@ enum PROT;
#define CSXreturn 0x20 // seen a return statement
#define CSXany_ctor 0x40 // either this() or super() was called
#define SCOPEctor 1 // constructor type
#define SCOPEstaticif 2 // inside static if
#define SCOPEfree 4 // is on free list
#define SCOPEstaticassert 8 // inside static assert
#define SCOPEdebug 0x10 // inside debug conditional
#define SCOPEctor 0x0001 // constructor type
#define SCOPEstaticif 0x0002 // inside static if
#define SCOPEfree 0x0004 // is on free list
#define SCOPEstaticassert 0x0008 // inside static assert
#define SCOPEdebug 0x0010 // inside debug conditional
#define SCOPEinvariant 0x20 // inside invariant code
#define SCOPErequire 0x40 // inside in contract code
#define SCOPEensure 0x60 // inside out contract code
#define SCOPEcontract 0x60 // [mask] we're inside contract code
#define SCOPEinvariant 0x0020 // inside invariant code
#define SCOPErequire 0x0040 // inside in contract code
#define SCOPEensure 0x0060 // inside out contract code
#define SCOPEcontract 0x0060 // [mask] we're inside contract code
#define SCOPEctfe 0x0080 // inside a ctfe-only expression
#define SCOPEnoaccesscheck 0x0100 // don't do access checks
struct Scope
{
Scope *enclosing; // enclosing Scope
Module *module; // Root module
Module *instantiatingModule; // top level module that started a chain of template instantiations
ScopeDsymbol *scopesym; // current symbol
ScopeDsymbol *sd; // if in static if, and declaring new symbols,
// sd gets the addMember()
@@ -91,16 +95,15 @@ struct Scope
int noctor; // set if constructor calls aren't allowed
int intypeof; // in typeof(exp)
bool speculative; // in __traits(compiles) or typeof(exp)
int parameterSpecialization; // if in template parameter specialization
int noaccesscheck; // don't do access checks
int needctfe; // inside a ctfe-only expression
unsigned callSuper; // primitive flow analysis for constructors
unsigned *fieldinit;
unsigned fieldinit_dim;
structalign_t structalign; // alignment for struct members
enum LINK linkage; // linkage for external functions
LINK linkage; // linkage for external functions
enum PROT protection; // protection for class members
PROT protection; // protection for class members
int explicitProtection; // set if in an explicit protection attribute
StorageClass stc; // storage class
@@ -125,8 +128,14 @@ struct Scope
Scope *push(ScopeDsymbol *ss);
Scope *pop();
Scope *startCTFE();
Scope *endCTFE();
void mergeCallSuper(Loc loc, unsigned cs);
unsigned *saveFieldInit();
void mergeFieldInit(Loc loc, unsigned *cses);
Dsymbol *search(Loc loc, Identifier *ident, Dsymbol **pscopesym);
Dsymbol *search_correct(Identifier *ident);
Dsymbol *insert(Dsymbol *s);