Mercurial > projects > ldc
comparison dmd/template.c @ 285:297690b5d4a5 trunk
[svn r306] Fixed: it's now possible to compile and link llvmdc with MinGW32 and msys on Win32 :D I tried it myself ;) Building the runtime still needs some work, but it's a step in the right direction.
author | lindquist |
---|---|
date | Sat, 21 Jun 2008 03:14:49 +0200 |
parents | 5acec6b2eef8 |
children | 2b72433d5c8c |
comparison
equal
deleted
inserted
replaced
284:70c370e97944 | 285:297690b5d4a5 |
---|---|
11 // Handle template implementation | 11 // Handle template implementation |
12 | 12 |
13 #include <stdio.h> | 13 #include <stdio.h> |
14 #include <assert.h> | 14 #include <assert.h> |
15 | 15 |
16 #if !IN_LLVM | |
16 #if _WIN32 | 17 #if _WIN32 |
17 #include <windows.h> | 18 #include <windows.h> |
18 long __cdecl __ehfilter(LPEXCEPTION_POINTERS ep); | 19 long __cdecl __ehfilter(LPEXCEPTION_POINTERS ep); |
19 #endif | 20 #endif |
21 #endif | |
20 | 22 |
21 #include "root.h" | 23 #include "root.h" |
22 #include "mem.h" | 24 #include "mem.h" |
23 #include "stringtable.h" | 25 #include "stringtable.h" |
24 | 26 #include "mars.h" |
27 #include "identifier.h" | |
25 #include "mtype.h" | 28 #include "mtype.h" |
26 #include "template.h" | 29 #include "template.h" |
27 #include "init.h" | 30 #include "init.h" |
28 #include "expression.h" | 31 #include "expression.h" |
29 #include "scope.h" | 32 #include "scope.h" |
30 #include "module.h" | 33 #include "module.h" |
31 #include "aggregate.h" | 34 #include "aggregate.h" |
32 #include "declaration.h" | 35 #include "declaration.h" |
33 #include "dsymbol.h" | 36 #include "dsymbol.h" |
34 #include "mars.h" | |
35 #include "dsymbol.h" | |
36 #include "identifier.h" | |
37 #include "hdrgen.h" | 37 #include "hdrgen.h" |
38 | 38 |
39 #define LOG 0 | 39 #define LOG 0 |
40 | 40 |
41 /******************************************** | 41 /******************************************** |
2942 Scope *sc2; | 2942 Scope *sc2; |
2943 sc2 = scope->push(this); | 2943 sc2 = scope->push(this); |
2944 //printf("isnested = %d, sc->parent = %s\n", isnested, sc->parent->toChars()); | 2944 //printf("isnested = %d, sc->parent = %s\n", isnested, sc->parent->toChars()); |
2945 sc2->parent = /*isnested ? sc->parent :*/ this; | 2945 sc2->parent = /*isnested ? sc->parent :*/ this; |
2946 | 2946 |
2947 #if !IN_LLVM | |
2947 #if _WIN32 | 2948 #if _WIN32 |
2948 __try | 2949 __try |
2949 { | 2950 { |
2951 #endif | |
2950 #endif | 2952 #endif |
2951 for (int i = 0; i < members->dim; i++) | 2953 for (int i = 0; i < members->dim; i++) |
2952 { | 2954 { |
2953 Dsymbol *s = (Dsymbol *)members->data[i]; | 2955 Dsymbol *s = (Dsymbol *)members->data[i]; |
2954 //printf("\t[%d] semantic on '%s' %p kind %s in '%s'\n", i, s->toChars(), s, s->kind(), this->toChars()); | 2956 //printf("\t[%d] semantic on '%s' %p kind %s in '%s'\n", i, s->toChars(), s, s->kind(), this->toChars()); |
2958 //printf("test3: isnested = %d, s->parent = %s\n", isnested, s->parent->toChars()); | 2960 //printf("test3: isnested = %d, s->parent = %s\n", isnested, s->parent->toChars()); |
2959 s->semantic(sc2); | 2961 s->semantic(sc2); |
2960 //printf("test4: isnested = %d, s->parent = %s\n", isnested, s->parent->toChars()); | 2962 //printf("test4: isnested = %d, s->parent = %s\n", isnested, s->parent->toChars()); |
2961 sc2->module->runDeferredSemantic(); | 2963 sc2->module->runDeferredSemantic(); |
2962 } | 2964 } |
2965 #if !IN_LLVM | |
2963 #if _WIN32 | 2966 #if _WIN32 |
2964 } | 2967 } |
2965 __except (__ehfilter(GetExceptionInformation())) | 2968 __except (__ehfilter(GetExceptionInformation())) |
2966 { | 2969 { |
2967 global.gag = 0; // ensure error message gets printed | 2970 global.gag = 0; // ensure error message gets printed |
2968 error("recursive expansion"); | 2971 error("recursive expansion"); |
2969 fatal(); | 2972 fatal(); |
2970 } | 2973 } |
2974 #endif | |
2971 #endif | 2975 #endif |
2972 | 2976 |
2973 /* If any of the instantiation members didn't get semantic() run | 2977 /* If any of the instantiation members didn't get semantic() run |
2974 * on them due to forward references, we cannot run semantic2() | 2978 * on them due to forward references, we cannot run semantic2() |
2975 * or semantic3() yet. | 2979 * or semantic3() yet. |