mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Merged DMD 2.021 frontend.
Removed generated files from dmd/dmd2 dirs.
This commit is contained in:
367
dmd/id.c
367
dmd/id.c
@@ -1,367 +0,0 @@
|
||||
// File generated by idgen.c
|
||||
#include "id.h"
|
||||
#include "identifier.h"
|
||||
#include "lexer.h"
|
||||
Identifier *Id::IUnknown;
|
||||
Identifier *Id::Object;
|
||||
Identifier *Id::object;
|
||||
Identifier *Id::max;
|
||||
Identifier *Id::min;
|
||||
Identifier *Id::This;
|
||||
Identifier *Id::ctor;
|
||||
Identifier *Id::dtor;
|
||||
Identifier *Id::classInvariant;
|
||||
Identifier *Id::unitTest;
|
||||
Identifier *Id::init;
|
||||
Identifier *Id::size;
|
||||
Identifier *Id::__sizeof;
|
||||
Identifier *Id::alignof;
|
||||
Identifier *Id::mangleof;
|
||||
Identifier *Id::stringof;
|
||||
Identifier *Id::tupleof;
|
||||
Identifier *Id::length;
|
||||
Identifier *Id::remove;
|
||||
Identifier *Id::ptr;
|
||||
Identifier *Id::funcptr;
|
||||
Identifier *Id::dollar;
|
||||
Identifier *Id::offset;
|
||||
Identifier *Id::offsetof;
|
||||
Identifier *Id::ModuleInfo;
|
||||
Identifier *Id::ClassInfo;
|
||||
Identifier *Id::classinfo;
|
||||
Identifier *Id::typeinfo;
|
||||
Identifier *Id::outer;
|
||||
Identifier *Id::Exception;
|
||||
Identifier *Id::withSym;
|
||||
Identifier *Id::result;
|
||||
Identifier *Id::returnLabel;
|
||||
Identifier *Id::delegate;
|
||||
Identifier *Id::line;
|
||||
Identifier *Id::empty;
|
||||
Identifier *Id::p;
|
||||
Identifier *Id::coverage;
|
||||
Identifier *Id::__vptr;
|
||||
Identifier *Id::__monitor;
|
||||
Identifier *Id::TypeInfo;
|
||||
Identifier *Id::TypeInfo_Class;
|
||||
Identifier *Id::TypeInfo_Interface;
|
||||
Identifier *Id::TypeInfo_Struct;
|
||||
Identifier *Id::TypeInfo_Enum;
|
||||
Identifier *Id::TypeInfo_Typedef;
|
||||
Identifier *Id::TypeInfo_Pointer;
|
||||
Identifier *Id::TypeInfo_Array;
|
||||
Identifier *Id::TypeInfo_StaticArray;
|
||||
Identifier *Id::TypeInfo_AssociativeArray;
|
||||
Identifier *Id::TypeInfo_Function;
|
||||
Identifier *Id::TypeInfo_Delegate;
|
||||
Identifier *Id::TypeInfo_Tuple;
|
||||
Identifier *Id::TypeInfo_Const;
|
||||
Identifier *Id::TypeInfo_Invariant;
|
||||
Identifier *Id::elements;
|
||||
Identifier *Id::_arguments_typeinfo;
|
||||
Identifier *Id::_arguments;
|
||||
Identifier *Id::_argptr;
|
||||
Identifier *Id::_match;
|
||||
Identifier *Id::LINE;
|
||||
Identifier *Id::FILE;
|
||||
Identifier *Id::DATE;
|
||||
Identifier *Id::TIME;
|
||||
Identifier *Id::TIMESTAMP;
|
||||
Identifier *Id::VENDOR;
|
||||
Identifier *Id::VERSIONX;
|
||||
Identifier *Id::nan;
|
||||
Identifier *Id::infinity;
|
||||
Identifier *Id::dig;
|
||||
Identifier *Id::epsilon;
|
||||
Identifier *Id::mant_dig;
|
||||
Identifier *Id::max_10_exp;
|
||||
Identifier *Id::max_exp;
|
||||
Identifier *Id::min_10_exp;
|
||||
Identifier *Id::min_exp;
|
||||
Identifier *Id::re;
|
||||
Identifier *Id::im;
|
||||
Identifier *Id::C;
|
||||
Identifier *Id::D;
|
||||
Identifier *Id::Windows;
|
||||
Identifier *Id::Pascal;
|
||||
Identifier *Id::System;
|
||||
Identifier *Id::exit;
|
||||
Identifier *Id::success;
|
||||
Identifier *Id::failure;
|
||||
Identifier *Id::keys;
|
||||
Identifier *Id::values;
|
||||
Identifier *Id::rehash;
|
||||
Identifier *Id::sort;
|
||||
Identifier *Id::reverse;
|
||||
Identifier *Id::dup;
|
||||
Identifier *Id::idup;
|
||||
Identifier *Id::___out;
|
||||
Identifier *Id::___in;
|
||||
Identifier *Id::__int;
|
||||
Identifier *Id::__dollar;
|
||||
Identifier *Id::__LOCAL_SIZE;
|
||||
Identifier *Id::uadd;
|
||||
Identifier *Id::neg;
|
||||
Identifier *Id::com;
|
||||
Identifier *Id::add;
|
||||
Identifier *Id::add_r;
|
||||
Identifier *Id::sub;
|
||||
Identifier *Id::sub_r;
|
||||
Identifier *Id::mul;
|
||||
Identifier *Id::mul_r;
|
||||
Identifier *Id::div;
|
||||
Identifier *Id::div_r;
|
||||
Identifier *Id::mod;
|
||||
Identifier *Id::mod_r;
|
||||
Identifier *Id::eq;
|
||||
Identifier *Id::cmp;
|
||||
Identifier *Id::iand;
|
||||
Identifier *Id::iand_r;
|
||||
Identifier *Id::ior;
|
||||
Identifier *Id::ior_r;
|
||||
Identifier *Id::ixor;
|
||||
Identifier *Id::ixor_r;
|
||||
Identifier *Id::shl;
|
||||
Identifier *Id::shl_r;
|
||||
Identifier *Id::shr;
|
||||
Identifier *Id::shr_r;
|
||||
Identifier *Id::ushr;
|
||||
Identifier *Id::ushr_r;
|
||||
Identifier *Id::cat;
|
||||
Identifier *Id::cat_r;
|
||||
Identifier *Id::assign;
|
||||
Identifier *Id::addass;
|
||||
Identifier *Id::subass;
|
||||
Identifier *Id::mulass;
|
||||
Identifier *Id::divass;
|
||||
Identifier *Id::modass;
|
||||
Identifier *Id::andass;
|
||||
Identifier *Id::orass;
|
||||
Identifier *Id::xorass;
|
||||
Identifier *Id::shlass;
|
||||
Identifier *Id::shrass;
|
||||
Identifier *Id::ushrass;
|
||||
Identifier *Id::catass;
|
||||
Identifier *Id::postinc;
|
||||
Identifier *Id::postdec;
|
||||
Identifier *Id::index;
|
||||
Identifier *Id::indexass;
|
||||
Identifier *Id::slice;
|
||||
Identifier *Id::sliceass;
|
||||
Identifier *Id::call;
|
||||
Identifier *Id::cast;
|
||||
Identifier *Id::match;
|
||||
Identifier *Id::next;
|
||||
Identifier *Id::opIn;
|
||||
Identifier *Id::opIn_r;
|
||||
Identifier *Id::classNew;
|
||||
Identifier *Id::classDelete;
|
||||
Identifier *Id::apply;
|
||||
Identifier *Id::applyReverse;
|
||||
Identifier *Id::adDup;
|
||||
Identifier *Id::adReverse;
|
||||
Identifier *Id::aaLen;
|
||||
Identifier *Id::aaKeys;
|
||||
Identifier *Id::aaValues;
|
||||
Identifier *Id::aaRehash;
|
||||
Identifier *Id::GNU_asm;
|
||||
Identifier *Id::lib;
|
||||
Identifier *Id::msg;
|
||||
Identifier *Id::intrinsic;
|
||||
Identifier *Id::va_intrinsic;
|
||||
Identifier *Id::no_typeinfo;
|
||||
Identifier *Id::no_moduleinfo;
|
||||
Identifier *Id::Alloca;
|
||||
Identifier *Id::vastart;
|
||||
Identifier *Id::vacopy;
|
||||
Identifier *Id::vaend;
|
||||
Identifier *Id::vaarg;
|
||||
Identifier *Id::ldc;
|
||||
Identifier *Id::tohash;
|
||||
Identifier *Id::tostring;
|
||||
Identifier *Id::main;
|
||||
Identifier *Id::WinMain;
|
||||
Identifier *Id::DllMain;
|
||||
void Id::initialize()
|
||||
{
|
||||
IUnknown = Lexer::idPool("IUnknown");
|
||||
Object = Lexer::idPool("Object");
|
||||
object = Lexer::idPool("object");
|
||||
max = Lexer::idPool("max");
|
||||
min = Lexer::idPool("min");
|
||||
This = Lexer::idPool("this");
|
||||
ctor = Lexer::idPool("_ctor");
|
||||
dtor = Lexer::idPool("_dtor");
|
||||
classInvariant = Lexer::idPool("__invariant");
|
||||
unitTest = Lexer::idPool("_unitTest");
|
||||
init = Lexer::idPool("init");
|
||||
size = Lexer::idPool("size");
|
||||
__sizeof = Lexer::idPool("sizeof");
|
||||
alignof = Lexer::idPool("alignof");
|
||||
mangleof = Lexer::idPool("mangleof");
|
||||
stringof = Lexer::idPool("stringof");
|
||||
tupleof = Lexer::idPool("tupleof");
|
||||
length = Lexer::idPool("length");
|
||||
remove = Lexer::idPool("remove");
|
||||
ptr = Lexer::idPool("ptr");
|
||||
funcptr = Lexer::idPool("funcptr");
|
||||
dollar = Lexer::idPool("__dollar");
|
||||
offset = Lexer::idPool("offset");
|
||||
offsetof = Lexer::idPool("offsetof");
|
||||
ModuleInfo = Lexer::idPool("ModuleInfo");
|
||||
ClassInfo = Lexer::idPool("ClassInfo");
|
||||
classinfo = Lexer::idPool("classinfo");
|
||||
typeinfo = Lexer::idPool("typeinfo");
|
||||
outer = Lexer::idPool("outer");
|
||||
Exception = Lexer::idPool("Exception");
|
||||
withSym = Lexer::idPool("__withSym");
|
||||
result = Lexer::idPool("__result");
|
||||
returnLabel = Lexer::idPool("__returnLabel");
|
||||
delegate = Lexer::idPool("delegate");
|
||||
line = Lexer::idPool("line");
|
||||
empty = Lexer::idPool("");
|
||||
p = Lexer::idPool("p");
|
||||
coverage = Lexer::idPool("__coverage");
|
||||
__vptr = Lexer::idPool("__vptr");
|
||||
__monitor = Lexer::idPool("__monitor");
|
||||
TypeInfo = Lexer::idPool("TypeInfo");
|
||||
TypeInfo_Class = Lexer::idPool("TypeInfo_Class");
|
||||
TypeInfo_Interface = Lexer::idPool("TypeInfo_Interface");
|
||||
TypeInfo_Struct = Lexer::idPool("TypeInfo_Struct");
|
||||
TypeInfo_Enum = Lexer::idPool("TypeInfo_Enum");
|
||||
TypeInfo_Typedef = Lexer::idPool("TypeInfo_Typedef");
|
||||
TypeInfo_Pointer = Lexer::idPool("TypeInfo_Pointer");
|
||||
TypeInfo_Array = Lexer::idPool("TypeInfo_Array");
|
||||
TypeInfo_StaticArray = Lexer::idPool("TypeInfo_StaticArray");
|
||||
TypeInfo_AssociativeArray = Lexer::idPool("TypeInfo_AssociativeArray");
|
||||
TypeInfo_Function = Lexer::idPool("TypeInfo_Function");
|
||||
TypeInfo_Delegate = Lexer::idPool("TypeInfo_Delegate");
|
||||
TypeInfo_Tuple = Lexer::idPool("TypeInfo_Tuple");
|
||||
TypeInfo_Const = Lexer::idPool("TypeInfo_Const");
|
||||
TypeInfo_Invariant = Lexer::idPool("TypeInfo_Invariant");
|
||||
elements = Lexer::idPool("elements");
|
||||
_arguments_typeinfo = Lexer::idPool("_arguments_typeinfo");
|
||||
_arguments = Lexer::idPool("_arguments");
|
||||
_argptr = Lexer::idPool("_argptr");
|
||||
_match = Lexer::idPool("_match");
|
||||
LINE = Lexer::idPool("__LINE__");
|
||||
FILE = Lexer::idPool("__FILE__");
|
||||
DATE = Lexer::idPool("__DATE__");
|
||||
TIME = Lexer::idPool("__TIME__");
|
||||
TIMESTAMP = Lexer::idPool("__TIMESTAMP__");
|
||||
VENDOR = Lexer::idPool("__VENDOR__");
|
||||
VERSIONX = Lexer::idPool("__VERSION__");
|
||||
nan = Lexer::idPool("nan");
|
||||
infinity = Lexer::idPool("infinity");
|
||||
dig = Lexer::idPool("dig");
|
||||
epsilon = Lexer::idPool("epsilon");
|
||||
mant_dig = Lexer::idPool("mant_dig");
|
||||
max_10_exp = Lexer::idPool("max_10_exp");
|
||||
max_exp = Lexer::idPool("max_exp");
|
||||
min_10_exp = Lexer::idPool("min_10_exp");
|
||||
min_exp = Lexer::idPool("min_exp");
|
||||
re = Lexer::idPool("re");
|
||||
im = Lexer::idPool("im");
|
||||
C = Lexer::idPool("C");
|
||||
D = Lexer::idPool("D");
|
||||
Windows = Lexer::idPool("Windows");
|
||||
Pascal = Lexer::idPool("Pascal");
|
||||
System = Lexer::idPool("System");
|
||||
exit = Lexer::idPool("exit");
|
||||
success = Lexer::idPool("success");
|
||||
failure = Lexer::idPool("failure");
|
||||
keys = Lexer::idPool("keys");
|
||||
values = Lexer::idPool("values");
|
||||
rehash = Lexer::idPool("rehash");
|
||||
sort = Lexer::idPool("sort");
|
||||
reverse = Lexer::idPool("reverse");
|
||||
dup = Lexer::idPool("dup");
|
||||
idup = Lexer::idPool("idup");
|
||||
___out = Lexer::idPool("out");
|
||||
___in = Lexer::idPool("in");
|
||||
__int = Lexer::idPool("int");
|
||||
__dollar = Lexer::idPool("$");
|
||||
__LOCAL_SIZE = Lexer::idPool("__LOCAL_SIZE");
|
||||
uadd = Lexer::idPool("opPos");
|
||||
neg = Lexer::idPool("opNeg");
|
||||
com = Lexer::idPool("opCom");
|
||||
add = Lexer::idPool("opAdd");
|
||||
add_r = Lexer::idPool("opAdd_r");
|
||||
sub = Lexer::idPool("opSub");
|
||||
sub_r = Lexer::idPool("opSub_r");
|
||||
mul = Lexer::idPool("opMul");
|
||||
mul_r = Lexer::idPool("opMul_r");
|
||||
div = Lexer::idPool("opDiv");
|
||||
div_r = Lexer::idPool("opDiv_r");
|
||||
mod = Lexer::idPool("opMod");
|
||||
mod_r = Lexer::idPool("opMod_r");
|
||||
eq = Lexer::idPool("opEquals");
|
||||
cmp = Lexer::idPool("opCmp");
|
||||
iand = Lexer::idPool("opAnd");
|
||||
iand_r = Lexer::idPool("opAnd_r");
|
||||
ior = Lexer::idPool("opOr");
|
||||
ior_r = Lexer::idPool("opOr_r");
|
||||
ixor = Lexer::idPool("opXor");
|
||||
ixor_r = Lexer::idPool("opXor_r");
|
||||
shl = Lexer::idPool("opShl");
|
||||
shl_r = Lexer::idPool("opShl_r");
|
||||
shr = Lexer::idPool("opShr");
|
||||
shr_r = Lexer::idPool("opShr_r");
|
||||
ushr = Lexer::idPool("opUShr");
|
||||
ushr_r = Lexer::idPool("opUShr_r");
|
||||
cat = Lexer::idPool("opCat");
|
||||
cat_r = Lexer::idPool("opCat_r");
|
||||
assign = Lexer::idPool("opAssign");
|
||||
addass = Lexer::idPool("opAddAssign");
|
||||
subass = Lexer::idPool("opSubAssign");
|
||||
mulass = Lexer::idPool("opMulAssign");
|
||||
divass = Lexer::idPool("opDivAssign");
|
||||
modass = Lexer::idPool("opModAssign");
|
||||
andass = Lexer::idPool("opAndAssign");
|
||||
orass = Lexer::idPool("opOrAssign");
|
||||
xorass = Lexer::idPool("opXorAssign");
|
||||
shlass = Lexer::idPool("opShlAssign");
|
||||
shrass = Lexer::idPool("opShrAssign");
|
||||
ushrass = Lexer::idPool("opUShrAssign");
|
||||
catass = Lexer::idPool("opCatAssign");
|
||||
postinc = Lexer::idPool("opPostInc");
|
||||
postdec = Lexer::idPool("opPostDec");
|
||||
index = Lexer::idPool("opIndex");
|
||||
indexass = Lexer::idPool("opIndexAssign");
|
||||
slice = Lexer::idPool("opSlice");
|
||||
sliceass = Lexer::idPool("opSliceAssign");
|
||||
call = Lexer::idPool("opCall");
|
||||
cast = Lexer::idPool("opCast");
|
||||
match = Lexer::idPool("opMatch");
|
||||
next = Lexer::idPool("opNext");
|
||||
opIn = Lexer::idPool("opIn");
|
||||
opIn_r = Lexer::idPool("opIn_r");
|
||||
classNew = Lexer::idPool("new");
|
||||
classDelete = Lexer::idPool("delete");
|
||||
apply = Lexer::idPool("opApply");
|
||||
applyReverse = Lexer::idPool("opApplyReverse");
|
||||
adDup = Lexer::idPool("_adDupT");
|
||||
adReverse = Lexer::idPool("_adReverse");
|
||||
aaLen = Lexer::idPool("_aaLen");
|
||||
aaKeys = Lexer::idPool("_aaKeys");
|
||||
aaValues = Lexer::idPool("_aaValues");
|
||||
aaRehash = Lexer::idPool("_aaRehash");
|
||||
GNU_asm = Lexer::idPool("GNU_asm");
|
||||
lib = Lexer::idPool("lib");
|
||||
msg = Lexer::idPool("msg");
|
||||
intrinsic = Lexer::idPool("intrinsic");
|
||||
va_intrinsic = Lexer::idPool("va_intrinsic");
|
||||
no_typeinfo = Lexer::idPool("no_typeinfo");
|
||||
no_moduleinfo = Lexer::idPool("no_moduleinfo");
|
||||
Alloca = Lexer::idPool("alloca");
|
||||
vastart = Lexer::idPool("va_start");
|
||||
vacopy = Lexer::idPool("va_copy");
|
||||
vaend = Lexer::idPool("va_end");
|
||||
vaarg = Lexer::idPool("va_arg");
|
||||
ldc = Lexer::idPool("ldc");
|
||||
tohash = Lexer::idPool("toHash");
|
||||
tostring = Lexer::idPool("toString");
|
||||
main = Lexer::idPool("main");
|
||||
WinMain = Lexer::idPool("WinMain");
|
||||
DllMain = Lexer::idPool("DllMain");
|
||||
}
|
||||
189
dmd/id.h
189
dmd/id.h
@@ -1,189 +0,0 @@
|
||||
// File generated by idgen.c
|
||||
#ifndef DMD_ID_H
|
||||
#define DMD_ID_H 1
|
||||
struct Identifier;
|
||||
struct Id
|
||||
{
|
||||
static Identifier *IUnknown;
|
||||
static Identifier *Object;
|
||||
static Identifier *object;
|
||||
static Identifier *max;
|
||||
static Identifier *min;
|
||||
static Identifier *This;
|
||||
static Identifier *ctor;
|
||||
static Identifier *dtor;
|
||||
static Identifier *classInvariant;
|
||||
static Identifier *unitTest;
|
||||
static Identifier *init;
|
||||
static Identifier *size;
|
||||
static Identifier *__sizeof;
|
||||
static Identifier *alignof;
|
||||
static Identifier *mangleof;
|
||||
static Identifier *stringof;
|
||||
static Identifier *tupleof;
|
||||
static Identifier *length;
|
||||
static Identifier *remove;
|
||||
static Identifier *ptr;
|
||||
static Identifier *funcptr;
|
||||
static Identifier *dollar;
|
||||
static Identifier *offset;
|
||||
static Identifier *offsetof;
|
||||
static Identifier *ModuleInfo;
|
||||
static Identifier *ClassInfo;
|
||||
static Identifier *classinfo;
|
||||
static Identifier *typeinfo;
|
||||
static Identifier *outer;
|
||||
static Identifier *Exception;
|
||||
static Identifier *withSym;
|
||||
static Identifier *result;
|
||||
static Identifier *returnLabel;
|
||||
static Identifier *delegate;
|
||||
static Identifier *line;
|
||||
static Identifier *empty;
|
||||
static Identifier *p;
|
||||
static Identifier *coverage;
|
||||
static Identifier *__vptr;
|
||||
static Identifier *__monitor;
|
||||
static Identifier *TypeInfo;
|
||||
static Identifier *TypeInfo_Class;
|
||||
static Identifier *TypeInfo_Interface;
|
||||
static Identifier *TypeInfo_Struct;
|
||||
static Identifier *TypeInfo_Enum;
|
||||
static Identifier *TypeInfo_Typedef;
|
||||
static Identifier *TypeInfo_Pointer;
|
||||
static Identifier *TypeInfo_Array;
|
||||
static Identifier *TypeInfo_StaticArray;
|
||||
static Identifier *TypeInfo_AssociativeArray;
|
||||
static Identifier *TypeInfo_Function;
|
||||
static Identifier *TypeInfo_Delegate;
|
||||
static Identifier *TypeInfo_Tuple;
|
||||
static Identifier *TypeInfo_Const;
|
||||
static Identifier *TypeInfo_Invariant;
|
||||
static Identifier *elements;
|
||||
static Identifier *_arguments_typeinfo;
|
||||
static Identifier *_arguments;
|
||||
static Identifier *_argptr;
|
||||
static Identifier *_match;
|
||||
static Identifier *LINE;
|
||||
static Identifier *FILE;
|
||||
static Identifier *DATE;
|
||||
static Identifier *TIME;
|
||||
static Identifier *TIMESTAMP;
|
||||
static Identifier *VENDOR;
|
||||
static Identifier *VERSIONX;
|
||||
static Identifier *nan;
|
||||
static Identifier *infinity;
|
||||
static Identifier *dig;
|
||||
static Identifier *epsilon;
|
||||
static Identifier *mant_dig;
|
||||
static Identifier *max_10_exp;
|
||||
static Identifier *max_exp;
|
||||
static Identifier *min_10_exp;
|
||||
static Identifier *min_exp;
|
||||
static Identifier *re;
|
||||
static Identifier *im;
|
||||
static Identifier *C;
|
||||
static Identifier *D;
|
||||
static Identifier *Windows;
|
||||
static Identifier *Pascal;
|
||||
static Identifier *System;
|
||||
static Identifier *exit;
|
||||
static Identifier *success;
|
||||
static Identifier *failure;
|
||||
static Identifier *keys;
|
||||
static Identifier *values;
|
||||
static Identifier *rehash;
|
||||
static Identifier *sort;
|
||||
static Identifier *reverse;
|
||||
static Identifier *dup;
|
||||
static Identifier *idup;
|
||||
static Identifier *___out;
|
||||
static Identifier *___in;
|
||||
static Identifier *__int;
|
||||
static Identifier *__dollar;
|
||||
static Identifier *__LOCAL_SIZE;
|
||||
static Identifier *uadd;
|
||||
static Identifier *neg;
|
||||
static Identifier *com;
|
||||
static Identifier *add;
|
||||
static Identifier *add_r;
|
||||
static Identifier *sub;
|
||||
static Identifier *sub_r;
|
||||
static Identifier *mul;
|
||||
static Identifier *mul_r;
|
||||
static Identifier *div;
|
||||
static Identifier *div_r;
|
||||
static Identifier *mod;
|
||||
static Identifier *mod_r;
|
||||
static Identifier *eq;
|
||||
static Identifier *cmp;
|
||||
static Identifier *iand;
|
||||
static Identifier *iand_r;
|
||||
static Identifier *ior;
|
||||
static Identifier *ior_r;
|
||||
static Identifier *ixor;
|
||||
static Identifier *ixor_r;
|
||||
static Identifier *shl;
|
||||
static Identifier *shl_r;
|
||||
static Identifier *shr;
|
||||
static Identifier *shr_r;
|
||||
static Identifier *ushr;
|
||||
static Identifier *ushr_r;
|
||||
static Identifier *cat;
|
||||
static Identifier *cat_r;
|
||||
static Identifier *assign;
|
||||
static Identifier *addass;
|
||||
static Identifier *subass;
|
||||
static Identifier *mulass;
|
||||
static Identifier *divass;
|
||||
static Identifier *modass;
|
||||
static Identifier *andass;
|
||||
static Identifier *orass;
|
||||
static Identifier *xorass;
|
||||
static Identifier *shlass;
|
||||
static Identifier *shrass;
|
||||
static Identifier *ushrass;
|
||||
static Identifier *catass;
|
||||
static Identifier *postinc;
|
||||
static Identifier *postdec;
|
||||
static Identifier *index;
|
||||
static Identifier *indexass;
|
||||
static Identifier *slice;
|
||||
static Identifier *sliceass;
|
||||
static Identifier *call;
|
||||
static Identifier *cast;
|
||||
static Identifier *match;
|
||||
static Identifier *next;
|
||||
static Identifier *opIn;
|
||||
static Identifier *opIn_r;
|
||||
static Identifier *classNew;
|
||||
static Identifier *classDelete;
|
||||
static Identifier *apply;
|
||||
static Identifier *applyReverse;
|
||||
static Identifier *adDup;
|
||||
static Identifier *adReverse;
|
||||
static Identifier *aaLen;
|
||||
static Identifier *aaKeys;
|
||||
static Identifier *aaValues;
|
||||
static Identifier *aaRehash;
|
||||
static Identifier *GNU_asm;
|
||||
static Identifier *lib;
|
||||
static Identifier *msg;
|
||||
static Identifier *intrinsic;
|
||||
static Identifier *va_intrinsic;
|
||||
static Identifier *no_typeinfo;
|
||||
static Identifier *no_moduleinfo;
|
||||
static Identifier *Alloca;
|
||||
static Identifier *vastart;
|
||||
static Identifier *vacopy;
|
||||
static Identifier *vaend;
|
||||
static Identifier *vaarg;
|
||||
static Identifier *ldc;
|
||||
static Identifier *tohash;
|
||||
static Identifier *tostring;
|
||||
static Identifier *main;
|
||||
static Identifier *WinMain;
|
||||
static Identifier *DllMain;
|
||||
static void initialize();
|
||||
};
|
||||
#endif
|
||||
178
dmd/impcnvtab.c
178
dmd/impcnvtab.c
@@ -1,178 +0,0 @@
|
||||
// This file is generated by impcnvgen.c
|
||||
#include "mtype.h"
|
||||
unsigned char Type::impcnvResult[TMAX][TMAX] =
|
||||
{
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,19,19,19,19,19,19,20,21,22,23,24,22,23,24,28,29,30,19,19,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,20,20,20,20,20,20,20,21,22,23,24,22,23,24,28,29,30,20,20,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,21,21,21,21,21,21,21,21,22,23,24,22,23,24,28,29,30,21,21,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,22,23,24,28,29,30,22,22,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,23,23,24,29,29,30,23,23,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,24,24,24,30,30,30,24,24,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,22,22,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,23,23,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,24,24,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,28,28,28,28,28,28,28,28,28,29,30,28,29,30,28,29,30,28,28,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,29,29,29,29,29,29,29,29,29,29,30,29,29,30,29,29,30,29,29,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,36,32,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
};
|
||||
unsigned char Type::impcnvType1[TMAX][TMAX] =
|
||||
{
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,19,19,19,19,19,19,20,21,22,23,24,22,23,24,22,23,24,19,19,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,20,20,20,20,20,20,20,21,22,23,24,22,23,24,22,23,24,20,20,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,21,21,21,21,21,21,21,21,22,23,24,22,23,24,22,23,24,21,21,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,22,23,24,22,23,24,22,22,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,23,23,24,23,23,24,23,23,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,25,25,25,25,25,25,25,25,25,26,27,25,26,27,25,26,27,25,25,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,26,26,26,26,26,26,26,26,26,26,27,26,26,27,26,26,27,26,26,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,28,28,28,28,28,28,28,28,28,29,30,28,29,30,28,29,30,28,28,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,29,29,29,29,29,29,29,29,29,29,30,29,29,30,29,29,30,29,29,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,36,32,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
};
|
||||
unsigned char Type::impcnvType2[TMAX][TMAX] =
|
||||
{
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,18,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,19,19,19,19,19,19,20,21,22,23,24,25,26,27,28,29,30,19,19,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,20,20,20,20,20,20,20,21,22,23,24,25,26,27,28,29,30,20,20,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,21,21,21,21,21,21,21,21,22,23,24,25,26,27,28,29,30,21,21,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,22,22,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,23,23,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,24,24,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,22,22,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,23,23,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,24,24,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,22,22,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,23,23,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,24,24,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,36,32,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
};
|
||||
unsigned char Type::impcnvWarn[TMAX][TMAX] =
|
||||
{
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
};
|
||||
33
dmd2/cast.c
33
dmd2/cast.c
@@ -35,9 +35,10 @@ Expression *Expression::implicitCastTo(Scope *sc, Type *t)
|
||||
|
||||
MATCH match = implicitConvTo(t);
|
||||
if (match)
|
||||
{
|
||||
{ TY tyfrom = type->toBasetype()->ty;
|
||||
TY tyto = t->toBasetype()->ty;
|
||||
if (global.params.warnings &&
|
||||
Type::impcnvWarn[type->toBasetype()->ty][t->toBasetype()->ty] &&
|
||||
Type::impcnvWarn[tyfrom][tyto] &&
|
||||
op != TOKint64)
|
||||
{
|
||||
Expression *e = optimize(WANTflags | WANTvalue);
|
||||
@@ -45,8 +46,24 @@ Expression *Expression::implicitCastTo(Scope *sc, Type *t)
|
||||
if (e->op == TOKint64)
|
||||
return e->implicitCastTo(sc, t);
|
||||
|
||||
warning("%s: implicit conversion of expression (%s) of type %s to %s can cause loss of data",
|
||||
loc.toChars(), toChars(), type->toChars(), t->toChars());
|
||||
if (tyfrom == Tint32 &&
|
||||
(op == TOKadd || op == TOKmin ||
|
||||
op == TOKand || op == TOKor || op == TOKxor)
|
||||
)
|
||||
{
|
||||
/* This is really only a semi-kludge fix,
|
||||
* we really should look at the operands of op
|
||||
* and see if they are narrower types.
|
||||
* For example, b=b|b and b=b|7 and s=b+b should be allowed,
|
||||
* but b=b|i should be an error.
|
||||
*/
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
warning("%s: implicit conversion of expression (%s) of type %s to %s can cause loss of data",
|
||||
loc.toChars(), toChars(), type->toChars(), t->toChars());
|
||||
}
|
||||
}
|
||||
#if DMDV2
|
||||
if (match == MATCHconst && t == type->constOf())
|
||||
@@ -1042,7 +1059,7 @@ Expression *AddrExp::castTo(Scope *sc, Type *t)
|
||||
}
|
||||
}
|
||||
if (f)
|
||||
{ f->tookAddressOf = 1;
|
||||
{ f->tookAddressOf++;
|
||||
SymOffExp *se = new SymOffExp(loc, f, 0, 0);
|
||||
se->semantic(sc);
|
||||
// Let SymOffExp::castTo() do the heavy lifting
|
||||
@@ -1205,7 +1222,7 @@ Expression *SymOffExp::castTo(Scope *sc, Type *t)
|
||||
e = new SymOffExp(loc, f, 0);
|
||||
e->type = t;
|
||||
}
|
||||
f->tookAddressOf = 1;
|
||||
f->tookAddressOf++;
|
||||
return e;
|
||||
}
|
||||
}
|
||||
@@ -1246,7 +1263,7 @@ Expression *DelegateExp::castTo(Scope *sc, Type *t)
|
||||
{ int offset;
|
||||
if (f->tintro && f->tintro->nextOf()->isBaseOf(f->type->nextOf(), &offset) && offset)
|
||||
error("%s", msg);
|
||||
f->tookAddressOf = 1;
|
||||
f->tookAddressOf++;
|
||||
e = new DelegateExp(loc, e1, f);
|
||||
e->type = t;
|
||||
return e;
|
||||
@@ -1260,7 +1277,7 @@ Expression *DelegateExp::castTo(Scope *sc, Type *t)
|
||||
else
|
||||
{ int offset;
|
||||
|
||||
func->tookAddressOf = 1;
|
||||
func->tookAddressOf++;
|
||||
if (func->tintro && func->tintro->nextOf()->isBaseOf(func->type->nextOf(), &offset) && offset)
|
||||
error("%s", msg);
|
||||
e = copy();
|
||||
|
||||
16
dmd2/clone.c
16
dmd2/clone.c
@@ -87,6 +87,9 @@ FuncDeclaration *StructDeclaration::buildOpAssign(Scope *sc)
|
||||
Arguments *fparams = new Arguments;
|
||||
fparams->push(param);
|
||||
Type *ftype = new TypeFunction(fparams, handle, FALSE, LINKd);
|
||||
#if STRUCTTHISREF
|
||||
((TypeFunction *)ftype)->isref = 1;
|
||||
#endif
|
||||
|
||||
fop = new FuncDeclaration(0, 0, Id::assign, STCundefined, ftype);
|
||||
|
||||
@@ -106,12 +109,21 @@ FuncDeclaration *StructDeclaration::buildOpAssign(Scope *sc)
|
||||
e = new DeclarationExp(0, tmp);
|
||||
ec = new AssignExp(0,
|
||||
new VarExp(0, tmp),
|
||||
new PtrExp(0, new ThisExp(0)));
|
||||
#if STRUCTTHISREF
|
||||
new ThisExp(0)
|
||||
#else
|
||||
new PtrExp(0, new ThisExp(0))
|
||||
#endif
|
||||
);
|
||||
ec->op = TOKblit;
|
||||
e = Expression::combine(e, ec);
|
||||
}
|
||||
ec = new AssignExp(0,
|
||||
#if STRUCTTHISREF
|
||||
new ThisExp(0),
|
||||
#else
|
||||
new PtrExp(0, new ThisExp(0)),
|
||||
#endif
|
||||
new IdentifierExp(0, Id::p));
|
||||
ec->op = TOKblit;
|
||||
e = Expression::combine(e, ec);
|
||||
@@ -205,7 +217,9 @@ FuncDeclaration *StructDeclaration::buildCpCtor(Scope *sc)
|
||||
|
||||
// Build *this = p;
|
||||
Expression *e = new ThisExp(0);
|
||||
#if !STRUCTTHISREF
|
||||
e = new PtrExp(0, e);
|
||||
#endif
|
||||
AssignExp *ea = new AssignExp(0, e, new IdentifierExp(0, Id::p));
|
||||
ea->op = TOKblit;
|
||||
Statement *s = new ExpStatement(0, ea);
|
||||
|
||||
@@ -666,6 +666,7 @@ Dsymbol *ScopeDsymbol::syntaxCopy(Dsymbol *s)
|
||||
Dsymbol *ScopeDsymbol::search(Loc loc, Identifier *ident, int flags)
|
||||
{
|
||||
//printf("%s->ScopeDsymbol::search(ident='%s', flags=x%x)\n", toChars(), ident->toChars(), flags);
|
||||
//if (strcmp(ident->toChars(),"c") == 0) *(char*)0=0;
|
||||
|
||||
// Look in symbols declared in this module
|
||||
Dsymbol *s = symtab ? symtab->lookup(ident) : NULL;
|
||||
@@ -789,7 +790,7 @@ void ScopeDsymbol::importScope(ScopeDsymbol *s, enum PROT protection)
|
||||
{ ScopeDsymbol *ss;
|
||||
|
||||
ss = (ScopeDsymbol *) imports->data[i];
|
||||
if (ss == s)
|
||||
if (ss == s) // if already imported
|
||||
{
|
||||
if (protection > prots[i])
|
||||
prots[i] = protection; // upgrade access
|
||||
|
||||
@@ -239,7 +239,7 @@ struct ScopeDsymbol : Dsymbol
|
||||
DsymbolTable *symtab; // members[] sorted into table
|
||||
|
||||
Array *imports; // imported ScopeDsymbol's
|
||||
unsigned char *prots; // PROT for each import
|
||||
unsigned char *prots; // array of PROT, one for each import
|
||||
|
||||
ScopeDsymbol();
|
||||
ScopeDsymbol(Identifier *id);
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#if _MSC_VER
|
||||
#include <complex>
|
||||
#else
|
||||
#endif
|
||||
#include <math.h>
|
||||
|
||||
#if _WIN32 && __DMC__
|
||||
@@ -715,6 +718,36 @@ void functionArguments(Loc loc, Scope *sc, TypeFunction *tf, Expressions *argume
|
||||
{
|
||||
arg = arg->toDelegate(sc, p->type);
|
||||
}
|
||||
|
||||
/* Look for arguments that cannot 'escape' from the called
|
||||
* function.
|
||||
*/
|
||||
if (!tf->parameterEscapes(p))
|
||||
{
|
||||
/* Function literals can only appear once, so if this
|
||||
* appearance was scoped, there cannot be any others.
|
||||
*/
|
||||
if (arg->op == TOKfunction)
|
||||
{ FuncExp *fe = (FuncExp *)arg;
|
||||
fe->fd->tookAddressOf = 0;
|
||||
}
|
||||
|
||||
/* For passing a delegate to a scoped parameter,
|
||||
* this doesn't count as taking the address of it.
|
||||
* We only worry about 'escaping' references to the function.
|
||||
*/
|
||||
else if (arg->op == TOKdelegate)
|
||||
{ DelegateExp *de = (DelegateExp *)arg;
|
||||
if (de->e1->op == TOKvar)
|
||||
{ VarExp *ve = (VarExp *)de->e1;
|
||||
FuncDeclaration *f = ve->var->isFuncDeclaration();
|
||||
if (f)
|
||||
{ f->tookAddressOf--;
|
||||
//printf("tookAddressOf = %d\n", f->tookAddressOf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2184,7 +2217,11 @@ Expression *ThisExp::semantic(Scope *sc)
|
||||
sd = s->isStructDeclaration();
|
||||
if (sd)
|
||||
{
|
||||
#if STRUCTTHISREF
|
||||
type = sd->type;
|
||||
#else
|
||||
type = sd->type->pointerTo();
|
||||
#endif
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -5176,10 +5213,14 @@ Expression *DotIdExp::semantic(Scope *sc)
|
||||
|
||||
if (eright->op == TOKimport) // also used for template alias's
|
||||
{
|
||||
Dsymbol *s;
|
||||
ScopeExp *ie = (ScopeExp *)eright;
|
||||
|
||||
s = ie->sds->search(loc, ident, 0);
|
||||
/* Disable access to another module's private imports.
|
||||
* The check for 'is sds our current module' is because
|
||||
* the current module should have access to its own imports.
|
||||
*/
|
||||
Dsymbol *s = ie->sds->search(loc, ident,
|
||||
(ie->sds->isModule() && ie->sds != sc->module) ? 1 : 0);
|
||||
if (s)
|
||||
{
|
||||
s = s->toAlias();
|
||||
@@ -6019,7 +6060,11 @@ Lagain:
|
||||
|
||||
Expression *e = new DotVarExp(loc, av, ad->ctor, 1);
|
||||
e = new CallExp(loc, e, arguments);
|
||||
#if !STRUCTTHISREF
|
||||
/* Constructors return a pointer to the instance
|
||||
*/
|
||||
e = new PtrExp(loc, e);
|
||||
#endif
|
||||
e = e->semantic(sc);
|
||||
return e;
|
||||
}
|
||||
@@ -6460,7 +6505,7 @@ Expression *AddrExp::semantic(Scope *sc)
|
||||
if (f)
|
||||
{
|
||||
if (!dve->hasOverloads)
|
||||
f->tookAddressOf = 1;
|
||||
f->tookAddressOf++;
|
||||
Expression *e = new DelegateExp(loc, dve->e1, f, dve->hasOverloads);
|
||||
e = e->semantic(sc);
|
||||
return e;
|
||||
@@ -6478,8 +6523,13 @@ Expression *AddrExp::semantic(Scope *sc)
|
||||
|
||||
if (f)
|
||||
{
|
||||
if (!ve->hasOverloads)
|
||||
f->tookAddressOf = 1;
|
||||
if (!ve->hasOverloads ||
|
||||
/* Because nested functions cannot be overloaded,
|
||||
* mark here that we took its address because castTo()
|
||||
* may not be called with an exact match.
|
||||
*/
|
||||
f->toParent2()->isFuncDeclaration())
|
||||
f->tookAddressOf++;
|
||||
|
||||
// LDC
|
||||
if (f && f->isIntrinsic())
|
||||
|
||||
40
dmd2/func.c
40
dmd2/func.c
@@ -685,24 +685,36 @@ void FuncDeclaration::semantic3(Scope *sc)
|
||||
Type *thandle = ad->handle;
|
||||
if (storage_class & STCconst || type->isConst())
|
||||
{
|
||||
#if STRUCTTHISREF
|
||||
thandle = thandle->constOf();
|
||||
#else
|
||||
if (thandle->ty == Tclass)
|
||||
thandle = thandle->constOf();
|
||||
else
|
||||
{ assert(thandle->ty == Tpointer);
|
||||
thandle = thandle->nextOf()->constOf()->pointerTo();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (storage_class & STCinvariant || type->isInvariant())
|
||||
{
|
||||
#if STRUCTTHISREF
|
||||
thandle = thandle->invariantOf();
|
||||
#else
|
||||
if (thandle->ty == Tclass)
|
||||
thandle = thandle->invariantOf();
|
||||
else
|
||||
{ assert(thandle->ty == Tpointer);
|
||||
thandle = thandle->nextOf()->invariantOf()->pointerTo();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
v = new ThisDeclaration(thandle);
|
||||
v->storage_class |= STCparameter;
|
||||
#if STRUCTTHISREF
|
||||
if (thandle->ty == Tstruct)
|
||||
v->storage_class |= STCref;
|
||||
#endif
|
||||
v->semantic(sc2);
|
||||
if (!sc2->insert(v))
|
||||
assert(0);
|
||||
@@ -950,8 +962,12 @@ void FuncDeclaration::semantic3(Scope *sc)
|
||||
}
|
||||
else
|
||||
{ // Call invariant virtually
|
||||
ThisExp *v = new ThisExp(0);
|
||||
Expression *v = new ThisExp(0);
|
||||
v->type = vthis->type;
|
||||
#if STRUCTTHISREF
|
||||
if (ad->isStructDeclaration())
|
||||
v = v->addressOf(sc);
|
||||
#endif
|
||||
e = new AssertExp(0, v);
|
||||
}
|
||||
if (e)
|
||||
@@ -1214,8 +1230,12 @@ void FuncDeclaration::semantic3(Scope *sc)
|
||||
}
|
||||
else
|
||||
{ // Call invariant virtually
|
||||
ThisExp *v = new ThisExp(0);
|
||||
Expression *v = new ThisExp(0);
|
||||
v->type = vthis->type;
|
||||
#if STRUCTTHISREF
|
||||
if (ad->isStructDeclaration())
|
||||
v = v->addressOf(sc);
|
||||
#endif
|
||||
Expression *se = new StringExp(0, (char *)"null this");
|
||||
se = se->semantic(sc);
|
||||
se->type = Type::tchar->arrayOf();
|
||||
@@ -2017,15 +2037,16 @@ int FuncDeclaration::isVirtual()
|
||||
|
||||
int FuncDeclaration::isFinal()
|
||||
{
|
||||
ClassDeclaration *cd;
|
||||
#if 0
|
||||
printf("FuncDeclaration::isFinal(%s)\n", toChars());
|
||||
printf("%p %d %d %d %d\n", isMember(), isStatic(), protection == PROTprivate, isCtorDeclaration(), linkage != LINKd);
|
||||
printf("result is %d\n",
|
||||
isMember() &&
|
||||
!(isStatic() || protection == PROTprivate || protection == PROTpackage) &&
|
||||
toParent()->isClassDeclaration());
|
||||
(cd = toParent()->isClassDeclaration()) != NULL &&
|
||||
cd->storage_class & STCfinal);
|
||||
#endif
|
||||
ClassDeclaration *cd;
|
||||
return isMember() &&
|
||||
(Declaration::isFinal() ||
|
||||
((cd = toParent()->isClassDeclaration()) != NULL && cd->storage_class & STCfinal));
|
||||
@@ -2331,6 +2352,10 @@ void CtorDeclaration::semantic(Scope *sc)
|
||||
assert(tret);
|
||||
}
|
||||
type = new TypeFunction(arguments, tret, varargs, LINKd);
|
||||
#if STRUCTTHISREF
|
||||
if (ad && ad->isStructDeclaration())
|
||||
((TypeFunction *)type)->isref = 1;
|
||||
#endif
|
||||
if (!originalType)
|
||||
originalType = type;
|
||||
|
||||
@@ -2857,10 +2882,11 @@ void UnitTestDeclaration::semantic(Scope *sc)
|
||||
{
|
||||
if (global.params.useUnitTests)
|
||||
{
|
||||
Type *tret;
|
||||
|
||||
type = new TypeFunction(NULL, Type::tvoid, FALSE, LINKd);
|
||||
FuncDeclaration::semantic(sc);
|
||||
Scope *sc2 = sc->push();
|
||||
sc2->linkage = LINKd;
|
||||
FuncDeclaration::semantic(sc2);
|
||||
sc2->pop();
|
||||
}
|
||||
|
||||
// We're going to need ModuleInfo even if the unit tests are not
|
||||
|
||||
441
dmd2/id.c
441
dmd2/id.c
@@ -1,441 +0,0 @@
|
||||
// File generated by idgen.c
|
||||
#include "id.h"
|
||||
#include "identifier.h"
|
||||
#include "lexer.h"
|
||||
Identifier *Id::IUnknown;
|
||||
Identifier *Id::Object;
|
||||
Identifier *Id::object;
|
||||
Identifier *Id::max;
|
||||
Identifier *Id::min;
|
||||
Identifier *Id::This;
|
||||
Identifier *Id::ctor;
|
||||
Identifier *Id::dtor;
|
||||
Identifier *Id::cpctor;
|
||||
Identifier *Id::_postblit;
|
||||
Identifier *Id::classInvariant;
|
||||
Identifier *Id::unitTest;
|
||||
Identifier *Id::init;
|
||||
Identifier *Id::size;
|
||||
Identifier *Id::__sizeof;
|
||||
Identifier *Id::alignof;
|
||||
Identifier *Id::mangleof;
|
||||
Identifier *Id::stringof;
|
||||
Identifier *Id::tupleof;
|
||||
Identifier *Id::length;
|
||||
Identifier *Id::remove;
|
||||
Identifier *Id::ptr;
|
||||
Identifier *Id::funcptr;
|
||||
Identifier *Id::dollar;
|
||||
Identifier *Id::offset;
|
||||
Identifier *Id::offsetof;
|
||||
Identifier *Id::ModuleInfo;
|
||||
Identifier *Id::ClassInfo;
|
||||
Identifier *Id::classinfo;
|
||||
Identifier *Id::typeinfo;
|
||||
Identifier *Id::outer;
|
||||
Identifier *Id::Exception;
|
||||
Identifier *Id::withSym;
|
||||
Identifier *Id::result;
|
||||
Identifier *Id::returnLabel;
|
||||
Identifier *Id::delegate;
|
||||
Identifier *Id::line;
|
||||
Identifier *Id::empty;
|
||||
Identifier *Id::p;
|
||||
Identifier *Id::coverage;
|
||||
Identifier *Id::__vptr;
|
||||
Identifier *Id::__monitor;
|
||||
Identifier *Id::TypeInfo;
|
||||
Identifier *Id::TypeInfo_Class;
|
||||
Identifier *Id::TypeInfo_Interface;
|
||||
Identifier *Id::TypeInfo_Struct;
|
||||
Identifier *Id::TypeInfo_Enum;
|
||||
Identifier *Id::TypeInfo_Typedef;
|
||||
Identifier *Id::TypeInfo_Pointer;
|
||||
Identifier *Id::TypeInfo_Array;
|
||||
Identifier *Id::TypeInfo_StaticArray;
|
||||
Identifier *Id::TypeInfo_AssociativeArray;
|
||||
Identifier *Id::TypeInfo_Function;
|
||||
Identifier *Id::TypeInfo_Delegate;
|
||||
Identifier *Id::TypeInfo_Tuple;
|
||||
Identifier *Id::TypeInfo_Const;
|
||||
Identifier *Id::TypeInfo_Invariant;
|
||||
Identifier *Id::elements;
|
||||
Identifier *Id::_arguments_typeinfo;
|
||||
Identifier *Id::_arguments;
|
||||
Identifier *Id::_argptr;
|
||||
Identifier *Id::_match;
|
||||
Identifier *Id::destroy;
|
||||
Identifier *Id::postblit;
|
||||
Identifier *Id::LINE;
|
||||
Identifier *Id::FILE;
|
||||
Identifier *Id::DATE;
|
||||
Identifier *Id::TIME;
|
||||
Identifier *Id::TIMESTAMP;
|
||||
Identifier *Id::VENDOR;
|
||||
Identifier *Id::VERSIONX;
|
||||
Identifier *Id::EOFX;
|
||||
Identifier *Id::nan;
|
||||
Identifier *Id::infinity;
|
||||
Identifier *Id::dig;
|
||||
Identifier *Id::epsilon;
|
||||
Identifier *Id::mant_dig;
|
||||
Identifier *Id::max_10_exp;
|
||||
Identifier *Id::max_exp;
|
||||
Identifier *Id::min_10_exp;
|
||||
Identifier *Id::min_exp;
|
||||
Identifier *Id::re;
|
||||
Identifier *Id::im;
|
||||
Identifier *Id::C;
|
||||
Identifier *Id::D;
|
||||
Identifier *Id::Windows;
|
||||
Identifier *Id::Pascal;
|
||||
Identifier *Id::System;
|
||||
Identifier *Id::exit;
|
||||
Identifier *Id::success;
|
||||
Identifier *Id::failure;
|
||||
Identifier *Id::keys;
|
||||
Identifier *Id::values;
|
||||
Identifier *Id::rehash;
|
||||
Identifier *Id::sort;
|
||||
Identifier *Id::reverse;
|
||||
Identifier *Id::dup;
|
||||
Identifier *Id::idup;
|
||||
Identifier *Id::___out;
|
||||
Identifier *Id::___in;
|
||||
Identifier *Id::__int;
|
||||
Identifier *Id::__dollar;
|
||||
Identifier *Id::__LOCAL_SIZE;
|
||||
Identifier *Id::uadd;
|
||||
Identifier *Id::neg;
|
||||
Identifier *Id::com;
|
||||
Identifier *Id::add;
|
||||
Identifier *Id::add_r;
|
||||
Identifier *Id::sub;
|
||||
Identifier *Id::sub_r;
|
||||
Identifier *Id::mul;
|
||||
Identifier *Id::mul_r;
|
||||
Identifier *Id::div;
|
||||
Identifier *Id::div_r;
|
||||
Identifier *Id::mod;
|
||||
Identifier *Id::mod_r;
|
||||
Identifier *Id::eq;
|
||||
Identifier *Id::cmp;
|
||||
Identifier *Id::iand;
|
||||
Identifier *Id::iand_r;
|
||||
Identifier *Id::ior;
|
||||
Identifier *Id::ior_r;
|
||||
Identifier *Id::ixor;
|
||||
Identifier *Id::ixor_r;
|
||||
Identifier *Id::shl;
|
||||
Identifier *Id::shl_r;
|
||||
Identifier *Id::shr;
|
||||
Identifier *Id::shr_r;
|
||||
Identifier *Id::ushr;
|
||||
Identifier *Id::ushr_r;
|
||||
Identifier *Id::cat;
|
||||
Identifier *Id::cat_r;
|
||||
Identifier *Id::assign;
|
||||
Identifier *Id::addass;
|
||||
Identifier *Id::subass;
|
||||
Identifier *Id::mulass;
|
||||
Identifier *Id::divass;
|
||||
Identifier *Id::modass;
|
||||
Identifier *Id::andass;
|
||||
Identifier *Id::orass;
|
||||
Identifier *Id::xorass;
|
||||
Identifier *Id::shlass;
|
||||
Identifier *Id::shrass;
|
||||
Identifier *Id::ushrass;
|
||||
Identifier *Id::catass;
|
||||
Identifier *Id::postinc;
|
||||
Identifier *Id::postdec;
|
||||
Identifier *Id::index;
|
||||
Identifier *Id::indexass;
|
||||
Identifier *Id::slice;
|
||||
Identifier *Id::sliceass;
|
||||
Identifier *Id::call;
|
||||
Identifier *Id::cast;
|
||||
Identifier *Id::match;
|
||||
Identifier *Id::next;
|
||||
Identifier *Id::opIn;
|
||||
Identifier *Id::opIn_r;
|
||||
Identifier *Id::opStar;
|
||||
Identifier *Id::opDot;
|
||||
Identifier *Id::opImplicitCast;
|
||||
Identifier *Id::classNew;
|
||||
Identifier *Id::classDelete;
|
||||
Identifier *Id::apply;
|
||||
Identifier *Id::applyReverse;
|
||||
Identifier *Id::adDup;
|
||||
Identifier *Id::adReverse;
|
||||
Identifier *Id::aaLen;
|
||||
Identifier *Id::aaKeys;
|
||||
Identifier *Id::aaValues;
|
||||
Identifier *Id::aaRehash;
|
||||
Identifier *Id::GNU_asm;
|
||||
Identifier *Id::lib;
|
||||
Identifier *Id::msg;
|
||||
Identifier *Id::startaddress;
|
||||
Identifier *Id::intrinsic;
|
||||
Identifier *Id::va_intrinsic;
|
||||
Identifier *Id::no_typeinfo;
|
||||
Identifier *Id::no_moduleinfo;
|
||||
Identifier *Id::Alloca;
|
||||
Identifier *Id::vastart;
|
||||
Identifier *Id::vacopy;
|
||||
Identifier *Id::vaend;
|
||||
Identifier *Id::vaarg;
|
||||
Identifier *Id::ldc;
|
||||
Identifier *Id::tohash;
|
||||
Identifier *Id::tostring;
|
||||
Identifier *Id::getmembers;
|
||||
Identifier *Id::main;
|
||||
Identifier *Id::WinMain;
|
||||
Identifier *Id::DllMain;
|
||||
Identifier *Id::std;
|
||||
Identifier *Id::math;
|
||||
Identifier *Id::sin;
|
||||
Identifier *Id::cos;
|
||||
Identifier *Id::tan;
|
||||
Identifier *Id::_sqrt;
|
||||
Identifier *Id::fabs;
|
||||
Identifier *Id::isAbstractClass;
|
||||
Identifier *Id::isArithmetic;
|
||||
Identifier *Id::isAssociativeArray;
|
||||
Identifier *Id::isFinalClass;
|
||||
Identifier *Id::isFloating;
|
||||
Identifier *Id::isIntegral;
|
||||
Identifier *Id::isScalar;
|
||||
Identifier *Id::isStaticArray;
|
||||
Identifier *Id::isUnsigned;
|
||||
Identifier *Id::isVirtualFunction;
|
||||
Identifier *Id::isAbstractFunction;
|
||||
Identifier *Id::isFinalFunction;
|
||||
Identifier *Id::hasMember;
|
||||
Identifier *Id::getMember;
|
||||
Identifier *Id::getVirtualFunctions;
|
||||
Identifier *Id::classInstanceSize;
|
||||
Identifier *Id::allMembers;
|
||||
Identifier *Id::derivedMembers;
|
||||
Identifier *Id::isSame;
|
||||
Identifier *Id::compiles;
|
||||
void Id::initialize()
|
||||
{
|
||||
IUnknown = Lexer::idPool("IUnknown");
|
||||
Object = Lexer::idPool("Object");
|
||||
object = Lexer::idPool("object");
|
||||
max = Lexer::idPool("max");
|
||||
min = Lexer::idPool("min");
|
||||
This = Lexer::idPool("this");
|
||||
ctor = Lexer::idPool("__ctor");
|
||||
dtor = Lexer::idPool("__dtor");
|
||||
cpctor = Lexer::idPool("__cpctor");
|
||||
_postblit = Lexer::idPool("__postblit");
|
||||
classInvariant = Lexer::idPool("__invariant");
|
||||
unitTest = Lexer::idPool("__unitTest");
|
||||
init = Lexer::idPool("init");
|
||||
size = Lexer::idPool("size");
|
||||
__sizeof = Lexer::idPool("sizeof");
|
||||
alignof = Lexer::idPool("alignof");
|
||||
mangleof = Lexer::idPool("mangleof");
|
||||
stringof = Lexer::idPool("stringof");
|
||||
tupleof = Lexer::idPool("tupleof");
|
||||
length = Lexer::idPool("length");
|
||||
remove = Lexer::idPool("remove");
|
||||
ptr = Lexer::idPool("ptr");
|
||||
funcptr = Lexer::idPool("funcptr");
|
||||
dollar = Lexer::idPool("__dollar");
|
||||
offset = Lexer::idPool("offset");
|
||||
offsetof = Lexer::idPool("offsetof");
|
||||
ModuleInfo = Lexer::idPool("ModuleInfo");
|
||||
ClassInfo = Lexer::idPool("ClassInfo");
|
||||
classinfo = Lexer::idPool("classinfo");
|
||||
typeinfo = Lexer::idPool("typeinfo");
|
||||
outer = Lexer::idPool("outer");
|
||||
Exception = Lexer::idPool("Exception");
|
||||
withSym = Lexer::idPool("__withSym");
|
||||
result = Lexer::idPool("__result");
|
||||
returnLabel = Lexer::idPool("__returnLabel");
|
||||
delegate = Lexer::idPool("delegate");
|
||||
line = Lexer::idPool("line");
|
||||
empty = Lexer::idPool("");
|
||||
p = Lexer::idPool("p");
|
||||
coverage = Lexer::idPool("__coverage");
|
||||
__vptr = Lexer::idPool("__vptr");
|
||||
__monitor = Lexer::idPool("__monitor");
|
||||
TypeInfo = Lexer::idPool("TypeInfo");
|
||||
TypeInfo_Class = Lexer::idPool("TypeInfo_Class");
|
||||
TypeInfo_Interface = Lexer::idPool("TypeInfo_Interface");
|
||||
TypeInfo_Struct = Lexer::idPool("TypeInfo_Struct");
|
||||
TypeInfo_Enum = Lexer::idPool("TypeInfo_Enum");
|
||||
TypeInfo_Typedef = Lexer::idPool("TypeInfo_Typedef");
|
||||
TypeInfo_Pointer = Lexer::idPool("TypeInfo_Pointer");
|
||||
TypeInfo_Array = Lexer::idPool("TypeInfo_Array");
|
||||
TypeInfo_StaticArray = Lexer::idPool("TypeInfo_StaticArray");
|
||||
TypeInfo_AssociativeArray = Lexer::idPool("TypeInfo_AssociativeArray");
|
||||
TypeInfo_Function = Lexer::idPool("TypeInfo_Function");
|
||||
TypeInfo_Delegate = Lexer::idPool("TypeInfo_Delegate");
|
||||
TypeInfo_Tuple = Lexer::idPool("TypeInfo_Tuple");
|
||||
TypeInfo_Const = Lexer::idPool("TypeInfo_Const");
|
||||
TypeInfo_Invariant = Lexer::idPool("TypeInfo_Invariant");
|
||||
elements = Lexer::idPool("elements");
|
||||
_arguments_typeinfo = Lexer::idPool("_arguments_typeinfo");
|
||||
_arguments = Lexer::idPool("_arguments");
|
||||
_argptr = Lexer::idPool("_argptr");
|
||||
_match = Lexer::idPool("_match");
|
||||
destroy = Lexer::idPool("destroy");
|
||||
postblit = Lexer::idPool("postblit");
|
||||
LINE = Lexer::idPool("__LINE__");
|
||||
FILE = Lexer::idPool("__FILE__");
|
||||
DATE = Lexer::idPool("__DATE__");
|
||||
TIME = Lexer::idPool("__TIME__");
|
||||
TIMESTAMP = Lexer::idPool("__TIMESTAMP__");
|
||||
VENDOR = Lexer::idPool("__VENDOR__");
|
||||
VERSIONX = Lexer::idPool("__VERSION__");
|
||||
EOFX = Lexer::idPool("__EOF__");
|
||||
nan = Lexer::idPool("nan");
|
||||
infinity = Lexer::idPool("infinity");
|
||||
dig = Lexer::idPool("dig");
|
||||
epsilon = Lexer::idPool("epsilon");
|
||||
mant_dig = Lexer::idPool("mant_dig");
|
||||
max_10_exp = Lexer::idPool("max_10_exp");
|
||||
max_exp = Lexer::idPool("max_exp");
|
||||
min_10_exp = Lexer::idPool("min_10_exp");
|
||||
min_exp = Lexer::idPool("min_exp");
|
||||
re = Lexer::idPool("re");
|
||||
im = Lexer::idPool("im");
|
||||
C = Lexer::idPool("C");
|
||||
D = Lexer::idPool("D");
|
||||
Windows = Lexer::idPool("Windows");
|
||||
Pascal = Lexer::idPool("Pascal");
|
||||
System = Lexer::idPool("System");
|
||||
exit = Lexer::idPool("exit");
|
||||
success = Lexer::idPool("success");
|
||||
failure = Lexer::idPool("failure");
|
||||
keys = Lexer::idPool("keys");
|
||||
values = Lexer::idPool("values");
|
||||
rehash = Lexer::idPool("rehash");
|
||||
sort = Lexer::idPool("sort");
|
||||
reverse = Lexer::idPool("reverse");
|
||||
dup = Lexer::idPool("dup");
|
||||
idup = Lexer::idPool("idup");
|
||||
___out = Lexer::idPool("out");
|
||||
___in = Lexer::idPool("in");
|
||||
__int = Lexer::idPool("int");
|
||||
__dollar = Lexer::idPool("$");
|
||||
__LOCAL_SIZE = Lexer::idPool("__LOCAL_SIZE");
|
||||
uadd = Lexer::idPool("opPos");
|
||||
neg = Lexer::idPool("opNeg");
|
||||
com = Lexer::idPool("opCom");
|
||||
add = Lexer::idPool("opAdd");
|
||||
add_r = Lexer::idPool("opAdd_r");
|
||||
sub = Lexer::idPool("opSub");
|
||||
sub_r = Lexer::idPool("opSub_r");
|
||||
mul = Lexer::idPool("opMul");
|
||||
mul_r = Lexer::idPool("opMul_r");
|
||||
div = Lexer::idPool("opDiv");
|
||||
div_r = Lexer::idPool("opDiv_r");
|
||||
mod = Lexer::idPool("opMod");
|
||||
mod_r = Lexer::idPool("opMod_r");
|
||||
eq = Lexer::idPool("opEquals");
|
||||
cmp = Lexer::idPool("opCmp");
|
||||
iand = Lexer::idPool("opAnd");
|
||||
iand_r = Lexer::idPool("opAnd_r");
|
||||
ior = Lexer::idPool("opOr");
|
||||
ior_r = Lexer::idPool("opOr_r");
|
||||
ixor = Lexer::idPool("opXor");
|
||||
ixor_r = Lexer::idPool("opXor_r");
|
||||
shl = Lexer::idPool("opShl");
|
||||
shl_r = Lexer::idPool("opShl_r");
|
||||
shr = Lexer::idPool("opShr");
|
||||
shr_r = Lexer::idPool("opShr_r");
|
||||
ushr = Lexer::idPool("opUShr");
|
||||
ushr_r = Lexer::idPool("opUShr_r");
|
||||
cat = Lexer::idPool("opCat");
|
||||
cat_r = Lexer::idPool("opCat_r");
|
||||
assign = Lexer::idPool("opAssign");
|
||||
addass = Lexer::idPool("opAddAssign");
|
||||
subass = Lexer::idPool("opSubAssign");
|
||||
mulass = Lexer::idPool("opMulAssign");
|
||||
divass = Lexer::idPool("opDivAssign");
|
||||
modass = Lexer::idPool("opModAssign");
|
||||
andass = Lexer::idPool("opAndAssign");
|
||||
orass = Lexer::idPool("opOrAssign");
|
||||
xorass = Lexer::idPool("opXorAssign");
|
||||
shlass = Lexer::idPool("opShlAssign");
|
||||
shrass = Lexer::idPool("opShrAssign");
|
||||
ushrass = Lexer::idPool("opUShrAssign");
|
||||
catass = Lexer::idPool("opCatAssign");
|
||||
postinc = Lexer::idPool("opPostInc");
|
||||
postdec = Lexer::idPool("opPostDec");
|
||||
index = Lexer::idPool("opIndex");
|
||||
indexass = Lexer::idPool("opIndexAssign");
|
||||
slice = Lexer::idPool("opSlice");
|
||||
sliceass = Lexer::idPool("opSliceAssign");
|
||||
call = Lexer::idPool("opCall");
|
||||
cast = Lexer::idPool("opCast");
|
||||
match = Lexer::idPool("opMatch");
|
||||
next = Lexer::idPool("opNext");
|
||||
opIn = Lexer::idPool("opIn");
|
||||
opIn_r = Lexer::idPool("opIn_r");
|
||||
opStar = Lexer::idPool("opStar");
|
||||
opDot = Lexer::idPool("opDot");
|
||||
opImplicitCast = Lexer::idPool("opImplicitCast");
|
||||
classNew = Lexer::idPool("new");
|
||||
classDelete = Lexer::idPool("delete");
|
||||
apply = Lexer::idPool("opApply");
|
||||
applyReverse = Lexer::idPool("opApplyReverse");
|
||||
adDup = Lexer::idPool("_adDupT");
|
||||
adReverse = Lexer::idPool("_adReverse");
|
||||
aaLen = Lexer::idPool("_aaLen");
|
||||
aaKeys = Lexer::idPool("_aaKeys");
|
||||
aaValues = Lexer::idPool("_aaValues");
|
||||
aaRehash = Lexer::idPool("_aaRehash");
|
||||
GNU_asm = Lexer::idPool("GNU_asm");
|
||||
lib = Lexer::idPool("lib");
|
||||
msg = Lexer::idPool("msg");
|
||||
startaddress = Lexer::idPool("startaddress");
|
||||
intrinsic = Lexer::idPool("intrinsic");
|
||||
va_intrinsic = Lexer::idPool("va_intrinsic");
|
||||
no_typeinfo = Lexer::idPool("no_typeinfo");
|
||||
no_moduleinfo = Lexer::idPool("no_moduleinfo");
|
||||
Alloca = Lexer::idPool("alloca");
|
||||
vastart = Lexer::idPool("va_start");
|
||||
vacopy = Lexer::idPool("va_copy");
|
||||
vaend = Lexer::idPool("va_end");
|
||||
vaarg = Lexer::idPool("va_arg");
|
||||
ldc = Lexer::idPool("ldc");
|
||||
tohash = Lexer::idPool("toHash");
|
||||
tostring = Lexer::idPool("toString");
|
||||
getmembers = Lexer::idPool("getMembers");
|
||||
main = Lexer::idPool("main");
|
||||
WinMain = Lexer::idPool("WinMain");
|
||||
DllMain = Lexer::idPool("DllMain");
|
||||
std = Lexer::idPool("std");
|
||||
math = Lexer::idPool("math");
|
||||
sin = Lexer::idPool("sin");
|
||||
cos = Lexer::idPool("cos");
|
||||
tan = Lexer::idPool("tan");
|
||||
_sqrt = Lexer::idPool("sqrt");
|
||||
fabs = Lexer::idPool("fabs");
|
||||
isAbstractClass = Lexer::idPool("isAbstractClass");
|
||||
isArithmetic = Lexer::idPool("isArithmetic");
|
||||
isAssociativeArray = Lexer::idPool("isAssociativeArray");
|
||||
isFinalClass = Lexer::idPool("isFinalClass");
|
||||
isFloating = Lexer::idPool("isFloating");
|
||||
isIntegral = Lexer::idPool("isIntegral");
|
||||
isScalar = Lexer::idPool("isScalar");
|
||||
isStaticArray = Lexer::idPool("isStaticArray");
|
||||
isUnsigned = Lexer::idPool("isUnsigned");
|
||||
isVirtualFunction = Lexer::idPool("isVirtualFunction");
|
||||
isAbstractFunction = Lexer::idPool("isAbstractFunction");
|
||||
isFinalFunction = Lexer::idPool("isFinalFunction");
|
||||
hasMember = Lexer::idPool("hasMember");
|
||||
getMember = Lexer::idPool("getMember");
|
||||
getVirtualFunctions = Lexer::idPool("getVirtualFunctions");
|
||||
classInstanceSize = Lexer::idPool("classInstanceSize");
|
||||
allMembers = Lexer::idPool("allMembers");
|
||||
derivedMembers = Lexer::idPool("derivedMembers");
|
||||
isSame = Lexer::idPool("isSame");
|
||||
compiles = Lexer::idPool("compiles");
|
||||
}
|
||||
226
dmd2/id.h
226
dmd2/id.h
@@ -1,226 +0,0 @@
|
||||
// File generated by idgen.c
|
||||
#ifndef DMD_ID_H
|
||||
#define DMD_ID_H 1
|
||||
struct Identifier;
|
||||
struct Id
|
||||
{
|
||||
static Identifier *IUnknown;
|
||||
static Identifier *Object;
|
||||
static Identifier *object;
|
||||
static Identifier *max;
|
||||
static Identifier *min;
|
||||
static Identifier *This;
|
||||
static Identifier *ctor;
|
||||
static Identifier *dtor;
|
||||
static Identifier *cpctor;
|
||||
static Identifier *_postblit;
|
||||
static Identifier *classInvariant;
|
||||
static Identifier *unitTest;
|
||||
static Identifier *init;
|
||||
static Identifier *size;
|
||||
static Identifier *__sizeof;
|
||||
static Identifier *alignof;
|
||||
static Identifier *mangleof;
|
||||
static Identifier *stringof;
|
||||
static Identifier *tupleof;
|
||||
static Identifier *length;
|
||||
static Identifier *remove;
|
||||
static Identifier *ptr;
|
||||
static Identifier *funcptr;
|
||||
static Identifier *dollar;
|
||||
static Identifier *offset;
|
||||
static Identifier *offsetof;
|
||||
static Identifier *ModuleInfo;
|
||||
static Identifier *ClassInfo;
|
||||
static Identifier *classinfo;
|
||||
static Identifier *typeinfo;
|
||||
static Identifier *outer;
|
||||
static Identifier *Exception;
|
||||
static Identifier *withSym;
|
||||
static Identifier *result;
|
||||
static Identifier *returnLabel;
|
||||
static Identifier *delegate;
|
||||
static Identifier *line;
|
||||
static Identifier *empty;
|
||||
static Identifier *p;
|
||||
static Identifier *coverage;
|
||||
static Identifier *__vptr;
|
||||
static Identifier *__monitor;
|
||||
static Identifier *TypeInfo;
|
||||
static Identifier *TypeInfo_Class;
|
||||
static Identifier *TypeInfo_Interface;
|
||||
static Identifier *TypeInfo_Struct;
|
||||
static Identifier *TypeInfo_Enum;
|
||||
static Identifier *TypeInfo_Typedef;
|
||||
static Identifier *TypeInfo_Pointer;
|
||||
static Identifier *TypeInfo_Array;
|
||||
static Identifier *TypeInfo_StaticArray;
|
||||
static Identifier *TypeInfo_AssociativeArray;
|
||||
static Identifier *TypeInfo_Function;
|
||||
static Identifier *TypeInfo_Delegate;
|
||||
static Identifier *TypeInfo_Tuple;
|
||||
static Identifier *TypeInfo_Const;
|
||||
static Identifier *TypeInfo_Invariant;
|
||||
static Identifier *elements;
|
||||
static Identifier *_arguments_typeinfo;
|
||||
static Identifier *_arguments;
|
||||
static Identifier *_argptr;
|
||||
static Identifier *_match;
|
||||
static Identifier *destroy;
|
||||
static Identifier *postblit;
|
||||
static Identifier *LINE;
|
||||
static Identifier *FILE;
|
||||
static Identifier *DATE;
|
||||
static Identifier *TIME;
|
||||
static Identifier *TIMESTAMP;
|
||||
static Identifier *VENDOR;
|
||||
static Identifier *VERSIONX;
|
||||
static Identifier *EOFX;
|
||||
static Identifier *nan;
|
||||
static Identifier *infinity;
|
||||
static Identifier *dig;
|
||||
static Identifier *epsilon;
|
||||
static Identifier *mant_dig;
|
||||
static Identifier *max_10_exp;
|
||||
static Identifier *max_exp;
|
||||
static Identifier *min_10_exp;
|
||||
static Identifier *min_exp;
|
||||
static Identifier *re;
|
||||
static Identifier *im;
|
||||
static Identifier *C;
|
||||
static Identifier *D;
|
||||
static Identifier *Windows;
|
||||
static Identifier *Pascal;
|
||||
static Identifier *System;
|
||||
static Identifier *exit;
|
||||
static Identifier *success;
|
||||
static Identifier *failure;
|
||||
static Identifier *keys;
|
||||
static Identifier *values;
|
||||
static Identifier *rehash;
|
||||
static Identifier *sort;
|
||||
static Identifier *reverse;
|
||||
static Identifier *dup;
|
||||
static Identifier *idup;
|
||||
static Identifier *___out;
|
||||
static Identifier *___in;
|
||||
static Identifier *__int;
|
||||
static Identifier *__dollar;
|
||||
static Identifier *__LOCAL_SIZE;
|
||||
static Identifier *uadd;
|
||||
static Identifier *neg;
|
||||
static Identifier *com;
|
||||
static Identifier *add;
|
||||
static Identifier *add_r;
|
||||
static Identifier *sub;
|
||||
static Identifier *sub_r;
|
||||
static Identifier *mul;
|
||||
static Identifier *mul_r;
|
||||
static Identifier *div;
|
||||
static Identifier *div_r;
|
||||
static Identifier *mod;
|
||||
static Identifier *mod_r;
|
||||
static Identifier *eq;
|
||||
static Identifier *cmp;
|
||||
static Identifier *iand;
|
||||
static Identifier *iand_r;
|
||||
static Identifier *ior;
|
||||
static Identifier *ior_r;
|
||||
static Identifier *ixor;
|
||||
static Identifier *ixor_r;
|
||||
static Identifier *shl;
|
||||
static Identifier *shl_r;
|
||||
static Identifier *shr;
|
||||
static Identifier *shr_r;
|
||||
static Identifier *ushr;
|
||||
static Identifier *ushr_r;
|
||||
static Identifier *cat;
|
||||
static Identifier *cat_r;
|
||||
static Identifier *assign;
|
||||
static Identifier *addass;
|
||||
static Identifier *subass;
|
||||
static Identifier *mulass;
|
||||
static Identifier *divass;
|
||||
static Identifier *modass;
|
||||
static Identifier *andass;
|
||||
static Identifier *orass;
|
||||
static Identifier *xorass;
|
||||
static Identifier *shlass;
|
||||
static Identifier *shrass;
|
||||
static Identifier *ushrass;
|
||||
static Identifier *catass;
|
||||
static Identifier *postinc;
|
||||
static Identifier *postdec;
|
||||
static Identifier *index;
|
||||
static Identifier *indexass;
|
||||
static Identifier *slice;
|
||||
static Identifier *sliceass;
|
||||
static Identifier *call;
|
||||
static Identifier *cast;
|
||||
static Identifier *match;
|
||||
static Identifier *next;
|
||||
static Identifier *opIn;
|
||||
static Identifier *opIn_r;
|
||||
static Identifier *opStar;
|
||||
static Identifier *opDot;
|
||||
static Identifier *opImplicitCast;
|
||||
static Identifier *classNew;
|
||||
static Identifier *classDelete;
|
||||
static Identifier *apply;
|
||||
static Identifier *applyReverse;
|
||||
static Identifier *adDup;
|
||||
static Identifier *adReverse;
|
||||
static Identifier *aaLen;
|
||||
static Identifier *aaKeys;
|
||||
static Identifier *aaValues;
|
||||
static Identifier *aaRehash;
|
||||
static Identifier *GNU_asm;
|
||||
static Identifier *lib;
|
||||
static Identifier *msg;
|
||||
static Identifier *startaddress;
|
||||
static Identifier *intrinsic;
|
||||
static Identifier *va_intrinsic;
|
||||
static Identifier *no_typeinfo;
|
||||
static Identifier *no_moduleinfo;
|
||||
static Identifier *Alloca;
|
||||
static Identifier *vastart;
|
||||
static Identifier *vacopy;
|
||||
static Identifier *vaend;
|
||||
static Identifier *vaarg;
|
||||
static Identifier *ldc;
|
||||
static Identifier *tohash;
|
||||
static Identifier *tostring;
|
||||
static Identifier *getmembers;
|
||||
static Identifier *main;
|
||||
static Identifier *WinMain;
|
||||
static Identifier *DllMain;
|
||||
static Identifier *std;
|
||||
static Identifier *math;
|
||||
static Identifier *sin;
|
||||
static Identifier *cos;
|
||||
static Identifier *tan;
|
||||
static Identifier *_sqrt;
|
||||
static Identifier *fabs;
|
||||
static Identifier *isAbstractClass;
|
||||
static Identifier *isArithmetic;
|
||||
static Identifier *isAssociativeArray;
|
||||
static Identifier *isFinalClass;
|
||||
static Identifier *isFloating;
|
||||
static Identifier *isIntegral;
|
||||
static Identifier *isScalar;
|
||||
static Identifier *isStaticArray;
|
||||
static Identifier *isUnsigned;
|
||||
static Identifier *isVirtualFunction;
|
||||
static Identifier *isAbstractFunction;
|
||||
static Identifier *isFinalFunction;
|
||||
static Identifier *hasMember;
|
||||
static Identifier *getMember;
|
||||
static Identifier *getVirtualFunctions;
|
||||
static Identifier *classInstanceSize;
|
||||
static Identifier *allMembers;
|
||||
static Identifier *derivedMembers;
|
||||
static Identifier *isSame;
|
||||
static Identifier *compiles;
|
||||
static void initialize();
|
||||
};
|
||||
#endif
|
||||
@@ -70,6 +70,7 @@ Msgtable msgtable[] =
|
||||
{ "coverage", "__coverage" },
|
||||
{ "__vptr" },
|
||||
{ "__monitor" },
|
||||
{ "system" },
|
||||
|
||||
{ "TypeInfo" },
|
||||
{ "TypeInfo_Class" },
|
||||
@@ -207,6 +208,12 @@ Msgtable msgtable[] =
|
||||
{ "apply", "opApply" },
|
||||
{ "applyReverse", "opApplyReverse" },
|
||||
|
||||
{ "Fempty", "empty" },
|
||||
{ "Fhead", "head" },
|
||||
{ "Ftoe", "toe" },
|
||||
{ "Fnext", "next" },
|
||||
{ "Fretreat", "retreat" },
|
||||
|
||||
{ "adDup", "_adDupT" },
|
||||
{ "adReverse", "_adReverse" },
|
||||
|
||||
|
||||
182
dmd2/impcnvtab.c
182
dmd2/impcnvtab.c
@@ -1,182 +0,0 @@
|
||||
// This file is generated by impcnvgen.c
|
||||
#include "mtype.h"
|
||||
unsigned char Type::impcnvResult[TMAX][TMAX] =
|
||||
{
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,19,19,19,19,19,19,20,21,22,23,24,22,23,24,28,29,30,36,19,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,20,20,20,20,20,20,20,21,22,23,24,22,23,24,28,29,30,36,20,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,21,21,21,21,21,21,21,21,22,23,24,22,23,24,28,29,30,36,21,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,22,23,24,28,29,30,36,22,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,23,23,24,29,29,30,36,23,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,24,24,24,30,30,30,36,24,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,36,22,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,36,23,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,36,24,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,28,28,28,28,28,28,28,28,28,29,30,28,29,30,28,29,30,36,28,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,29,29,29,29,29,29,29,29,29,29,30,29,29,30,29,29,30,36,29,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,36,30,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,28,29,30,36,32,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
};
|
||||
unsigned char Type::impcnvType1[TMAX][TMAX] =
|
||||
{
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,19,19,19,19,19,19,20,21,22,23,24,22,23,24,22,23,24,36,19,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,20,20,20,20,20,20,20,21,22,23,24,22,23,24,22,23,24,36,20,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,21,21,21,21,21,21,21,21,22,23,24,22,23,24,22,23,24,36,21,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,22,23,24,22,23,24,36,22,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,23,23,24,23,23,24,36,23,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,36,24,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,25,25,25,25,25,25,25,25,25,26,27,25,26,27,25,26,27,36,25,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,26,26,26,26,26,26,26,26,26,26,27,26,26,27,26,26,27,36,26,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,36,27,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,28,28,28,28,28,28,28,28,28,29,30,28,29,30,28,29,30,36,28,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,29,29,29,29,29,29,29,29,29,29,30,29,29,30,29,29,30,36,29,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,36,30,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,22,23,24,22,23,24,36,32,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
};
|
||||
unsigned char Type::impcnvType2[TMAX][TMAX] =
|
||||
{
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,36,18,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,19,19,19,19,19,19,20,21,22,23,24,25,26,27,28,29,30,36,19,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,20,20,20,20,20,20,20,21,22,23,24,25,26,27,28,29,30,36,20,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,21,21,21,21,21,21,21,21,22,23,24,25,26,27,28,29,30,36,21,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,36,22,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,36,23,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,36,24,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,36,22,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,36,23,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,36,24,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,22,22,22,22,22,22,22,22,22,23,24,25,26,27,28,29,30,36,22,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,23,23,23,23,23,23,23,23,23,23,24,26,26,27,29,29,30,36,23,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,24,24,24,24,24,24,24,24,24,24,24,27,27,27,30,30,30,36,24,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,18,18,18,18,18,19,20,21,22,23,24,25,26,27,28,29,30,36,32,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,
|
||||
};
|
||||
unsigned char Type::impcnvWarn[TMAX][TMAX] =
|
||||
{
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
};
|
||||
537
dmd2/import.c
537
dmd2/import.c
@@ -1,275 +1,262 @@
|
||||
|
||||
// Compiler implementation of the D programming language
|
||||
// Copyright (c) 1999-2006 by Digital Mars
|
||||
// All Rights Reserved
|
||||
// written by Walter Bright
|
||||
// http://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.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "root.h"
|
||||
#include "dsymbol.h"
|
||||
#include "import.h"
|
||||
#include "identifier.h"
|
||||
#include "module.h"
|
||||
#include "scope.h"
|
||||
#include "hdrgen.h"
|
||||
#include "mtype.h"
|
||||
#include "declaration.h"
|
||||
#include "id.h"
|
||||
|
||||
/********************************* Import ****************************/
|
||||
|
||||
Import::Import(Loc loc, Array *packages, Identifier *id, Identifier *aliasId,
|
||||
int isstatic)
|
||||
: Dsymbol(id)
|
||||
{
|
||||
this->loc = loc;
|
||||
this->packages = packages;
|
||||
this->id = id;
|
||||
this->aliasId = aliasId;
|
||||
this->isstatic = isstatic;
|
||||
protection = PROTundefined;
|
||||
pkg = NULL;
|
||||
mod = NULL;
|
||||
|
||||
if (aliasId)
|
||||
this->ident = aliasId;
|
||||
// Kludge to change Import identifier to first package
|
||||
else if (packages && packages->dim)
|
||||
this->ident = (Identifier *)packages->data[0];
|
||||
}
|
||||
|
||||
void Import::addAlias(Identifier *name, Identifier *alias)
|
||||
{
|
||||
if (isstatic)
|
||||
error("cannot have an import bind list");
|
||||
|
||||
if (!aliasId)
|
||||
this->ident = NULL; // make it an anonymous import
|
||||
|
||||
names.push(name);
|
||||
aliases.push(alias);
|
||||
}
|
||||
|
||||
const char *Import::kind()
|
||||
{
|
||||
return isstatic ? (char *)"static import" : (char *)"import";
|
||||
}
|
||||
|
||||
enum PROT Import::prot()
|
||||
{
|
||||
return protection;
|
||||
}
|
||||
|
||||
Dsymbol *Import::syntaxCopy(Dsymbol *s)
|
||||
{
|
||||
assert(!s);
|
||||
|
||||
Import *si;
|
||||
|
||||
si = new Import(loc, packages, id, aliasId, isstatic);
|
||||
|
||||
for (size_t i = 0; i < names.dim; i++)
|
||||
{
|
||||
si->addAlias((Identifier *)names.data[i], (Identifier *)aliases.data[i]);
|
||||
}
|
||||
|
||||
return si;
|
||||
}
|
||||
|
||||
void Import::load(Scope *sc)
|
||||
{
|
||||
DsymbolTable *dst;
|
||||
Dsymbol *s;
|
||||
|
||||
//printf("Import::load('%s')\n", toChars());
|
||||
|
||||
// See if existing module
|
||||
dst = Package::resolve(packages, NULL, &pkg);
|
||||
|
||||
s = dst->lookup(id);
|
||||
if (s)
|
||||
{
|
||||
if (s->isModule())
|
||||
mod = (Module *)s;
|
||||
else
|
||||
error("package and module have the same name");
|
||||
}
|
||||
|
||||
if (!mod)
|
||||
{
|
||||
// Load module
|
||||
mod = Module::load(loc, packages, id);
|
||||
dst->insert(id, mod); // id may be different from mod->ident,
|
||||
// if so then insert alias
|
||||
if (!mod->importedFrom)
|
||||
mod->importedFrom = sc ? sc->module->importedFrom : Module::rootModule;
|
||||
}
|
||||
if (!pkg)
|
||||
pkg = mod;
|
||||
mod->semantic();
|
||||
|
||||
//printf("-Import::load('%s'), pkg = %p\n", toChars(), pkg);
|
||||
}
|
||||
|
||||
|
||||
void Import::semantic(Scope *sc)
|
||||
{
|
||||
//printf("Import::semantic('%s')\n", toChars());
|
||||
|
||||
load(sc);
|
||||
|
||||
if (mod)
|
||||
{
|
||||
#if 0
|
||||
if (mod->loc.linnum != 0)
|
||||
{ /* If the line number is not 0, then this is not
|
||||
* a 'root' module, i.e. it was not specified on the command line.
|
||||
*/
|
||||
mod->importedFrom = sc->module->importedFrom;
|
||||
assert(mod->importedFrom);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Default to private importing
|
||||
*/
|
||||
protection = sc->protection;
|
||||
if (!sc->explicitProtection)
|
||||
protection = PROTprivate;
|
||||
|
||||
if (!isstatic && !aliasId && !names.dim)
|
||||
{
|
||||
sc->scopesym->importScope(mod, protection);
|
||||
}
|
||||
|
||||
// Modules need a list of each imported module
|
||||
sc->module->aimports.push(mod);
|
||||
|
||||
if (mod->needmoduleinfo)
|
||||
sc->module->needmoduleinfo = 1;
|
||||
|
||||
sc = sc->push(mod);
|
||||
for (size_t i = 0; i < aliasdecls.dim; i++)
|
||||
{ AliasDeclaration *ad = (AliasDeclaration *)aliasdecls.data[i];
|
||||
|
||||
//printf("\tImport alias semantic('%s')\n", s->toChars());
|
||||
if (!mod->search(loc, (Identifier *)names.data[i], 0))
|
||||
error("%s not found", ((Identifier *)names.data[i])->toChars());
|
||||
|
||||
ad->semantic(sc);
|
||||
ad->protection = protection;
|
||||
}
|
||||
sc = sc->pop();
|
||||
}
|
||||
//printf("-Import::semantic('%s'), pkg = %p\n", toChars(), pkg);
|
||||
}
|
||||
|
||||
void Import::semantic2(Scope *sc)
|
||||
{
|
||||
//printf("Import::semantic2('%s')\n", toChars());
|
||||
mod->semantic2();
|
||||
if (mod->needmoduleinfo)
|
||||
sc->module->needmoduleinfo = 1;
|
||||
}
|
||||
|
||||
Dsymbol *Import::toAlias()
|
||||
{
|
||||
if (aliasId)
|
||||
return mod;
|
||||
return this;
|
||||
}
|
||||
|
||||
int Import::addMember(Scope *sc, ScopeDsymbol *sd, int memnum)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if (names.dim == 0)
|
||||
return Dsymbol::addMember(sc, sd, memnum);
|
||||
|
||||
if (aliasId)
|
||||
result = Dsymbol::addMember(sc, sd, memnum);
|
||||
|
||||
for (size_t i = 0; i < names.dim; i++)
|
||||
{
|
||||
Identifier *name = (Identifier *)names.data[i];
|
||||
Identifier *alias = (Identifier *)aliases.data[i];
|
||||
|
||||
if (!alias)
|
||||
alias = name;
|
||||
|
||||
#if 1
|
||||
TypeIdentifier *tname = new TypeIdentifier(loc, name);
|
||||
#else
|
||||
TypeIdentifier *tname = new TypeIdentifier(loc, NULL);
|
||||
if (packages)
|
||||
{
|
||||
for (size_t j = 0; j < packages->dim; j++)
|
||||
{ Identifier *pid = (Identifier *)packages->data[j];
|
||||
|
||||
if (!tname->ident)
|
||||
tname->ident = pid;
|
||||
else
|
||||
tname->addIdent(pid);
|
||||
}
|
||||
}
|
||||
if (!tname->ident)
|
||||
tname->ident = id;
|
||||
else
|
||||
tname->addIdent(id);
|
||||
tname->addIdent(name);
|
||||
#endif
|
||||
AliasDeclaration *ad = new AliasDeclaration(loc, alias, tname);
|
||||
result |= ad->addMember(sc, sd, memnum);
|
||||
|
||||
aliasdecls.push(ad);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Dsymbol *Import::search(Loc loc, Identifier *ident, int flags)
|
||||
{
|
||||
//printf("%s.Import::search(ident = '%s', flags = x%x)\n", toChars(), ident->toChars(), flags);
|
||||
|
||||
if (!pkg)
|
||||
load(NULL);
|
||||
|
||||
// Forward it to the package/module
|
||||
return pkg->search(loc, ident, flags);
|
||||
}
|
||||
|
||||
int Import::overloadInsert(Dsymbol *s)
|
||||
{
|
||||
// Allow multiple imports of the same name
|
||||
return s->isImport() != NULL;
|
||||
}
|
||||
|
||||
void Import::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
|
||||
{
|
||||
if (hgs->hdrgen && id == Id::object)
|
||||
return; // object is imported by default
|
||||
|
||||
if (isstatic)
|
||||
buf->writestring("static ");
|
||||
buf->writestring("import ");
|
||||
if (aliasId)
|
||||
{
|
||||
buf->printf("%s = ", aliasId->toChars());
|
||||
}
|
||||
if (packages && packages->dim)
|
||||
{
|
||||
for (size_t i = 0; i < packages->dim; i++)
|
||||
{ Identifier *pid = (Identifier *)packages->data[i];
|
||||
|
||||
buf->printf("%s.", pid->toChars());
|
||||
}
|
||||
}
|
||||
buf->printf("%s;", id->toChars());
|
||||
buf->writenl();
|
||||
}
|
||||
|
||||
|
||||
// Compiler implementation of the D programming language
|
||||
// Copyright (c) 1999-2006 by Digital Mars
|
||||
// All Rights Reserved
|
||||
// written by Walter Bright
|
||||
// http://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.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "root.h"
|
||||
#include "dsymbol.h"
|
||||
#include "import.h"
|
||||
#include "identifier.h"
|
||||
#include "module.h"
|
||||
#include "scope.h"
|
||||
#include "hdrgen.h"
|
||||
#include "mtype.h"
|
||||
#include "declaration.h"
|
||||
#include "id.h"
|
||||
|
||||
/********************************* Import ****************************/
|
||||
|
||||
Import::Import(Loc loc, Array *packages, Identifier *id, Identifier *aliasId,
|
||||
int isstatic)
|
||||
: Dsymbol(id)
|
||||
{
|
||||
this->loc = loc;
|
||||
this->packages = packages;
|
||||
this->id = id;
|
||||
this->aliasId = aliasId;
|
||||
this->isstatic = isstatic;
|
||||
protection = PROTundefined;
|
||||
pkg = NULL;
|
||||
mod = NULL;
|
||||
|
||||
if (aliasId)
|
||||
this->ident = aliasId;
|
||||
// Kludge to change Import identifier to first package
|
||||
else if (packages && packages->dim)
|
||||
this->ident = (Identifier *)packages->data[0];
|
||||
}
|
||||
|
||||
void Import::addAlias(Identifier *name, Identifier *alias)
|
||||
{
|
||||
if (isstatic)
|
||||
error("cannot have an import bind list");
|
||||
|
||||
if (!aliasId)
|
||||
this->ident = NULL; // make it an anonymous import
|
||||
|
||||
names.push(name);
|
||||
aliases.push(alias);
|
||||
}
|
||||
|
||||
const char *Import::kind()
|
||||
{
|
||||
return isstatic ? (char *)"static import" : (char *)"import";
|
||||
}
|
||||
|
||||
enum PROT Import::prot()
|
||||
{
|
||||
return protection;
|
||||
}
|
||||
|
||||
Dsymbol *Import::syntaxCopy(Dsymbol *s)
|
||||
{
|
||||
assert(!s);
|
||||
|
||||
Import *si;
|
||||
|
||||
si = new Import(loc, packages, id, aliasId, isstatic);
|
||||
|
||||
for (size_t i = 0; i < names.dim; i++)
|
||||
{
|
||||
si->addAlias((Identifier *)names.data[i], (Identifier *)aliases.data[i]);
|
||||
}
|
||||
|
||||
return si;
|
||||
}
|
||||
|
||||
void Import::load(Scope *sc)
|
||||
{
|
||||
DsymbolTable *dst;
|
||||
Dsymbol *s;
|
||||
|
||||
//printf("Import::load('%s')\n", toChars());
|
||||
|
||||
// See if existing module
|
||||
dst = Package::resolve(packages, NULL, &pkg);
|
||||
|
||||
s = dst->lookup(id);
|
||||
if (s)
|
||||
{
|
||||
if (s->isModule())
|
||||
mod = (Module *)s;
|
||||
else
|
||||
error("package and module have the same name");
|
||||
}
|
||||
|
||||
if (!mod)
|
||||
{
|
||||
// Load module
|
||||
mod = Module::load(loc, packages, id);
|
||||
dst->insert(id, mod); // id may be different from mod->ident,
|
||||
// if so then insert alias
|
||||
if (!mod->importedFrom)
|
||||
mod->importedFrom = sc ? sc->module->importedFrom : Module::rootModule;
|
||||
}
|
||||
if (!pkg)
|
||||
pkg = mod;
|
||||
mod->semantic();
|
||||
|
||||
//printf("-Import::load('%s'), pkg = %p\n", toChars(), pkg);
|
||||
}
|
||||
|
||||
|
||||
void Import::semantic(Scope *sc)
|
||||
{
|
||||
//printf("Import::semantic('%s')\n", toChars());
|
||||
|
||||
load(sc);
|
||||
|
||||
if (mod)
|
||||
{
|
||||
#if 0
|
||||
if (mod->loc.linnum != 0)
|
||||
{ /* If the line number is not 0, then this is not
|
||||
* a 'root' module, i.e. it was not specified on the command line.
|
||||
*/
|
||||
mod->importedFrom = sc->module->importedFrom;
|
||||
assert(mod->importedFrom);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Default to private importing
|
||||
*/
|
||||
protection = sc->protection;
|
||||
if (!sc->explicitProtection)
|
||||
protection = PROTprivate;
|
||||
|
||||
if (!isstatic && !aliasId && !names.dim)
|
||||
{
|
||||
sc->scopesym->importScope(mod, protection);
|
||||
}
|
||||
|
||||
// Modules need a list of each imported module
|
||||
sc->module->aimports.push(mod);
|
||||
|
||||
if (mod->needmoduleinfo)
|
||||
sc->module->needmoduleinfo = 1;
|
||||
|
||||
sc = sc->push(mod);
|
||||
for (size_t i = 0; i < aliasdecls.dim; i++)
|
||||
{ AliasDeclaration *ad = (AliasDeclaration *)aliasdecls.data[i];
|
||||
|
||||
//printf("\tImport alias semantic('%s')\n", s->toChars());
|
||||
if (!mod->search(loc, (Identifier *)names.data[i], 0))
|
||||
error("%s not found", ((Identifier *)names.data[i])->toChars());
|
||||
|
||||
ad->semantic(sc);
|
||||
ad->protection = protection;
|
||||
}
|
||||
sc = sc->pop();
|
||||
}
|
||||
//printf("-Import::semantic('%s'), pkg = %p\n", toChars(), pkg);
|
||||
}
|
||||
|
||||
void Import::semantic2(Scope *sc)
|
||||
{
|
||||
//printf("Import::semantic2('%s')\n", toChars());
|
||||
mod->semantic2();
|
||||
if (mod->needmoduleinfo)
|
||||
sc->module->needmoduleinfo = 1;
|
||||
}
|
||||
|
||||
Dsymbol *Import::toAlias()
|
||||
{
|
||||
if (aliasId)
|
||||
return mod;
|
||||
return this;
|
||||
}
|
||||
|
||||
/*****************************
|
||||
* Add import to sd's symbol table.
|
||||
*/
|
||||
|
||||
int Import::addMember(Scope *sc, ScopeDsymbol *sd, int memnum)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if (names.dim == 0)
|
||||
return Dsymbol::addMember(sc, sd, memnum);
|
||||
|
||||
if (aliasId)
|
||||
result = Dsymbol::addMember(sc, sd, memnum);
|
||||
|
||||
/* Instead of adding the import to sd's symbol table,
|
||||
* add each of the alias=name pairs
|
||||
*/
|
||||
for (size_t i = 0; i < names.dim; i++)
|
||||
{
|
||||
Identifier *name = (Identifier *)names.data[i];
|
||||
Identifier *alias = (Identifier *)aliases.data[i];
|
||||
|
||||
if (!alias)
|
||||
alias = name;
|
||||
|
||||
TypeIdentifier *tname = new TypeIdentifier(loc, name);
|
||||
AliasDeclaration *ad = new AliasDeclaration(loc, alias, tname);
|
||||
result |= ad->addMember(sc, sd, memnum);
|
||||
|
||||
aliasdecls.push(ad);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Dsymbol *Import::search(Loc loc, Identifier *ident, int flags)
|
||||
{
|
||||
//printf("%s.Import::search(ident = '%s', flags = x%x)\n", toChars(), ident->toChars(), flags);
|
||||
|
||||
if (!pkg)
|
||||
load(NULL);
|
||||
|
||||
// Forward it to the package/module
|
||||
return pkg->search(loc, ident, flags);
|
||||
}
|
||||
|
||||
int Import::overloadInsert(Dsymbol *s)
|
||||
{
|
||||
// Allow multiple imports of the same name
|
||||
return s->isImport() != NULL;
|
||||
}
|
||||
|
||||
void Import::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
|
||||
{
|
||||
if (hgs->hdrgen && id == Id::object)
|
||||
return; // object is imported by default
|
||||
|
||||
if (isstatic)
|
||||
buf->writestring("static ");
|
||||
buf->writestring("import ");
|
||||
if (aliasId)
|
||||
{
|
||||
buf->printf("%s = ", aliasId->toChars());
|
||||
}
|
||||
if (packages && packages->dim)
|
||||
{
|
||||
for (size_t i = 0; i < packages->dim; i++)
|
||||
{ Identifier *pid = (Identifier *)packages->data[i];
|
||||
|
||||
buf->printf("%s.", pid->toChars());
|
||||
}
|
||||
}
|
||||
buf->printf("%s;", id->toChars());
|
||||
buf->writenl();
|
||||
}
|
||||
|
||||
|
||||
@@ -526,6 +526,7 @@ Initializer *ExpInitializer::semantic(Scope *sc, Type *t)
|
||||
{
|
||||
//printf("ExpInitializer::semantic(%s), type = %s\n", exp->toChars(), t->toChars());
|
||||
exp = exp->semantic(sc);
|
||||
exp = resolveProperties(sc, exp);
|
||||
exp = exp->optimize(WANTvalue | WANTinterpret);
|
||||
Type *tb = t->toBasetype();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
// Copyright (c) 1999-2007 by Digital Mars
|
||||
// Copyright (c) 1999-2008 by Digital Mars
|
||||
// All Rights Reserved
|
||||
// written by Walter Bright
|
||||
// http://www.digitalmars.com
|
||||
@@ -565,9 +565,9 @@ Expression *DeclarationExp::doInline(InlineDoState *ids)
|
||||
}
|
||||
else
|
||||
{
|
||||
ExpInitializer *ie = vd->init->isExpInitializer();
|
||||
assert(ie);
|
||||
vto->init = new ExpInitializer(ie->loc, ie->exp->doInline(ids));
|
||||
Expression *e = vd->init->toExpression();
|
||||
assert(e);
|
||||
vto->init = new ExpInitializer(e->loc, e->doInline(ids));
|
||||
}
|
||||
}
|
||||
de->declaration = (Dsymbol *) (void *)vto;
|
||||
@@ -1368,6 +1368,20 @@ Expression *FuncDeclaration::doInline(InlineScanState *iss, Expression *ethis, A
|
||||
ExpInitializer *ei;
|
||||
VarExp *ve;
|
||||
|
||||
#if STRUCTTHISREF
|
||||
if (ethis->type->ty == Tpointer)
|
||||
{ Type *t = ethis->type->nextOf();
|
||||
ethis = new PtrExp(ethis->loc, ethis);
|
||||
ethis->type = t;
|
||||
}
|
||||
ei = new ExpInitializer(ethis->loc, ethis);
|
||||
|
||||
vthis = new VarDeclaration(ethis->loc, ethis->type, Id::This, ei);
|
||||
if (ethis->type->ty != Tclass)
|
||||
vthis->storage_class = STCref;
|
||||
else
|
||||
vthis->storage_class = STCin;
|
||||
#else
|
||||
if (ethis->type->ty != Tclass && ethis->type->ty != Tpointer)
|
||||
{
|
||||
ethis = ethis->addressOf(NULL);
|
||||
@@ -1377,6 +1391,7 @@ Expression *FuncDeclaration::doInline(InlineScanState *iss, Expression *ethis, A
|
||||
|
||||
vthis = new VarDeclaration(ethis->loc, ethis->type, Id::This, ei);
|
||||
vthis->storage_class = STCin;
|
||||
#endif
|
||||
vthis->linkage = LINKd;
|
||||
vthis->parent = iss->fd;
|
||||
|
||||
@@ -1385,6 +1400,13 @@ Expression *FuncDeclaration::doInline(InlineScanState *iss, Expression *ethis, A
|
||||
|
||||
ei->exp = new AssignExp(vthis->loc, ve, ethis);
|
||||
ei->exp->type = ve->type;
|
||||
#if STRUCTTHISREF
|
||||
if (ethis->type->ty != Tclass)
|
||||
{ /* This is a reference initialization, not a simple assignment.
|
||||
*/
|
||||
ei->exp->op = TOKconstruct;
|
||||
}
|
||||
#endif
|
||||
|
||||
ids.vthis = vthis;
|
||||
}
|
||||
|
||||
29
dmd2/lexer.c
29
dmd2/lexer.c
@@ -2656,10 +2656,13 @@ unsigned Lexer::decodeUTF()
|
||||
|
||||
void Lexer::getDocComment(Token *t, unsigned lineComment)
|
||||
{
|
||||
OutBuffer buf;
|
||||
/* ct tells us which kind of comment it is: '/', '*', or '+'
|
||||
*/
|
||||
unsigned char ct = t->ptr[2];
|
||||
|
||||
/* Start of comment text skips over / * *, / + +, or / / /
|
||||
*/
|
||||
unsigned char *q = t->ptr + 3; // start of comment text
|
||||
int linestart = 0;
|
||||
|
||||
unsigned char *qend = p;
|
||||
if (ct == '*' || ct == '+')
|
||||
@@ -2684,6 +2687,12 @@ void Lexer::getDocComment(Token *t, unsigned lineComment)
|
||||
}
|
||||
}
|
||||
|
||||
/* Comment is now [q .. qend].
|
||||
* Canonicalize it into buf[].
|
||||
*/
|
||||
OutBuffer buf;
|
||||
int linestart = 0;
|
||||
|
||||
for (; q < qend; q++)
|
||||
{
|
||||
unsigned char c = *q;
|
||||
@@ -2760,11 +2769,14 @@ void Lexer::getDocComment(Token *t, unsigned lineComment)
|
||||
}
|
||||
|
||||
/********************************************
|
||||
* Combine two document comments into one.
|
||||
* Combine two document comments into one,
|
||||
* separated by a newline.
|
||||
*/
|
||||
|
||||
unsigned char *Lexer::combineComments(unsigned char *c1, unsigned char *c2)
|
||||
{
|
||||
//printf("Lexer::combineComments('%s', '%s')\n", c1, c2);
|
||||
|
||||
unsigned char *c = c2;
|
||||
|
||||
if (c1)
|
||||
@@ -2775,9 +2787,12 @@ unsigned char *Lexer::combineComments(unsigned char *c1, unsigned char *c2)
|
||||
|
||||
c = (unsigned char *)mem.malloc(len1 + 1 + len2 + 1);
|
||||
memcpy(c, c1, len1);
|
||||
c[len1] = '\n';
|
||||
memcpy(c + len1 + 1, c2, len2);
|
||||
c[len1 + 1 + len2] = 0;
|
||||
if (len1 && c1[len1 - 1] != '\n')
|
||||
{ c[len1] = '\n';
|
||||
len1++;
|
||||
}
|
||||
memcpy(c + len1, c2, len2);
|
||||
c[len1 + len2] = 0;
|
||||
}
|
||||
}
|
||||
return c;
|
||||
@@ -2912,7 +2927,6 @@ static Keyword keywords[] =
|
||||
{ "static", TOKstatic },
|
||||
{ "final", TOKfinal },
|
||||
{ "const", TOKconst },
|
||||
{ "immutable", TOKimmutable },
|
||||
{ "typedef", TOKtypedef },
|
||||
{ "alias", TOKalias },
|
||||
{ "override", TOKoverride },
|
||||
@@ -2952,6 +2966,7 @@ static Keyword keywords[] =
|
||||
{ "__FILE__", TOKfile },
|
||||
{ "__LINE__", TOKline },
|
||||
{ "shared", TOKshared },
|
||||
{ "immutable", TOKimmutable },
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,11 @@
|
||||
#include "mem.h"
|
||||
#include "lstring.h"
|
||||
|
||||
#ifdef _MSC_VER // prevent compiler internal crash
|
||||
Lstring Lstring::zero;
|
||||
#else
|
||||
Lstring Lstring::zero = LSTRING_EMPTY();
|
||||
#endif
|
||||
|
||||
Lstring *Lstring::ctor(const dchar *p, unsigned length)
|
||||
{
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#endif
|
||||
|
||||
#define BREAKABI 1 // 0 if not ready to break the ABI just yet
|
||||
#define STRUCTTHISREF V2 // if 'this' for struct is a reference, not a pointer
|
||||
|
||||
struct Array;
|
||||
|
||||
@@ -99,6 +100,7 @@ struct Param
|
||||
char novalidate;// no bitcode validation
|
||||
char Dversion; // D version number
|
||||
char ignoreUnsupportedPragmas; // rather than error on them
|
||||
char safe; // enforce safe memory model
|
||||
|
||||
char *argv0; // program name
|
||||
Array *imppath; // array of char*'s of where to look for import modules
|
||||
@@ -201,6 +203,12 @@ struct Global
|
||||
|
||||
extern Global global;
|
||||
|
||||
/* Set if Windows Structured Exception Handling C extensions are supported.
|
||||
* Apparently, VC has dropped support for these?
|
||||
*/
|
||||
#define WINDOWS_SEH _WIN32 && __DMC__
|
||||
|
||||
|
||||
#if __GNUC__
|
||||
//#define memicmp strncasecmp
|
||||
//#define stricmp strcasecmp
|
||||
|
||||
@@ -102,6 +102,7 @@ Module::Module(char *filename, Identifier *ident, int doDocComment, int doHdrGen
|
||||
|
||||
macrotable = NULL;
|
||||
escapetable = NULL;
|
||||
safe = FALSE;
|
||||
doppelganger = 0;
|
||||
cov = NULL;
|
||||
covb = NULL;
|
||||
@@ -590,6 +591,7 @@ void Module::parse()
|
||||
|
||||
if (md)
|
||||
{ this->ident = md->id;
|
||||
this->safe = md->safe;
|
||||
dst = Package::resolve(md->packages, &this->parent, NULL);
|
||||
}
|
||||
else
|
||||
@@ -890,10 +892,11 @@ void Module::runDeferredSemantic()
|
||||
|
||||
/* =========================== ModuleDeclaration ===================== */
|
||||
|
||||
ModuleDeclaration::ModuleDeclaration(Array *packages, Identifier *id)
|
||||
ModuleDeclaration::ModuleDeclaration(Array *packages, Identifier *id, bool safe)
|
||||
{
|
||||
this->packages = packages;
|
||||
this->id = id;
|
||||
this->safe = safe;
|
||||
}
|
||||
|
||||
char *ModuleDeclaration::toChars()
|
||||
|
||||
@@ -113,6 +113,8 @@ struct Module : Package
|
||||
int doDocComment; // enable generating doc comments for this module
|
||||
int doHdrGen; // enable generating header file for this module
|
||||
|
||||
bool safe;
|
||||
|
||||
Module(char *arg, Identifier *ident, int doDocComment, int doHdrGen);
|
||||
~Module();
|
||||
|
||||
@@ -185,8 +187,9 @@ struct ModuleDeclaration
|
||||
{
|
||||
Identifier *id;
|
||||
Array *packages; // array of Identifier's representing packages
|
||||
bool safe;
|
||||
|
||||
ModuleDeclaration(Array *packages, Identifier *id);
|
||||
ModuleDeclaration(Array *packages, Identifier *id, bool safe);
|
||||
|
||||
char *toChars();
|
||||
};
|
||||
|
||||
55
dmd2/mtype.c
55
dmd2/mtype.c
@@ -2802,7 +2802,7 @@ Expression *TypeAArray::defaultInit(Loc loc)
|
||||
|
||||
int TypeAArray::isZeroInit()
|
||||
{
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int TypeAArray::checkBoolean()
|
||||
@@ -3145,7 +3145,10 @@ int Type::covariant(Type *t)
|
||||
|
||||
if (!arg1->type->equals(arg2->type))
|
||||
goto Ldistinct;
|
||||
if (arg1->storageClass != arg2->storageClass)
|
||||
if ((arg1->storageClass & ~STCscope) != (arg2->storageClass & ~STCscope))
|
||||
inoutmismatch = 1;
|
||||
// We can add scope, but not subtract it
|
||||
if (!(arg1->storageClass & STCscope) && (arg2->storageClass & STCscope))
|
||||
inoutmismatch = 1;
|
||||
}
|
||||
}
|
||||
@@ -3650,6 +3653,41 @@ Type *TypeFunction::reliesOnTident()
|
||||
return next->reliesOnTident();
|
||||
}
|
||||
|
||||
/***************************
|
||||
* Examine function signature for parameter p and see if
|
||||
* p can 'escape' the scope of the function.
|
||||
*/
|
||||
|
||||
bool TypeFunction::parameterEscapes(Argument *p)
|
||||
{
|
||||
|
||||
/* Scope parameters do not escape.
|
||||
* Allow 'lazy' to imply 'scope' -
|
||||
* lazy parameters can be passed along
|
||||
* as lazy parameters to the next function, but that isn't
|
||||
* escaping.
|
||||
*/
|
||||
if (p->storageClass & (STCscope | STClazy))
|
||||
return FALSE;
|
||||
|
||||
if (ispure)
|
||||
{ /* With pure functions, we need only be concerned if p escapes
|
||||
* via any return statement.
|
||||
*/
|
||||
Type* tret = nextOf()->toBasetype();
|
||||
if (!isref && !tret->hasPointers())
|
||||
{ /* The result has no references, so p could not be escaping
|
||||
* that way.
|
||||
*/
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Assume it escapes in the absence of better information.
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***************************** TypeDelegate *****************************/
|
||||
|
||||
TypeDelegate::TypeDelegate(Type *t)
|
||||
@@ -4598,6 +4636,12 @@ Expression *TypeEnum::getProperty(Loc loc, Identifier *ident)
|
||||
{
|
||||
e = defaultInit(loc);
|
||||
}
|
||||
else if (ident == Id::stringof)
|
||||
{ char *s = toChars();
|
||||
e = new StringExp(loc, s, strlen(s), 'c');
|
||||
Scope sc;
|
||||
e = e->semantic(&sc);
|
||||
}
|
||||
else
|
||||
{
|
||||
e = toBasetype()->getProperty(loc, ident);
|
||||
@@ -6192,10 +6236,15 @@ void Argument::argsToCBuffer(OutBuffer *buf, HdrGenState *hgs, Arguments *argume
|
||||
else if (arg->storageClass & STCauto)
|
||||
buf->writestring("auto ");
|
||||
|
||||
if (arg->storageClass & STCscope)
|
||||
buf->writestring("scope ");
|
||||
|
||||
if (arg->storageClass & STCconst)
|
||||
buf->writestring("const ");
|
||||
if (arg->storageClass & STCinvariant)
|
||||
buf->writestring("invariant ");
|
||||
if (arg->storageClass & STCshared)
|
||||
buf->writestring("shared ");
|
||||
|
||||
argbuf.reset();
|
||||
if (arg->storageClass & STCalias)
|
||||
@@ -6292,6 +6341,8 @@ Type *Argument::isLazyArray()
|
||||
|
||||
void Argument::toDecoBuffer(OutBuffer *buf)
|
||||
{
|
||||
if (storageClass & STCscope)
|
||||
buf->writeByte('M');
|
||||
switch (storageClass & (STCin | STCout | STCref | STClazy))
|
||||
{ case 0:
|
||||
case STCin:
|
||||
|
||||
@@ -40,6 +40,7 @@ enum LINK;
|
||||
|
||||
struct TypeBasic;
|
||||
struct HdrGenState;
|
||||
struct Argument;
|
||||
|
||||
// Back end
|
||||
#if IN_GCC
|
||||
@@ -227,9 +228,10 @@ struct Type : Object
|
||||
virtual int isAssignable();
|
||||
virtual int checkBoolean(); // if can be converted to boolean value
|
||||
virtual void checkDeprecated(Loc loc, Scope *sc);
|
||||
int isConst() { return mod == MODconst; }
|
||||
int isInvariant() { return mod == MODinvariant; }
|
||||
int isMutable() { return mod == 0; }
|
||||
int isConst() { return mod & MODconst; }
|
||||
int isInvariant() { return mod & MODinvariant; }
|
||||
int isMutable() { return !(mod & (MODconst | MODinvariant)); }
|
||||
int isShared() { return mod & MODshared; }
|
||||
Type *constOf();
|
||||
Type *invariantOf();
|
||||
Type *mutableOf();
|
||||
@@ -490,6 +492,7 @@ struct TypeFunction : TypeNext
|
||||
#if TARGET_LINUX
|
||||
void toCppMangle(OutBuffer *buf, CppMangleState *cms);
|
||||
#endif
|
||||
bool parameterEscapes(Argument *p);
|
||||
|
||||
int callMatch(Expression *ethis, Expressions *toargs);
|
||||
type *toCtype();
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#if _MSC_VER
|
||||
#include <complex>
|
||||
#else
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define integer_t dmd_integer_t
|
||||
@@ -548,22 +551,25 @@ void inferApplyArgTypes(enum TOK op, Arguments *arguments, Expression *aggr)
|
||||
goto Laggr;
|
||||
|
||||
Laggr:
|
||||
#if 0
|
||||
if (arguments->dim == 1)
|
||||
{
|
||||
if (!arg->type)
|
||||
{
|
||||
/* Look for an opNext() overload
|
||||
/* Look for a head() or rear() overload
|
||||
*/
|
||||
Dsymbol *s = search_function(ad, Id::next);
|
||||
fd = s ? s->isFuncDeclaration() : NULL;
|
||||
Identifier *id = (op == TOKforeach) ? Id::Fhead : Id::Ftoe;
|
||||
Dsymbol *s = search_function(ad, id);
|
||||
FuncDeclaration *fd = s ? s->isFuncDeclaration() : NULL;
|
||||
if (!fd)
|
||||
{ if (s && s->isTemplateDeclaration())
|
||||
break;
|
||||
goto Lapply;
|
||||
arg->type = fd->type->next;
|
||||
}
|
||||
arg->type = fd->type->nextOf();
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
Lapply:
|
||||
{ /* Look for an
|
||||
* int opApply(int delegate(ref Type [, ...]) dg);
|
||||
|
||||
26
dmd2/parse.c
26
dmd2/parse.c
@@ -70,8 +70,26 @@ Array *Parser::parseModule()
|
||||
if (token.value == TOKmodule)
|
||||
{
|
||||
unsigned char *comment = token.blockComment;
|
||||
bool safe = FALSE;
|
||||
|
||||
nextToken();
|
||||
if (token.value == TOKlparen)
|
||||
{
|
||||
nextToken();
|
||||
if (token.value != TOKidentifier)
|
||||
{ error("module (safe) identifier expected");
|
||||
goto Lerr;
|
||||
}
|
||||
Identifier *id = token.ident;
|
||||
|
||||
if (id == Id::system)
|
||||
safe = TRUE;
|
||||
else
|
||||
error("(safe) expected, not %s", id->toChars());
|
||||
nextToken();
|
||||
check(TOKrparen);
|
||||
}
|
||||
|
||||
if (token.value != TOKidentifier)
|
||||
{ error("Identifier expected following module");
|
||||
goto Lerr;
|
||||
@@ -95,7 +113,7 @@ Array *Parser::parseModule()
|
||||
id = token.ident;
|
||||
}
|
||||
|
||||
md = new ModuleDeclaration(a, id);
|
||||
md = new ModuleDeclaration(a, id, safe);
|
||||
|
||||
if (token.value != TOKsemicolon)
|
||||
error("';' expected following module declaration instead of %s", token.toChars());
|
||||
@@ -445,7 +463,7 @@ Array *Parser::parseDeclDefs(int once)
|
||||
}
|
||||
ident = token.ident;
|
||||
nextToken();
|
||||
if (token.value == TOKcomma)
|
||||
if (token.value == TOKcomma && peekNext() != TOKrparen)
|
||||
args = parseArguments(); // pragma(identifier, args...)
|
||||
else
|
||||
check(TOKrparen); // pragma(identifier)
|
||||
@@ -3429,7 +3447,7 @@ Statement *Parser::parseStatement(int flags)
|
||||
}
|
||||
ident = token.ident;
|
||||
nextToken();
|
||||
if (token.value == TOKcomma)
|
||||
if (token.value == TOKcomma && peekNext() != TOKrparen)
|
||||
args = parseArguments(); // pragma(identifier, args...);
|
||||
else
|
||||
check(TOKrparen); // pragma(identifier);
|
||||
@@ -5557,7 +5575,7 @@ Expression *Parser::parseExpression()
|
||||
|
||||
/*************************
|
||||
* Collect argument list.
|
||||
* Assume current token is '(' or '['.
|
||||
* Assume current token is ',', '(' or '['.
|
||||
*/
|
||||
|
||||
Expressions *Parser::parseArguments()
|
||||
|
||||
60
dmd2/root.c
60
dmd2/root.c
@@ -16,6 +16,7 @@
|
||||
|
||||
#if _MSC_VER ||__MINGW32__
|
||||
#include <malloc.h>
|
||||
#include <string>
|
||||
#endif
|
||||
|
||||
#if _WIN32
|
||||
@@ -47,6 +48,7 @@ extern "C" void __cdecl _assert(void *e, void *f, unsigned line)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************
|
||||
* Convert wchar string to ascii string.
|
||||
*/
|
||||
@@ -1606,6 +1608,36 @@ void OutBuffer::align(unsigned size)
|
||||
fill0(nbytes);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// The compiler shipped with Visual Studio 2005 (and possible
|
||||
// other versions) does not support C99 printf format specfiers
|
||||
// such as %z and %j
|
||||
#if _MSC_VER
|
||||
using std::string;
|
||||
using std::wstring;
|
||||
|
||||
template<typename S>
|
||||
inline void
|
||||
search_and_replace(S& str, const S& what, const S& replacement)
|
||||
{
|
||||
assert(!what.empty());
|
||||
size_t pos = str.find(what);
|
||||
while (pos != S::npos)
|
||||
{
|
||||
str.replace(pos, what.size(), replacement);
|
||||
pos = str.find(what, pos + replacement.size());
|
||||
}
|
||||
}
|
||||
#define WORKAROUND_C99_SPECIFIERS_BUG(S,tmp,f) \
|
||||
S tmp = f; \
|
||||
search_and_replace(fmt, S("%z"), S("%l")); \
|
||||
search_and_replace(fmt, S("%j"), S("%i")); \
|
||||
f = tmp.c_str();
|
||||
#else
|
||||
#define WORKAROUND_C99_SPECIFIERS_BUG(S,tmp,f)
|
||||
#endif
|
||||
|
||||
void OutBuffer::vprintf(const char *format, va_list args)
|
||||
{
|
||||
char buffer[128];
|
||||
@@ -1613,10 +1645,7 @@ void OutBuffer::vprintf(const char *format, va_list args)
|
||||
unsigned psize;
|
||||
int count;
|
||||
|
||||
// On some platforms (i.e. x86_64) va_list is an array and thus passed by
|
||||
// reference. Copy the input list so we can copy it back before retrying.
|
||||
va_list orig_args;
|
||||
va_copy(orig_args, args);
|
||||
WORKAROUND_C99_SPECIFIERS_BUG(string, fmt, format);
|
||||
|
||||
p = buffer;
|
||||
psize = sizeof(buffer);
|
||||
@@ -1628,7 +1657,19 @@ void OutBuffer::vprintf(const char *format, va_list args)
|
||||
break;
|
||||
psize *= 2;
|
||||
#elif POSIX
|
||||
count = vsnprintf(p,psize,format,args);
|
||||
va_list va;
|
||||
va_copy(va, args);
|
||||
/*
|
||||
The functions vprintf(), vfprintf(), vsprintf(), vsnprintf()
|
||||
are equivalent to the functions printf(), fprintf(), sprintf(),
|
||||
snprintf(), respectively, except that they are called with a
|
||||
va_list instead of a variable number of arguments. These
|
||||
functions do not call the va_end macro. Consequently, the value
|
||||
of ap is undefined after the call. The application should call
|
||||
va_end(ap) itself afterwards.
|
||||
*/
|
||||
count = vsnprintf(p,psize,format,va);
|
||||
va_end(va);
|
||||
if (count == -1)
|
||||
psize *= 2;
|
||||
else if (count >= psize)
|
||||
@@ -1636,7 +1677,6 @@ void OutBuffer::vprintf(const char *format, va_list args)
|
||||
else
|
||||
break;
|
||||
#endif
|
||||
va_copy(args, orig_args);
|
||||
p = (char *) alloca(psize); // buffer too small, try again with larger size
|
||||
}
|
||||
write(p,count);
|
||||
@@ -1650,6 +1690,8 @@ void OutBuffer::vprintf(const wchar_t *format, va_list args)
|
||||
unsigned psize;
|
||||
int count;
|
||||
|
||||
WORKAROUND_C99_SPECIFIERS_BUG(wstring, fmt, format);
|
||||
|
||||
p = buffer;
|
||||
psize = sizeof(buffer) / sizeof(buffer[0]);
|
||||
for (;;)
|
||||
@@ -1661,7 +1703,11 @@ void OutBuffer::vprintf(const wchar_t *format, va_list args)
|
||||
psize *= 2;
|
||||
#endif
|
||||
#if POSIX
|
||||
count = vsnwprintf(p,psize,format,args);
|
||||
va_list va;
|
||||
va_copy(va, args);
|
||||
count = vsnwprintf(p,psize,format,va);
|
||||
va_end(va);
|
||||
|
||||
if (count == -1)
|
||||
psize *= 2;
|
||||
else if (count >= psize)
|
||||
|
||||
@@ -37,6 +37,12 @@ void warning(const char *format, ...);
|
||||
#define TYPEDEFS
|
||||
|
||||
#if _MSC_VER
|
||||
#include <malloc.h> // for alloca
|
||||
// According to VC 8.0 docs, long double is the same as double
|
||||
#define strtold strtod
|
||||
#define strtof strtod
|
||||
#define isnan _isnan
|
||||
|
||||
typedef __int64 longlong;
|
||||
typedef unsigned __int64 ulonglong;
|
||||
#else
|
||||
|
||||
@@ -31,8 +31,13 @@ struct FuncDeclaration;
|
||||
struct DocComment;
|
||||
struct EnclosingHandler;
|
||||
struct AnonDeclaration;
|
||||
#if __GNUC__
|
||||
#include "dsymbol.h" // PROT
|
||||
#include "mars.h" // LINK
|
||||
#else
|
||||
enum LINK;
|
||||
enum PROT;
|
||||
#endif
|
||||
|
||||
struct Scope
|
||||
{
|
||||
|
||||
120
dmd2/statement.c
120
dmd2/statement.c
@@ -1116,7 +1116,9 @@ Statement *ForStatement::semantic(Scope *sc)
|
||||
condition = condition->checkToBoolean();
|
||||
}
|
||||
if (increment)
|
||||
increment = increment->semantic(sc);
|
||||
{ increment = increment->semantic(sc);
|
||||
increment = resolveProperties(sc, increment);
|
||||
}
|
||||
|
||||
sc->sbreak = this;
|
||||
sc->scontinue = this;
|
||||
@@ -1261,8 +1263,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
//printf("ForeachStatement::semantic() %p\n", this);
|
||||
ScopeDsymbol *sym;
|
||||
Statement *s = this;
|
||||
int dim = arguments->dim;
|
||||
int i;
|
||||
size_t dim = arguments->dim;
|
||||
TypeAArray *taa = NULL;
|
||||
|
||||
Type *tn = NULL;
|
||||
@@ -1391,15 +1392,6 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
return s;
|
||||
}
|
||||
|
||||
for (i = 0; i < dim; i++)
|
||||
{ Argument *arg = (Argument *)arguments->data[i];
|
||||
if (!arg->type)
|
||||
{
|
||||
error("cannot infer type for %s", arg->ident->toChars());
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
sym = new ScopeDsymbol();
|
||||
sym->parent = sc->scopesym;
|
||||
sc = sc->push(sym);
|
||||
@@ -1410,6 +1402,9 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
{
|
||||
case Tarray:
|
||||
case Tsarray:
|
||||
if (!checkForArgTypes())
|
||||
return this;
|
||||
|
||||
if (dim < 1 || dim > 2)
|
||||
{
|
||||
error("only one or two arguments for array foreach");
|
||||
@@ -1423,7 +1418,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
if (tn->ty == Tchar || tn->ty == Twchar || tn->ty == Tdchar)
|
||||
{ Argument *arg;
|
||||
|
||||
i = (dim == 1) ? 0 : 1; // index of value
|
||||
int i = (dim == 1) ? 0 : 1; // index of value
|
||||
arg = (Argument *)arguments->data[i];
|
||||
arg->type = arg->type->semantic(loc, sc);
|
||||
tnv = arg->type->toBasetype();
|
||||
@@ -1441,7 +1436,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < dim; i++)
|
||||
for (size_t i = 0; i < dim; i++)
|
||||
{ // Declare args
|
||||
Argument *arg = (Argument *)arguments->data[i];
|
||||
VarDeclaration *var;
|
||||
@@ -1506,6 +1501,9 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
break;
|
||||
|
||||
case Taarray:
|
||||
if (!checkForArgTypes())
|
||||
return this;
|
||||
|
||||
taa = (TypeAArray *)tab;
|
||||
if (dim < 1 || dim > 2)
|
||||
{
|
||||
@@ -1520,6 +1518,72 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
|
||||
case Tclass:
|
||||
case Tstruct:
|
||||
#if DMDV2
|
||||
{ /* Look for range iteration, i.e. the properties
|
||||
* .empty, .next, .retreat, .head and .rear
|
||||
* foreach (e; range) { ... }
|
||||
* translates to:
|
||||
* for (auto __r = range; !__r.empty; __r.next)
|
||||
* { auto e = __r.head;
|
||||
* ...
|
||||
* }
|
||||
*/
|
||||
if (dim != 1) // only one argument allowed with ranges
|
||||
goto Lapply;
|
||||
AggregateDeclaration *ad = (tab->ty == Tclass)
|
||||
? (AggregateDeclaration *)((TypeClass *)tab)->sym
|
||||
: (AggregateDeclaration *)((TypeStruct *)tab)->sym;
|
||||
Identifier *idhead;
|
||||
Identifier *idnext;
|
||||
if (op == TOKforeach)
|
||||
{ idhead = Id::Fhead;
|
||||
idnext = Id::Fnext;
|
||||
}
|
||||
else
|
||||
{ idhead = Id::Ftoe;
|
||||
idnext = Id::Fretreat;
|
||||
}
|
||||
Dsymbol *shead = search_function(ad, idhead);
|
||||
if (!shead)
|
||||
goto Lapply;
|
||||
|
||||
/* Generate a temporary __r and initialize it with the aggregate.
|
||||
*/
|
||||
Identifier *id = Identifier::generateId("__r");
|
||||
VarDeclaration *r = new VarDeclaration(loc, NULL, id, new ExpInitializer(loc, aggr));
|
||||
r->semantic(sc);
|
||||
Statement *init = new DeclarationStatement(loc, r);
|
||||
|
||||
// !__r.empty
|
||||
Expression *e = new VarExp(loc, r);
|
||||
e = new DotIdExp(loc, e, Id::Fempty);
|
||||
Expression *condition = new NotExp(loc, e);
|
||||
|
||||
// __r.next
|
||||
e = new VarExp(loc, r);
|
||||
Expression *increment = new DotIdExp(loc, e, idnext);
|
||||
|
||||
/* Declaration statement for e:
|
||||
* auto e = __r.idhead;
|
||||
*/
|
||||
e = new VarExp(loc, r);
|
||||
Expression *einit = new DotIdExp(loc, e, idhead);
|
||||
einit = einit->semantic(sc);
|
||||
Argument *arg = (Argument *)arguments->data[0];
|
||||
VarDeclaration *ve = new VarDeclaration(loc, arg->type, arg->ident, new ExpInitializer(loc, einit));
|
||||
ve->storage_class |= STCforeach;
|
||||
ve->storage_class |= arg->storageClass & (STCin | STCout | STCref | STCconst | STCinvariant);
|
||||
|
||||
DeclarationExp *de = new DeclarationExp(loc, ve);
|
||||
|
||||
Statement *body = new CompoundStatement(loc,
|
||||
new DeclarationStatement(loc, de), this->body);
|
||||
|
||||
s = new ForStatement(loc, init, condition, increment, body);
|
||||
s = s->semantic(sc);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case Tdelegate:
|
||||
Lapply:
|
||||
{ FuncDeclaration *fdapply;
|
||||
@@ -1536,6 +1600,9 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
TypeDelegate* dgty2;
|
||||
TypeDelegate* fldeTy;
|
||||
|
||||
if (!checkForArgTypes())
|
||||
return this;
|
||||
|
||||
tret = func->type->nextOf();
|
||||
|
||||
// Need a variable to hold value from any return statements in body.
|
||||
@@ -1555,7 +1622,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
* int delegate(ref T arg) { body }
|
||||
*/
|
||||
args = new Arguments();
|
||||
for (i = 0; i < dim; i++)
|
||||
for (size_t i = 0; i < dim; i++)
|
||||
{ Argument *arg = (Argument *)arguments->data[i];
|
||||
|
||||
arg->type = arg->type->semantic(loc, sc);
|
||||
@@ -1815,6 +1882,19 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
return s;
|
||||
}
|
||||
|
||||
bool ForeachStatement::checkForArgTypes()
|
||||
{
|
||||
for (size_t i = 0; i < arguments->dim; i++)
|
||||
{ Argument *arg = (Argument *)arguments->data[i];
|
||||
if (!arg->type)
|
||||
{
|
||||
error("cannot infer type for %s", arg->ident->toChars());
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int ForeachStatement::hasBreak()
|
||||
{
|
||||
return TRUE;
|
||||
@@ -1888,6 +1968,8 @@ void ForeachStatement::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
|
||||
|
||||
/**************************** ForeachRangeStatement ***************************/
|
||||
|
||||
#if DMDV2
|
||||
|
||||
ForeachRangeStatement::ForeachRangeStatement(Loc loc, enum TOK op, Argument *arg,
|
||||
Expression *lwr, Expression *upr, Statement *body)
|
||||
: Statement(loc)
|
||||
@@ -2047,6 +2129,8 @@ void ForeachRangeStatement::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
|
||||
buf->writenl();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/******************************** IfStatement ***************************/
|
||||
|
||||
IfStatement::IfStatement(Loc loc, Argument *arg, Expression *condition, Statement *ifbody, Statement *elsebody)
|
||||
@@ -2339,6 +2423,11 @@ Statement *PragmaStatement::semantic(Scope *sc)
|
||||
}
|
||||
else if (ident == Id::lib)
|
||||
{
|
||||
#if 1
|
||||
/* Should this be allowed?
|
||||
*/
|
||||
error("pragma(lib) not allowed as statement");
|
||||
#else
|
||||
if (!args || args->dim != 1)
|
||||
error("string expected for library name");
|
||||
else
|
||||
@@ -2360,6 +2449,7 @@ Statement *PragmaStatement::semantic(Scope *sc)
|
||||
mem.free(name);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (ident == Id::startaddress)
|
||||
{
|
||||
|
||||
@@ -380,6 +380,7 @@ struct ForeachStatement : Statement
|
||||
ForeachStatement(Loc loc, enum TOK op, Arguments *arguments, Expression *aggr, Statement *body);
|
||||
Statement *syntaxCopy();
|
||||
Statement *semantic(Scope *sc);
|
||||
bool checkForArgTypes();
|
||||
int hasBreak();
|
||||
int hasContinue();
|
||||
int usesEH();
|
||||
|
||||
@@ -264,7 +264,11 @@ void StructDeclaration::semantic(Scope *sc)
|
||||
}
|
||||
|
||||
parent = sc->parent;
|
||||
#if STRUCTTHISREF
|
||||
handle = type;
|
||||
#else
|
||||
handle = type->pointerTo();
|
||||
#endif
|
||||
structalign = sc->structalign;
|
||||
protection = sc->protection;
|
||||
storage_class |= sc->stc;
|
||||
|
||||
@@ -14,12 +14,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
#if !IN_LLVM
|
||||
#if _WIN32
|
||||
#include <windows.h>
|
||||
long __cdecl __ehfilter(LPEXCEPTION_POINTERS ep);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "root.h"
|
||||
#include "mem.h"
|
||||
#include "stringtable.h"
|
||||
@@ -36,8 +31,14 @@ long __cdecl __ehfilter(LPEXCEPTION_POINTERS ep);
|
||||
#include "dsymbol.h"
|
||||
#include "hdrgen.h"
|
||||
|
||||
#if WINDOWS_SEH
|
||||
#include <windows.h>
|
||||
long __cdecl __ehfilter(LPEXCEPTION_POINTERS ep);
|
||||
#endif
|
||||
|
||||
#define LOG 0
|
||||
|
||||
|
||||
/********************************************
|
||||
* These functions substitute for dynamic_cast. dynamic_cast does not work
|
||||
* on earlier versions of gcc.
|
||||
@@ -3311,7 +3312,7 @@ void TemplateInstance::semantic(Scope *sc)
|
||||
sc2->tinst = this;
|
||||
|
||||
#if !IN_LLVM
|
||||
#if _WIN32
|
||||
#if WINDOWS_SEH
|
||||
__try
|
||||
{
|
||||
#endif
|
||||
@@ -3329,7 +3330,7 @@ void TemplateInstance::semantic(Scope *sc)
|
||||
sc2->module->runDeferredSemantic();
|
||||
}
|
||||
#if !IN_LLVM
|
||||
#if _WIN32
|
||||
#if WINDOWS_SEH
|
||||
}
|
||||
__except (__ehfilter(GetExceptionInformation()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user