Changes in / [149d297:6152c81]
- Files:
-
- 4 added
- 13 edited
-
.gitignore (modified) (2 diffs)
-
Jenkinsfile (modified) (1 diff)
-
configure (modified) (7 diffs)
-
configure.ac (modified) (2 diffs)
-
src/CodeTools/DeclStats.cc (modified) (1 diff)
-
src/GenPoly/InstantiateGeneric.cc (modified) (1 diff)
-
src/Parser/lex.cc (added)
-
src/Parser/parser.cc (added)
-
src/Parser/parser.h (added)
-
src/driver/Makefile.am (modified) (2 diffs)
-
src/driver/Makefile.in (modified) (10 diffs)
-
src/libcfa/Makefile.am (modified) (1 diff)
-
src/libcfa/Makefile.in (modified) (1 diff)
-
src/libcfa/concurrency/CtxSwitch-i386.S (modified) (3 diffs)
-
src/libcfa/concurrency/CtxSwitch-x86_64.S (modified) (2 diffs)
-
src/libcfa/concurrency/invoke.c (modified) (2 diffs)
-
src/prelude/builtins.c (added)
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r149d297 r6152c81 30 30 31 31 src/prelude/builtins.cf 32 src/prelude/builtins.c33 32 src/prelude/extras.cf 34 33 src/prelude/bootloader.c … … 37 36 # generated by bison and lex from cfa.yy and lex.ll, respectively 38 37 src/Parser/parser.output 39 src/Parser/lex.cc40 src/Parser/parser.cc41 src/Parser/parser.h42 38 43 39 # generated by xfig for user manual -
Jenkinsfile
r149d297 r6152c81 227 227 switch( arch ) { 228 228 case 'x64': 229 return '--host=x86_64 '229 return '--host=x86_64 CXXFLAGS="-m64" CFAFLAGS="-m64"' 230 230 break 231 231 case 'x86': 232 return '--host=i386 '232 return '--host=i386 CXXFLAGS="-m32" CFAFLAGS="-m32"' 233 233 break 234 234 default : -
configure
r149d297 r6152c81 644 644 CXXFLAGS 645 645 CXX 646 CFA_FLAGS647 646 MACHINE_TYPE 648 647 host_os … … 654 653 build_cpu 655 654 build 655 CFA_FLAGS 656 656 CFA_LIBDIR 657 657 CFA_BINDIR … … 742 742 enable_silent_rules 743 743 enable_maintainer_mode 744 with_cfa_name745 744 with_backend_compiler 746 745 enable_target_release … … 1399 1398 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] 1400 1399 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) 1401 --with-cfa-name=NAME NAME too which cfa will be installed1402 1400 --with-backend-compiler=PROGRAM PROGRAM that performs the final code compilation (must be gcc-compatible) 1403 1401 … … 3005 3003 3006 3004 # Allow program name tansformation 3007 # will fill program_transform_name with appropriate sed regex 3008 3005 # will fille program_transform_name with appropriate sed regex 3006 3007 #autoconf escapes $ and \ since automake wiill un-escape them. 3008 #Since we need to use the sed transform in autoconf we need to manualy un-escape these characters 3009 name_transform=`echo ${program_transform_name} | sed 's/\\$\\$/\\$/g' | sed 's/\\\\\\\/\\\/g'` 3010 cfa_name=`echo cfa | sed ${name_transform}` 3011 cc1_name=`echo cc1 | sed ${name_transform}` 3012 cpp_name=`echo cfa-cpp | sed ${name_transform}` 3009 3013 3010 3014 #Trasforming cc1 will break compilation 3011 if test "${program_transform_name}" = ""; then 3012 as_fn_error $? "Program transform not supported. 3013 Use --with-cfa-name='[Desired name here]' instead" "$LINENO" 5 3014 fi 3015 3016 3017 # Check whether --with-cfa-name was given. 3018 if test "${with_cfa_name+set}" = set; then : 3019 withval=$with_cfa_name; cfa_name=$withval 3020 else 3021 cfa_name="cfa" 3022 fi 3023 3015 if ! test "${cc1_name}" = "cc1"; then 3016 as_fn_error $? "Program transform must not modify cc1. 3017 --program-sufix and --program-prefix not supported. 3018 Use -program-transform-name='s/cfa$/[Desired name here]/' instead" "$LINENO" 5 3019 fi 3020 #We could support transforming cfa-cpp but since it is located in a unique subfolder we don't need to 3021 if ! test "${cpp_name}" = "cfa-cpp"; then 3022 as_fn_error $? "Program transform must not modify cfa-cpp. 3023 --program-sufix and --program-prefix not supported. 3024 Use -program-transform-name='s/cfa$/[Desired name here]/' instead" "$LINENO" 5 3025 fi 3024 3026 3025 3027 #Define the new name of the installed command … … 3302 3304 3303 3305 3306 3307 cat >>confdefs.h <<_ACEOF 3308 #define CFA_FLAGS "${CFAFLAGS}" 3309 _ACEOF 3310 3311 CFA_FLAGS=${CFAFLAGS} 3312 3313 3304 3314 # Make sure we can run config.sub. 3305 3315 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || … … 3374 3384 3375 3385 MACHINE_TYPE=$host_cpu 3376 3377 3378 if ! test "$host_cpu" = "$build_cpu"; then3379 case $host_cpu in3380 i386)3381 CFLAGS+="-m32"3382 CXXFLAGS+="-m32"3383 CFAFLAGS+="-m32"3384 LDFLAGS+="-m32"3385 ;;3386 i686)3387 CFLAGS+="-m32"3388 CXXFLAGS+="-m32"3389 CFAFLAGS+="-m32"3390 LDFLAGS+="-m32"3391 ;;3392 x86_64)3393 CFLAGS+="-m64"3394 CXXFLAGS+="-m64"3395 CFAFLAGS+="-m64"3396 LDFLAGS+="-m64"3397 ;;3398 esac3399 fi3400 3401 3402 cat >>confdefs.h <<_ACEOF3403 #define CFA_FLAGS "${CFAFLAGS}"3404 _ACEOF3405 3406 CFA_FLAGS=${CFAFLAGS}3407 3386 3408 3387 -
configure.ac
r149d297 r6152c81 19 19 20 20 # Allow program name tansformation 21 # will fill program_transform_name with appropriate sed regex21 # will fille program_transform_name with appropriate sed regex 22 22 AC_ARG_PROGRAM 23 #autoconf escapes $ and \ since automake wiill un-escape them. 24 #Since we need to use the sed transform in autoconf we need to manualy un-escape these characters 25 name_transform=`echo ${program_transform_name} | sed 's/\\$\\$/\\$/g' | sed 's/\\\\\\\/\\\/g'` 26 cfa_name=`echo cfa | sed ${name_transform}` 27 cc1_name=`echo cc1 | sed ${name_transform}` 28 cpp_name=`echo cfa-cpp | sed ${name_transform}` 23 29 24 30 #Trasforming cc1 will break compilation 25 if test "${program_transform_name}" = ""; then 26 AC_MSG_ERROR([Program transform not supported. 27 Use --with-cfa-name='[[Desired name here]]' instead]) 28 fi 29 30 AC_ARG_WITH(cfa-name, 31 [ --with-cfa-name=NAME NAME too which cfa will be installed], 32 cfa_name=$withval, cfa_name="cfa") 31 if ! test "${cc1_name}" = "cc1"; then 32 AC_MSG_ERROR([Program transform must not modify cc1. 33 --program-sufix and --program-prefix not supported. 34 Use -program-transform-name='s/cfa$/[[Desired name here]]/' instead]) 35 fi 36 #We could support transforming cfa-cpp but since it is located in a unique subfolder we don't need to 37 if ! test "${cpp_name}" = "cfa-cpp"; then 38 AC_MSG_ERROR([Program transform must not modify cfa-cpp. 39 --program-sufix and --program-prefix not supported. 40 Use -program-transform-name='s/cfa$/[[Desired name here]]/' instead]) 41 fi 33 42 34 43 #Define the new name of the installed command … … 169 178 AC_SUBST(CFA_LIBDIR, ${cfa_libdir}) 170 179 171 AC_CANONICAL_BUILD 180 AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.]) 181 AC_SUBST(CFA_FLAGS, ${CFAFLAGS}) 182 172 183 AC_CANONICAL_HOST 173 184 AC_SUBST([MACHINE_TYPE],[$host_cpu]) 174 175 if ! test "$host_cpu" = "$build_cpu"; then176 case $host_cpu in177 i386)178 CFLAGS+="-m32"179 CXXFLAGS+="-m32"180 CFAFLAGS+="-m32"181 LDFLAGS+="-m32"182 ;;183 i686)184 CFLAGS+="-m32"185 CXXFLAGS+="-m32"186 CFAFLAGS+="-m32"187 LDFLAGS+="-m32"188 ;;189 x86_64)190 CFLAGS+="-m64"191 CXXFLAGS+="-m64"192 CFAFLAGS+="-m64"193 LDFLAGS+="-m64"194 ;;195 esac196 fi197 198 AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.])199 AC_SUBST(CFA_FLAGS, ${CFAFLAGS})200 185 201 186 # Checks for programs. -
src/CodeTools/DeclStats.cc
r149d297 r6152c81 186 186 auto& args = expr->get_args(); 187 187 unsigned fanout = args.size(); 188 189 188 ++exprs_by_fanout_at_depth[ std::make_pair(depth, fanout) ]; 190 189 for ( Expression* arg : args ) { -
src/GenPoly/InstantiateGeneric.cc
r149d297 r6152c81 226 226 227 227 if ( (*baseParam)->isComplete() ) { 228 // substitute parameter for complete (otype or sized dtype) type 229 int pointerLevels = 0; 230 if ( hasPolyBase( paramType->get_type(), &pointerLevels ) && pointerLevels > 0 ) { 231 // Make a void* with equivalent nesting 232 Type* voidPtr = new VoidType( Type::Qualifiers() ); 233 while ( pointerLevels > 0 ) { 234 // Just about data layout, so qualifiers *shouldn't* matter 235 voidPtr = new PointerType( Type::Qualifiers(), voidPtr ); 236 --pointerLevels; 237 } 238 out.push_back( new TypeExpr( voidPtr ) ); 239 } else { 240 // Just clone parameter type 241 out.push_back( paramType->clone() ); 242 } 243 // make the struct concrete or dynamic depending on the parameter 228 // substitute parameter for complete (otype or sized dtype) type; makes the struct concrete or dynamic depending on the parameter 229 out.push_back( paramType->clone() ); 244 230 gt |= isPolyType( paramType->get_type() ) ? genericType::dynamic : genericType::concrete; 245 231 } else switch ( (*baseParam)->get_kind() ) { -
src/driver/Makefile.am
r149d297 r6152c81 28 28 endif 29 29 30 noinst_PROGRAMS = cfa30 bin_PROGRAMS = cfa 31 31 cfa_SOURCES = cfa.cc 32 33 install-exec-hook:34 @echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) cfa '$(CFA_BINDIR)/$(CFA_NAME)'"; \35 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) cfa $(CFA_BINDIR)/$(CFA_NAME) || exit $$?36 37 uninstall-hook:38 @echo " ( cd '$(CFA_BINDIR)' && rm -f $(CFA_NAME) )"; \39 cd "$(CFA_BINDIR)" && rm -f $(CFA_NAME)40 32 41 33 # put into lib for now … … 44 36 cc1_SOURCES = cc1.cc 45 37 46 MAINTAINERCLEANFILES = $(CFA_BINDIR)/$(CFA_NAME)@CFA_PREFIX@/lib/${cc1lib_PROGRAMS}38 MAINTAINERCLEANFILES = @CFA_PREFIX@/bin/${bin_PROGRAMS} @CFA_PREFIX@/lib/${cc1lib_PROGRAMS} -
src/driver/Makefile.in
r149d297 r6152c81 41 41 @BUILD_DEBUG_TRUE@am__append_2 = -DHAVE_LIBCFA_DEBUG 42 42 @BUILD_RELEASE_TRUE@am__append_3 = -DHAVE_LIBCFA_RELEASE 43 noinst_PROGRAMS = cfa$(EXEEXT)43 bin_PROGRAMS = cfa$(EXEEXT) 44 44 cc1lib_PROGRAMS = cc1$(EXEEXT) 45 45 subdir = src/driver … … 53 53 CONFIG_CLEAN_FILES = 54 54 CONFIG_CLEAN_VPATH_FILES = 55 am__installdirs = "$(DESTDIR)$( cc1libdir)"56 PROGRAMS = $( cc1lib_PROGRAMS) $(noinst_PROGRAMS)55 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cc1libdir)" 56 PROGRAMS = $(bin_PROGRAMS) $(cc1lib_PROGRAMS) 57 57 am_cc1_OBJECTS = cc1.$(OBJEXT) 58 58 cc1_OBJECTS = $(am_cc1_OBJECTS) … … 215 215 cc1libdir = ${CFA_LIBDIR} 216 216 cc1_SOURCES = cc1.cc 217 MAINTAINERCLEANFILES = $(CFA_BINDIR)/$(CFA_NAME)@CFA_PREFIX@/lib/${cc1lib_PROGRAMS}217 MAINTAINERCLEANFILES = @CFA_PREFIX@/bin/${bin_PROGRAMS} @CFA_PREFIX@/lib/${cc1lib_PROGRAMS} 218 218 all: all-am 219 219 … … 250 250 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 251 251 $(am__aclocal_m4_deps): 252 install-binPROGRAMS: $(bin_PROGRAMS) 253 @$(NORMAL_INSTALL) 254 test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" 255 @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 256 for p in $$list; do echo "$$p $$p"; done | \ 257 sed 's/$(EXEEXT)$$//' | \ 258 while read p p1; do if test -f $$p; \ 259 then echo "$$p"; echo "$$p"; else :; fi; \ 260 done | \ 261 sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ 262 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 263 sed 'N;N;N;s,\n, ,g' | \ 264 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ 265 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ 266 if ($$2 == $$4) files[d] = files[d] " " $$1; \ 267 else { print "f", $$3 "/" $$4, $$1; } } \ 268 END { for (d in files) print "f", d, files[d] }' | \ 269 while read type dir files; do \ 270 if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ 271 test -z "$$files" || { \ 272 echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ 273 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ 274 } \ 275 ; done 276 277 uninstall-binPROGRAMS: 278 @$(NORMAL_UNINSTALL) 279 @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 280 files=`for p in $$list; do echo "$$p"; done | \ 281 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ 282 -e 's/$$/$(EXEEXT)/' `; \ 283 test -n "$$list" || exit 0; \ 284 echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ 285 cd "$(DESTDIR)$(bindir)" && rm -f $$files 286 287 clean-binPROGRAMS: 288 -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) 252 289 install-cc1libPROGRAMS: $(cc1lib_PROGRAMS) 253 290 @$(NORMAL_INSTALL) … … 287 324 clean-cc1libPROGRAMS: 288 325 -test -z "$(cc1lib_PROGRAMS)" || rm -f $(cc1lib_PROGRAMS) 289 290 clean-noinstPROGRAMS:291 -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)292 326 cc1$(EXEEXT): $(cc1_OBJECTS) $(cc1_DEPENDENCIES) $(EXTRA_cc1_DEPENDENCIES) 293 327 @rm -f cc1$(EXEEXT) … … 406 440 all-am: Makefile $(PROGRAMS) 407 441 installdirs: 408 for dir in "$(DESTDIR)$( cc1libdir)"; do \442 for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cc1libdir)"; do \ 409 443 test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 410 444 done … … 442 476 clean: clean-am 443 477 444 clean-am: clean- cc1libPROGRAMS clean-generic clean-noinstPROGRAMS\478 clean-am: clean-binPROGRAMS clean-cc1libPROGRAMS clean-generic \ 445 479 mostlyclean-am 446 480 … … 469 503 install-dvi-am: 470 504 471 install-exec-am: 472 @$(NORMAL_INSTALL) 473 $(MAKE) $(AM_MAKEFLAGS) install-exec-hook 505 install-exec-am: install-binPROGRAMS 506 474 507 install-html: install-html-am 475 508 … … 509 542 ps-am: 510 543 511 uninstall-am: uninstall-cc1libPROGRAMS 512 @$(NORMAL_INSTALL) 513 $(MAKE) $(AM_MAKEFLAGS) uninstall-hook 514 .MAKE: install-am install-exec-am install-strip uninstall-am 515 516 .PHONY: CTAGS GTAGS all all-am check check-am clean \ 517 clean-cc1libPROGRAMS clean-generic clean-noinstPROGRAMS ctags \ 518 distclean distclean-compile distclean-generic distclean-tags \ 519 distdir dvi dvi-am html html-am info info-am install \ 520 install-am install-cc1libPROGRAMS install-data install-data-am \ 521 install-dvi install-dvi-am install-exec install-exec-am \ 522 install-exec-hook install-html install-html-am install-info \ 544 uninstall-am: uninstall-binPROGRAMS uninstall-cc1libPROGRAMS 545 546 .MAKE: install-am install-strip 547 548 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ 549 clean-cc1libPROGRAMS clean-generic ctags distclean \ 550 distclean-compile distclean-generic distclean-tags distdir dvi \ 551 dvi-am html html-am info info-am install install-am \ 552 install-binPROGRAMS install-cc1libPROGRAMS install-data \ 553 install-data-am install-dvi install-dvi-am install-exec \ 554 install-exec-am install-html install-html-am install-info \ 523 555 install-info-am install-man install-pdf install-pdf-am \ 524 556 install-ps install-ps-am install-strip installcheck \ … … 526 558 maintainer-clean-generic mostlyclean mostlyclean-compile \ 527 559 mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ 528 uninstall-am uninstall-cc1libPROGRAMS uninstall-hook 529 530 531 install-exec-hook: 532 @echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) cfa '$(CFA_BINDIR)/$(CFA_NAME)'"; \ 533 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) cfa $(CFA_BINDIR)/$(CFA_NAME) || exit $$? 534 535 uninstall-hook: 536 @echo " ( cd '$(CFA_BINDIR)' && rm -f $(CFA_NAME) )"; \ 537 cd "$(CFA_BINDIR)" && rm -f $(CFA_NAME) 560 uninstall-am uninstall-binPROGRAMS uninstall-cc1libPROGRAMS 561 538 562 539 563 # Tell versions [3.59,3.63) of GNU make to not export all variables. -
src/libcfa/Makefile.am
r149d297 r6152c81 81 81 82 82 maintainer-clean-local: 83 -rm -rf ${ CFA_INCDIR} ${CFA_LIBDIR}83 -rm -rf ${includedir}/* ${libdir}/* -
src/libcfa/Makefile.in
r149d297 r6152c81 1161 1161 1162 1162 maintainer-clean-local: 1163 -rm -rf ${ CFA_INCDIR} ${CFA_LIBDIR}1163 -rm -rf ${includedir}/* ${libdir}/* 1164 1164 1165 1165 # Tell versions [3.59,3.63) of GNU make to not export all variables. -
src/libcfa/concurrency/CtxSwitch-i386.S
r149d297 r6152c81 52 52 movl 4(%esp),%eax 53 53 54 // Save floating & SSE control words on the stack.55 56 sub $8,%esp57 stmxcsr 0(%esp) // 4 bytes58 fnstcw 4(%esp) // 2 bytes59 60 54 // Save volatile registers on the stack. 61 55 … … 75 69 // argument is now at 8 + 12 = 20(%esp) 76 70 77 movl 2 8(%esp),%eax71 movl 20(%esp),%eax 78 72 79 73 // Load new context from the "to" area. … … 87 81 popl %edi 88 82 popl %ebx 89 90 // Load floating & SSE control words from the stack.91 92 fldcw 4(%esp)93 ldmxcsr 0(%esp)94 add $8,%esp95 83 96 84 // Return to thread. -
src/libcfa/concurrency/CtxSwitch-x86_64.S
r149d297 r6152c81 47 47 CtxSwitch: 48 48 49 // Save floating & SSE control words on the stack.49 // Save volatile registers on the stack. 50 50 51 51 subq $8,%rsp 52 52 stmxcsr 0(%rsp) // 4 bytes 53 53 fnstcw 4(%rsp) // 2 bytes 54 55 // Save volatile registers on the stack.56 57 54 pushq %r15 58 55 pushq %r14 … … 78 75 popq %r14 79 76 popq %r15 80 81 // Load floating & SSE control words from the stack.82 83 77 fldcw 4(%rsp) 84 78 ldmxcsr 0(%rsp) 85 addq $8,%rsp79 addq $8,%rsp 86 80 87 81 // Return to thread. -
src/libcfa/concurrency/invoke.c
r149d297 r6152c81 91 91 struct FakeStack { 92 92 void *fixedRegisters[3]; // fixed registers ebx, edi, esi (popped on 1st uSwitch, values unimportant) 93 uint32_t mxcr; // SSE Status and Control bits (control bits are preserved across function calls) 94 uint16_t fcw; // X97 FPU control word (preserved across function calls) 95 void *rturn; // where to go on return from uSwitch 93 void *rturn; // where to go on return from uSwitch 96 94 void *dummyReturn; // fake return compiler would have pushed on call to uInvoke 97 95 void *argument[3]; // for 16-byte ABI, 16-byte alignment starts here … … 110 108 struct FakeStack { 111 109 void *fixedRegisters[5]; // fixed registers rbx, r12, r13, r14, r15 112 uint32_t mxcr; // SSE Status and Control bits (control bits are preserved across function calls)113 uint16_t fcw; // X97 FPU control word (preserved across function calls)114 void *rturn; // where to go on return from uSwitch110 uint32_t mxcr; // SSE Status and Control bits (control bits are preserved across function calls) 111 uint16_t fcw; // X97 FPU control word (preserved across function calls) 112 void *rturn; // where to go on return from uSwitch 115 113 void *dummyReturn; // NULL return address to provide proper alignment 116 114 };
Note:
See TracChangeset
for help on using the changeset viewer.