Changes in / [73bf8cf2:8a443f4]
- Files:
-
- 6 edited
-
doc/LaTeXmacros/common.tex (modified) (2 diffs)
-
doc/user/user.tex (modified) (14 diffs)
-
src/GenPoly/Box.cc (modified) (9 diffs)
-
src/driver/cfa.cc (modified) (4 diffs)
-
src/libcfa/Makefile.am (modified) (4 diffs)
-
src/libcfa/Makefile.in (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/LaTeXmacros/common.tex
r73bf8cf2 r8a443f4 11 11 %% Created On : Sat Apr 9 10:06:17 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Tue Aug 2 17:02:02201614 %% Update Count : 22 813 %% Last Modified On : Mon Aug 1 09:11:20 2016 14 %% Update Count : 225 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 40 40 \newcommand{\CC}{\rm C\kern-.1em\hbox{+\kern-.25em+}\xspace} % CC symbolic name 41 41 \newcommand{\CCeleven}{\rm C\kern-.1em\hbox{+\kern-.25em+}11\xspace} % C++11 symbolic name 42 \ newcommand{\Celeven}{C11\xspace} % C11 symbolic name42 \def\c11{ISO/IEC C} % C11 name (cannot have numbers in latex command name) 43 43 44 44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -
doc/user/user.tex
r73bf8cf2 r8a443f4 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Tue Aug 2 17:39:02201614 %% Update Count : 12 8613 %% Last Modified On : Mon Aug 1 09:11:24 2016 14 %% Update Count : 1271 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 226 226 227 227 \section{Interoperability} 228 \label{s:Interoperability}229 228 230 229 \CFA is designed to integrate well with existing C programs and libraries. … … 315 314 The \CFA compilation message is printed at the beginning of a compilation. 316 315 \textbf{This option is the default.} 317 318 \item319 \Indexc{-no-include-std}\index{compilation option!-no-include-std@©-no-include-std©}320 Do not supply ©extern "C"© wrappers for \Celeven standard include files (see~\VRef{s:StandardHeaders}).321 \textbf{This option is \emph{not} the default.}322 316 \end{description} 323 317 … … 4369 4363 4370 4364 4371 \section{New Keywords} 4372 \label{s:NewKeywords} 4373 4374 \begin{quote2} 4375 \begin{tabular}{ll} 4376 ©catch© & ©lvalue© \\ 4377 ©catchResume© & \\ 4378 ©choose© & ©otype© \\ 4379 & \\ 4380 ©disable© & ©throw© \\ 4381 ©dtype© & ©throwResume© \\ 4382 & ©trait© \\ 4383 ©enable© & ©try© \\ 4384 & \\ 4385 ©fallthrough© \\ 4386 ©fallthru© \\ 4387 ©finally© \\ 4388 ©forall© \\ 4389 ©ftype© \\ 4390 \end{tabular} 4391 \end{quote2} 4392 4393 4394 \section{Standard Headers} 4395 \label{s:StandardHeaders} 4396 4397 C prescribes the following standard header-files: 4398 \begin{quote2} 4399 \begin{minipage}{\linewidth} 4400 \begin{tabular}{lll} 4401 assert.h & math.h & stdlib.h \\ 4402 complex.h & setjmp.h & stdnoreturn.h \\ 4403 ctype.h & signal.h & string.h \\ 4404 errno.h & stdalign.h & tgmath.h \\ 4405 fenv.h & stdarg.h & threads.h \\ 4406 float.h & stdatomic.h & time.h \\ 4407 inttypes.h & stdbool.h & uchar.h \\ 4408 iso646.h & stddef.h & wchar.h \\ 4409 limits.h & stdint.h & wctype.h \\ 4410 locale.h & stdio.h & unistd.h\footnote{\CFA extension} 4411 \end{tabular} 4412 \end{minipage} 4413 \end{quote2} 4414 For the prescribed head-files, \CFA implicit wraps their includes in an ©extern "C"©; 4415 hence, names in these include files are not mangled\index{mangling!name} (see~\VRef{s:Interoperability}). 4416 All other C header files must be explicitly wrapped in ©extern "C"© to prevent name mangling. 4365 \section{New Keywowrds} 4366 4367 ©catch©, ©catchResume©, ©choose©, \quad ©disable©, ©dtype©, \quad ©enable©, \quad ©fallthrough©, ©fallthru©, ©finally©, ©forall©, ©ftype©, \quad ©lvalue©, \quad ©otype©, \quad ©throw©, ©throwResume©, ©trait©, ©try© 4417 4368 4418 4369 … … 4424 4375 \item 4425 4376 \begin{description} 4426 \item[Change:] add new keywords (see~\VRef{s:NewKeywords})\\4377 \item[Change:] add new keywords \\ 4427 4378 New keywords are added to \CFA. 4428 4379 \item[Rationale:] keywords added to implement new semantics of \CFA. … … 4522 4473 \begin{description} 4523 4474 \item[Change:] have ©struct© introduce a scope for nested types 4524 In C, the name of the nested types belongs to the same scope as the name of the outermost enclosing 4475 In C, the name of the nested types belongs to the same scope as the name of the outermost enclosing 4525 4476 Example: 4526 4477 \begin{lstlisting} … … 4645 4596 %$ 4646 4597 \begin{lstlisting}[mathescape=off] 4647 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x $" | 4 | "x £" | 5 | "x ¥" | 6 | "x ¡" | 7 4648 | "x ¿" | 8 | "x «" | 9 | endl; 4598 sout | "x (" | 1 | "x [" | 2 | "x {" | 3 | "x $" | 4 | "x £" | 5 | "x ¥" | 6 | "x ¡" | 7 | "x ¿" | 8 | "x «" | 9 | endl; 4649 4599 \end{lstlisting} 4650 4600 %$ … … 4656 4606 A seperator does not appear after a C string ending with the (extended) \Index{ASCII}\index{ASCII!extended} characters: ©,.:;!?)]}%¢»© 4657 4607 \begin{lstlisting}[belowskip=0pt] 4658 sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 4659 | ") x" | 8 | "] x" | 9 | "} x" |10 | "% x" | 11 | "¢ x" | 12 | "» x" | endl;4608 sout | 1 | ", x" | 2 | ". x" | 3 | ": x" | 4 | "; x" | 5 | "! x" | 6 | "? x" | 7 | ") x" | 8 | "] x" | 9 | "} x" 4609 | 10 | "% x" | 11 | "¢ x" | 12 | "» x" | endl; 4660 4610 \end{lstlisting} 4661 4611 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4673 4623 The following \CC-style \Index{manipulator}s allow further control over implicit seperation. 4674 4624 \begin{lstlisting}[mathescape=off,belowskip=0pt] 4675 sout | sepOn | 1 | 2 | 3 | sepOn | endl; §\C{// separator at start of line}§4625 sout | sepOn | 1 | 2 | 3 | sepOn | endl; // separator at start of line 4676 4626 \end{lstlisting} 4677 4627 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4679 4629 \end{lstlisting} 4680 4630 \begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt] 4681 sout | 1 | sepOff | 2 | 3 | endl; §\C{// turn off implicit separator temporarily}§4631 sout | 1 | sepOff | 2 | 3 | endl; // turn off implicit separator temporarily 4682 4632 \end{lstlisting} 4683 4633 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4685 4635 \end{lstlisting} 4686 4636 \begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt] 4687 sout | sepDisable | 1 | 2 | 3 | endl; §\C{// turn off implicit separation, affects all subsequent prints}§4637 sout | sepDisable | 1 | 2 | 3 | endl; // turn off implicit separation, affects all subsequent prints 4688 4638 \end{lstlisting} 4689 4639 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4691 4641 \end{lstlisting} 4692 4642 \begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt] 4693 sout | 1 | sepOn | 2 | 3 | endl; §\C{// turn on implicit separator temporarily}§4643 sout | 1 | sepOn | 2 | 3 | endl; // turn on implicit separator temporarily 4694 4644 \end{lstlisting} 4695 4645 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4697 4647 \end{lstlisting} 4698 4648 \begin{lstlisting}[mathescape=off,aboveskip=0pt,belowskip=0pt] 4699 sout | sepEnable | 1 | 2 | 3 | endl; §\C{// turn on implicit separation, affects all subsequent prints}§4649 sout | sepEnable | 1 | 2 | 3 | endl; // turn on implicit separation, affects all subsequent prints 4700 4650 \end{lstlisting} 4701 4651 \begin{lstlisting}[mathescape=off,showspaces=true,aboveskip=0pt,belowskip=0pt] … … 4703 4653 \end{lstlisting} 4704 4654 \begin{lstlisting}[mathescape=off,aboveskip=0pt,aboveskip=0pt,belowskip=0pt] 4705 sepSet( sout, ", $" ); §\C{// change separator from " " to ", \$"}§4655 sepSet( sout, ", $" ); // change separator from " " to ", $" 4706 4656 sout | 1 | 2 | 3 | endl; 4707 4657 \end{lstlisting} -
src/GenPoly/Box.cc
r73bf8cf2 r8a443f4 619 619 return 0; 620 620 } 621 621 622 622 /// Returns T if the given declaration is a function with parameters (T*, T) for some TypeInstType T, NULL otherwise 623 623 TypeInstType *isTypeInstPtrValFn( DeclarationWithType *decl ) { … … 637 637 return 0; 638 638 } 639 639 640 640 /// Returns T if the given declaration is (*?=?)(T *, T) for some TypeInstType T (return not checked, but maybe should be), NULL otherwise 641 641 TypeInstType *isTypeInstAssignment( DeclarationWithType *decl ) { … … 677 677 return 0; 678 678 } 679 679 680 680 /// Returns T if the given declaration is a function with parameters (T*, T) for some type T, where neither parameter is cv-qualified, 681 681 /// NULL otherwise … … 772 772 copyOps.beginScope(); 773 773 dtorOps.beginScope(); 774 774 775 775 DeclarationWithType *oldRetval = retval; 776 776 bool oldUseRetval = useRetval; … … 1471 1471 VariableExpr *wrapFunctionDecl( DeclarationWithType *functionDecl ) { 1472 1472 // line below cloned from FixFunction.cc 1473 // xxx - functionObj is never added to a list of declarations...1474 1473 ObjectDecl *functionObj = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClass(), functionDecl->get_linkage(), 0, 1475 1474 new PointerType( Type::Qualifiers(), functionDecl->get_type()->clone() ), 0 ); 1476 1475 functionObj->set_mangleName( functionDecl->get_mangleName() ); 1477 functionObj->set_scopeLevel( functionDecl->get_scopeLevel() );1478 1476 return new VariableExpr( functionObj ); 1479 1477 } … … 1494 1492 = ParamEntry( assertOp->get_uniqueId(), assertOp->get_type()->clone(), actualDecl->get_type()->clone(), wrapFunctionDecl( assertOp ) ); 1495 1493 } 1496 1494 1497 1495 Statement * Pass1::mutate( ReturnStmt *returnStmt ) { 1498 1496 if ( retval && returnStmt->get_expr() ) { … … 1556 1554 DeclarationWithType *assertDtor = findOpForType( formalType, dtorOps, scopedDtorOps ); 1557 1555 if ( ! assertDtor ) throw SemanticError( "No destructor found for ", formalType ); 1558 1556 1559 1557 // add inferred parameters for otype operators to assignment expression 1560 1558 // NOTE: Code here assumes that first four assertions are assign op, ctor, copy ctor, dtor, in that order … … 1570 1568 ++actualIt; 1571 1569 addAssertionFor( assignExpr, *actualIt, assertDtor ); 1572 1570 1571 //DeclarationWithType *actualDecl = asserts.front(); 1572 //assignExpr->get_inferParams()[ actualDecl->get_uniqueId() ] 1573 // = ParamEntry( assertAssign->get_uniqueId(), assertAssign->get_type()->clone(), actualDecl->get_type()->clone(), wrapFunctionDecl( assertAssign ) ); 1573 1574 } 1574 1575 } … … 2180 2181 bool PolyGenericCalculator::findGeneric( Type *ty ) { 2181 2182 ty = replaceTypeInst( ty, env ); 2182 2183 2183 2184 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( ty ) ) { 2184 2185 if ( scopeTyVars.find( typeInst->get_name() ) != scopeTyVars.end() ) { -
src/driver/cfa.cc
r73bf8cf2 r8a443f4 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Aug 2 12:23:11 201613 // Update Count : 14 712 // Last Modified On : Thu Jul 7 08:56:01 2016 13 // Update Count : 144 14 14 // 15 15 … … 87 87 bool cpp_flag = false; // -E or -M flag, preprocessor only 88 88 bool std_flag = false; // -std= flag 89 bool noincstd_flag = false; // -no-include-std= flag90 89 bool debugging __attribute(( unused )) = false; // -g flag 91 90 … … 145 144 } else if ( arg == "-nohelp" ) { 146 145 help = false; // strip the nohelp flag 147 } else if ( arg == "-no-include-std" ) {148 noincstd_flag = true; // strip the no-include-std flag149 146 } else if ( arg == "-compiler" ) { 150 147 // use the user specified compiler … … 251 248 args[nargs] = "-I" CFA_INCDIR; 252 249 nargs += 1; 253 if ( ! noincstd_flag ) { // do not use during build 254 args[nargs] = "-I" CFA_INCDIR "/stdhdr"; 255 nargs += 1; 256 } // if 250 args[nargs] = "-I" CFA_INCDIR "/stdhdr"; 251 nargs += 1; 257 252 args[nargs] = "-I" CFA_INCDIR "/containers"; 258 253 nargs += 1; -
src/libcfa/Makefile.am
r73bf8cf2 r8a443f4 11 11 ## Created On : Sun May 31 08:54:01 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Tue Aug 2 12:17:23201614 ## Update Count : 19 613 ## Last Modified On : Fri Jul 8 23:05:11 2016 14 ## Update Count : 192 15 15 ############################################################################### 16 16 … … 26 26 # create extra forward types/declarations to reduce inclusion of library files 27 27 extras.cf : extras.regx extras.c 28 $ {AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf28 $(AM_V_GEN)@BACKEND_CC@ @CFA_FLAGS@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf 29 29 30 30 # create forward declarations for gcc builtins 31 31 builtins.cf : builtins.c 32 $ {AM_V_GEN}if [ -e $< ] ; then \32 $(AM_V_GEN)if [ -e $< ] ; then \ 33 33 @BACKEND_CC@ -E -P $^ | sed -e "/targetm/s/.*//" -e "/_Decimal/s/.*//" -e "s/void (const char \*)0();//" -e "s/\"//g" -e "s/\(__builtin_\) /\1/" > $@ ; \ 34 34 fi 35 35 36 36 builtins.c : builtins.def prototypes.awk 37 $ {AM_V_GEN}if [ -e $< ] ; then \37 $(AM_V_GEN)if [ -e $< ] ; then \ 38 38 @BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@ ; \ 39 39 fi … … 48 48 49 49 libcfa-prelude.c : ${srcdir}/prelude.cf ${srcdir}/extras.cf ${srcdir}/builtins.cf 50 $ {AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -l ${srcdir}/prelude.cf $@ # use src/cfa-cpp as not in lib until after install50 $(AM_V_GEN)${abs_top_srcdir}/src/driver/cfa-cpp -l ${srcdir}/prelude.cf $@ # use src/cfa-cpp as not in lib until after install 51 51 52 52 libcfa-prelude.o : libcfa-prelude.c 53 $ {AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -c -o $@ $<53 $(AM_V_GEN)@BACKEND_CC@ @CFA_FLAGS@ -c -o $@ $< 54 54 55 CFLAGS = -quiet - no-include-std -g -Wall -Wno-unused-function @CFA_FLAGS@ -B${abs_top_srcdir}/src/driver -XCFA -t # TEMPORARY: does not build with -O255 CFLAGS = -quiet -g -Wall -Wno-unused-function @CFA_FLAGS@ -B${abs_top_srcdir}/src/driver -XCFA -t # TEMPORARY: does not build with -O2 56 56 CC = ${abs_top_srcdir}/src/driver/cfa 57 57 … … 63 63 @true 64 64 65 ${libobjs} : ${abs_top_srcdir}/src/driver/cfa-cpp ${cfalib_DATA} # add dependency to cfa-cpp so all libraries are rebuilt with new translator65 ${libobjs} : ${abs_top_srcdir}/src/driver/cfa-cpp ${cfalib_DATA} # add dependency to cfa-cpp so all libraries are rebuilt with new translator 66 66 67 67 libcfa_a_SOURCES = libcfa-prelude.c ${headers:=.c} -
src/libcfa/Makefile.in
r73bf8cf2 r8a443f4 136 136 CFA_LIBDIR = @CFA_LIBDIR@ 137 137 CFA_PREFIX = @CFA_PREFIX@ 138 CFLAGS = -quiet - no-include-std -g -Wall -Wno-unused-function @CFA_FLAGS@ -B${abs_top_srcdir}/src/driver -XCFA -t # TEMPORARY: does not build with -O2138 CFLAGS = -quiet -g -Wall -Wno-unused-function @CFA_FLAGS@ -B${abs_top_srcdir}/src/driver -XCFA -t # TEMPORARY: does not build with -O2 139 139 CPP = @CPP@ 140 140 CPPFLAGS = @CPPFLAGS@ … … 603 603 # create extra forward types/declarations to reduce inclusion of library files 604 604 extras.cf : extras.regx extras.c 605 $ {AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf605 $(AM_V_GEN)@BACKEND_CC@ @CFA_FLAGS@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf 606 606 607 607 # create forward declarations for gcc builtins 608 608 builtins.cf : builtins.c 609 $ {AM_V_GEN}if [ -e $< ] ; then \609 $(AM_V_GEN)if [ -e $< ] ; then \ 610 610 @BACKEND_CC@ -E -P $^ | sed -e "/targetm/s/.*//" -e "/_Decimal/s/.*//" -e "s/void (const char \*)0();//" -e "s/\"//g" -e "s/\(__builtin_\) /\1/" > $@ ; \ 611 611 fi 612 612 613 613 builtins.c : builtins.def prototypes.awk 614 $ {AM_V_GEN}if [ -e $< ] ; then \614 $(AM_V_GEN)if [ -e $< ] ; then \ 615 615 @BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@ ; \ 616 616 fi … … 623 623 624 624 libcfa-prelude.c : ${srcdir}/prelude.cf ${srcdir}/extras.cf ${srcdir}/builtins.cf 625 $ {AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -l ${srcdir}/prelude.cf $@ # use src/cfa-cpp as not in lib until after install625 $(AM_V_GEN)${abs_top_srcdir}/src/driver/cfa-cpp -l ${srcdir}/prelude.cf $@ # use src/cfa-cpp as not in lib until after install 626 626 627 627 libcfa-prelude.o : libcfa-prelude.c 628 $ {AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -c -o $@ $<628 $(AM_V_GEN)@BACKEND_CC@ @CFA_FLAGS@ -c -o $@ $< 629 629 630 630 # extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing … … 632 632 @true 633 633 634 ${libobjs} : ${abs_top_srcdir}/src/driver/cfa-cpp ${cfalib_DATA} # add dependency to cfa-cpp so all libraries are rebuilt with new translator634 ${libobjs} : ${abs_top_srcdir}/src/driver/cfa-cpp ${cfalib_DATA} # add dependency to cfa-cpp so all libraries are rebuilt with new translator 635 635 636 636 maintainer-clean-local:
Note:
See TracChangeset
for help on using the changeset viewer.