Commits

Iain Buclaw committed 0066ecf

Remove d-misc.c, fixed code that depended on it.

Comments (0)

Files changed (12)

 d/d-gt.cglue.o: d/d-gt.c $(D_TREE_H)
 d/d-builtins.cglue.o: d/d-builtins.c $(D_TREE_H) $(D_BI_ATTRS)
 d/d-builtins2.glue.o: d/d-builtins.c $(D_TREE_H)
-d/d-misc.cglue.o: d/d-misc.c $(D_TREE_H)
+d/d-incpath.glue.o: d/d-incpath.cc $(D_TREE_H) d/d-confdefs.h
 d/todt.dmd.o: $(D_DMD_H)
 d/toobj.dmd.o: $(D_DMD_H)
 d/typinf.dmd.o: $(D_DMD_H)
 #error "Version of GCC is not supported."
 #endif
 
-/* Nonzero if preprocessing only.  */
-int flag_preprocess_only;
-
-/* Nonzero if an ISO standard was selected.  It rejects macros in the
-   user's namespace.  */
-int flag_iso;
-
-/* Nonzero means enable C89 Amendment 1 features.  */
-int flag_isoc94;
-
-/* Nonzero means use the ISO C99 dialect of C.  */
-int flag_isoc99;
-
-
 /* Used to help initialize the builtin-types.def table.  When a type of
    the correct size doesn't exist, use error_mark_node instead of NULL.
    The later results in segfaults even when a decl using the type doesn't
 {
     Dsymbol * p = d->toParent2();
     const char * out_name = asm_name;
-    char * alloc_name = 0;
+    char * alloc_name;
 
     FuncDeclaration * f = d->isFuncDeclaration();
     VarDeclaration * v = d->isVarDeclaration();
         sv = uniqueNames->update(asm_name, strlen(asm_name));
 
         if (sv->intvalue)
-            out_name = alloc_name = d_asm_format_private_name(asm_name, sv->intvalue);
+        {
+            ASM_FORMAT_PRIVATE_NAME(alloc_name, asm_name, sv->intvalue);
+            out_name = alloc_name;
+        }
         sv->intvalue++;
     }
 
     }
 
     SET_DECL_ASSEMBLER_NAME(t, id);
-
-    if (alloc_name)
-        free(alloc_name);
 }
 
 
 
     if (! thunk->symbol)
     {
-        char *id;
-
-        // dmd uses 'sym' -- not sure what that is...
-        id = (char *) alloca(8 + 5 + strlen(csym->Sident) + 1);
-        sprintf(id,"__t%"PRIdTSIZE"_%s", offset, csym->Sident);
+        char * id;
+        static unsigned thunk_sym_label = 0;
+        ASM_FORMAT_PRIVATE_NAME(id, "___t", thunk_sym_label);
+        thunk_sym_label++;
         sthunk = symbol_calloc(id);
         slist_add(sthunk);
-        /* todo: could use anonymous names like DMD, with ASM_FORMAT_RRIVATE_NAME*/
-        //sthunk = symbol_generate(SCstatic, csym->Stype);
-        //sthunk->Sflags |= SFLimplem;
 
         tree target_func_decl = csym->Stree;
         tree thunk_decl = build_fn_decl(id, TREE_TYPE(target_func_decl));
     return s;
 }
 
-/**************************************
- * Fake a struct symbol.
- */
-
-// Not used in GCC
-/*
-Classsym *fake_classsym(char * name)
-{
-    return 0;
-}
-*/
 
 /*************************************
  * Create the "ClassInfo" symbol
 extern tree d_builtin_function43 PARAMS ((tree));
 extern void d_register_builtin_type PARAMS((tree, const char *));
 
-/* In d-misc.c */
-extern int d_using_sjlj_exceptions PARAMS ((void));
-extern char * d_asm_format_private_name PARAMS ((const char *,int));
-
 /* In d-builtins2.cc */
 extern void d_bi_init PARAMS ((void));
 extern void d_bi_builtin_func PARAMS ((tree));
 ////tree d_unsigned_type(tree);
 ////tree d_signed_type(tree);
 
-/*
-class DGCCMain {
-    bool stdInc;
-
-    initOptions() { }
-};
-*/
 
 static const char * fonly_arg;
 // Because of PR16888, on x86 platforms, GCC clears unused reg names.
     else
         VersionCondition::addPredefinedGlobalIdent("LittleEndian");
 
