Changeset 13073be for src/prelude


Ignore:
Timestamp:
May 25, 2018, 1:37:34 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
8dbedfc
Parents:
a1a17a7
Message:

Fix atomic builtins in libcfa and prelude

Location:
src/prelude
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • src/prelude/Makefile.am

    ra1a17a7 r13073be  
    3737# create forward declarations for gcc builtins
    3838gcc-builtins.cf : gcc-builtins.c prototypes.sed
    39         ${AM_V_GEN}@BACKEND_CC@ -E -P $< | sed -f prototypes.sed > $@
     39        ${AM_V_GEN}@BACKEND_CC@ -E -P $< | sed -r -f prototypes.sed > $@
    4040
    41 gcc-builtins.c : builtins.def prototypes.awk
     41gcc-builtins.c : builtins.def prototypes.awk sync-builtins.cf
    4242        ${AM_V_GEN}@BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@
    4343
  • src/prelude/Makefile.in

    ra1a17a7 r13073be  
    506506# create forward declarations for gcc builtins
    507507gcc-builtins.cf : gcc-builtins.c prototypes.sed
    508         ${AM_V_GEN}@BACKEND_CC@ -E -P $< | sed -f prototypes.sed > $@
    509 
    510 gcc-builtins.c : builtins.def prototypes.awk
     508        ${AM_V_GEN}@BACKEND_CC@ -E -P $< | sed -r -f prototypes.sed > $@
     509
     510gcc-builtins.c : builtins.def prototypes.awk sync-builtins.cf
    511511        ${AM_V_GEN}@BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@
    512512
  • src/prelude/builtins.def

    ra1a17a7 r13073be  
    190190
    191191/* Builtin used by implementation of Cilk Plus.  Most of these are decomposed
    192    by the compiler but a few are implemented in libcilkrts.  */ 
     192   by the compiler but a few are implemented in libcilkrts.  */
    193193#undef DEF_CILK_BUILTIN_STUB
    194194#define DEF_CILK_BUILTIN_STUB(ENUM, NAME) \
     
    204204
    205205/* Builtin used by the implementation of libsanitizer. These
    206    functions are mapped to the actual implementation of the 
     206   functions are mapped to the actual implementation of the
    207207   libtsan library. */
    208208#undef DEF_SANITIZER_BUILTIN
     
    217217#define DEF_CILKPLUS_BUILTIN(ENUM, NAME, TYPE, ATTRS)  \
    218218  DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, BT_FN_INT_VAR, BT_LAST, \
    219                false, false, false, ATTRS, false, flag_cilkplus) 
     219               false, false, false, ATTRS, false, flag_cilkplus)
    220220
    221221/* Builtin used by the implementation of Pointer Bounds Checker.  */
     
    927927DEF_GCC_BUILTIN (BUILT_IN_LINE, "LINE", BT_FN_INT, ATTR_NOTHROW_LEAF_LIST)
    928928
     929#if 0 //Ifdefed out because we hard-coded the proper overloadings of the atomic built-ins
    929930/* Synchronization Primitives.  */
    930931#include "sync-builtins.def"
    931932
    932 #if 0
    933933/* Offloading and Multi Processing builtins.  */
    934934#include "omp-builtins.def"
  • src/prelude/prelude.cf

    ra1a17a7 r13073be  
    458458signed long long int    ?=?( signed long long int &, signed long long int ),    ?=?( volatile signed long long int &, signed long long int );
    459459unsigned long long int  ?=?( unsigned long long int &, unsigned long long int ), ?=?( volatile unsigned long long int &, unsigned long long int );
     460__int128        ?=?( __int128 &, __int128 ),    ?=?( volatile __int128 &, __int128 );
    460461zero_t                  ?=?( zero_t &, zero_t );
    461462one_t                   ?=?( one_t &, one_t );
  • src/prelude/prototypes.awk

    ra1a17a7 r13073be  
    55# file "LICENCE" distributed with Cforall.
    66#
    7 # prototypes.awk -- 
     7# prototypes.awk --
    88#
    99# Author           : Peter A. Buhr
     
    1212# Last Modified On : Tue Jul  5 14:32:52 2016
    1313# Update Count     : 32
    14 # 
     14#
    1515
    1616# http://llvm.org/svn/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def
     
    8383} # BEGIN
    8484
    85 /BT_FN/ { 
     85/BT_FN/ {
    8686    for (i = 1; i <= NF; i++) {
    8787      if( match($i, "BT_FN") != 0 ) {
     
    116116
    117117      # generate function return type as macro
    118       for ( t = 0; t < N; t += 1 ) {                                    # find longest match 
     118      for ( t = 0; t < N; t += 1 ) {                                    # find longest match
    119119        type = types[t];
    120120        if ( index( prototype, type ) == 1 ) {          # found match
     
    150150        # extras
    151151        printf( "\n#include \"builtins.def\"\n\n" );
     152        printf( "\n#include \"sync-builtins.cf\"\n\n" );
    152153        printf( "extern const char *__PRETTY_FUNCTION__;\n" );
    153154} # END
  • src/prelude/prototypes.sed

    ra1a17a7 r13073be  
    22/targetm/s/.*//                         #Remove targetm declarations
    33/__Unsupported/s/.*//                   #Remove Unsupported types declarations
    4 s/void (const char \*)0();//            #Remove void (const char \*)0();
     4s/void \(const char \*\)0\(\);//        #Remove void (const char \*)0();
    55s/\"//g                                         #Remove extraenous quotes in declarations
    6 /__builtin_/s/_ /_/g                    #Remove extraenous spaces in declarations
     6/__builtin_/s/_ /_/g                    #Remove extraenous spaces in declarations
     7
     8#Fix gcc overloading
     9# various sed rules for the gcc sync builtins which are overloaded
     10# kept here because they generate an acceptable approximate of the correct prototypes
     11
     12#/__sync_/s/_[0-9][0-9]*\(.*\)/\(\);/g  #hack since it will accept any parameters
     13#/__atomic_/s/_[0-9][0-9]*\(.*\)/\(\);/g        #hack since it will accept any parameters
     14
     15#/_16/s/void \*/__int128 \*/g
     16#/_8/s/void \*/long long int \*/g
     17#/_4/s/void \*/int \*/g
     18#/_2/s/void \*/short \*/g
     19#/_1/s/void \*/char \*/g
     20
     21#s/([a-zA-Z0-9_ ]+)\s+__sync([a-z_]+)_([0-9]+)\((.*)\);/\1 __sync\2\(\4\,...); \1 __sync\2_\3\(\4\,...);/
     22#s/([a-zA-Z0-9_ ]+)\s+__atomic([a-z_]+)_([0-9]+)\((.*)\);/\1 __atomic\2\(\4\); \1 __atomic\2_\3\(\4\);/
Note: See TracChangeset for help on using the changeset viewer.