-    if (d_using_sjlj_exceptions()) {
+    if (USING_SJLJ_EXCEPTIONS)
         VersionCondition::addPredefinedGlobalIdent("GNU_SjLj_Exceptions");
-    }
+
 #ifdef TARGET_LONG_DOUBLE_128
     if (TARGET_LONG_DOUBLE_128)
         VersionCondition::addPredefinedGlobalIdent("GNU_LongDouble128");
     if (!d_eh_personality_decl)
     {
        d_eh_personality_decl
-           = build_personality_function (d_using_sjlj_exceptions()
+           = build_personality_function (USING_SJLJ_EXCEPTIONS
                                          ? "__gdc_personality_sj0"
                                          : "__gdc_personality_v0");
     }
 #if D_GCC_VER >= 45
     // Handled with langhooks eh_personality and eh_runtime_type
 #else
-    eh_personality_libfunc = init_one_libfunc(d_using_sjlj_exceptions()
+    eh_personality_libfunc = init_one_libfunc(USING_SJLJ_EXCEPTIONS
             ? "__gdc_personality_sj0" : "__gdc_personality_v0");
     default_init_unwind_resume_libfunc ();
     lang_eh_runtime_type = d_build_eh_type_type;
 extern tree d_builtin_function43 PARAMS ((tree));
 extern void d_register_builtin_type PARAMS((tree, const char *));
 
-/* In d-misc.c */
-extern int d_using_sjlj_exceptions PARAMS ((void));
-extern char * d_asm_format_private_name PARAMS ((const char *,int));
-
 /* In d-builtins2.cc */
 extern void d_bi_init PARAMS ((void));
 extern void d_bi_builtin_func PARAMS ((tree));

d/d-misc.c

-/* GDC -- D front-end for GCC
-   Copyright (C) 2004 David Friedman
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#if D_GCC_VER >= 45
-#include "function.h"
-#endif
-#include "except.h"
-#include "tree.h"
-
-#include "d-lang.h"
-
-
-/* The value of USING_SJLJ_EXCEPTIONS relies on insn-flags.h, but insn-flags.h
-   cannot be compiled by C++. */
-
-int
-d_using_sjlj_exceptions(void)
-{
-    return USING_SJLJ_EXCEPTIONS;
-}
-
-/* ASM_FORMAT_PRIVATE_NAME implicitly casts to char* from void*
-   (from an alloca call).  This is fixed in GCC 4.x */
-
-char *
-d_asm_format_private_name(const char * name, int value)
-{
-    char * out_name;
-    ASM_FORMAT_PRIVATE_NAME(out_name, name, value);
-    // and, since it's alloca...
-    return xstrdup(out_name);
-}
         name = IDENTIFIER_POINTER(DECL_NAME(decl));
     else
         name = "___s";
-    char *label = d_asm_format_private_name(name, DECL_UID(decl));
+
+    char *label;
+    ASM_FORMAT_PRIVATE_NAME(label, name, DECL_UID(decl));
     SET_DECL_ASSEMBLER_NAME(decl, get_identifier(label));
-    free(label);
 }
 
 #if D_GCC_VER >= 45

d/phobos/configure

 
 
 if test -z "$DFLAGS"; then
-    DFLAGS="-Wall -g -frelease -O2 -finline-functions"
+    DFLAGS="-Wall -g -frelease -O2"
 fi
 
 

d/phobos/configure.in

 AC_SUBST(DCFG_POSIX)
 
 if test -z "$DFLAGS"; then
-    DFLAGS="-Wall -g -frelease -O2 -finline-functions"
+    DFLAGS="-Wall -g -frelease -O2"
 fi
 AC_SUBST(DFLAGS)
 

d/phobos2/configure

 
 
 if test -z "$DFLAGS"; then
-    DFLAGS="-Wall -g -frelease -O2 -finline-functions"
+    DFLAGS="-Wall -g -frelease -O2"
 fi
 
 

d/phobos2/configure.in

 AC_SUBST(DCFG_POSIX)
 
 if test -z "$DFLAGS"; then
-    DFLAGS="-Wall -g -frelease -O2 -finline-functions"
+    DFLAGS="-Wall -g -frelease -O2"
 fi
 AC_SUBST(DFLAGS)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.