- Timestamp:
- Aug 14, 2018, 4:10:58 PM (7 years ago)
- 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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 636e1b9
- Parents:
- c3a8ecd (diff), 5a5d31a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- driver
- Files:
-
- 5 moved
-
Makefile.am (moved) (moved from src/driver/Makefile.am ) (2 diffs)
-
Makefile.in (moved) (moved from src/driver/Makefile.in ) (14 diffs)
-
as.cc (moved) (moved from src/driver/as.cc )
-
cc1.cc (moved) (moved from src/driver/cc1.cc )
-
cfa.cc (moved) (moved from src/driver/cfa.cc ) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
driver/Makefile.am
rc3a8ecd r7cd8827 15 15 ############################################################################### 16 16 17 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names 18 17 19 # applies to both programs 18 AM_CXXFLAGS = -Wall -O2 -g -std=c++14 -I${abs_top_srcdir}/src 19 if BUILD_NO_LIB 20 else 21 AM_CXXFLAGS += -DHAVE_LIBCFA 22 endif 23 if BUILD_DEBUG 24 AM_CXXFLAGS += -DHAVE_LIBCFA_DEBUG 25 endif 26 if BUILD_RELEASE 27 AM_CXXFLAGS += -DHAVE_LIBCFA_RELEASE 28 endif 20 AM_CXXFLAGS = @HOST_FLAGS@ -Wall -O2 -g -std=c++14 -I${abs_top_srcdir}/src 29 21 30 22 # don't install cfa directly … … 45 37 # put into lib for now 46 38 cc1libdir = ${CFA_LIBDIR} 47 cc1lib_PROGRAMS = cc1 39 cc1lib_PROGRAMS = as cc1 40 as_SOURCES = as.cc 48 41 cc1_SOURCES = cc1.cc 49 42 50 aslibdir = ${CFA_LIBDIR}51 aslib_PROGRAMS = as52 as_SOURCES = as.cc53 54 43 MAINTAINERCLEANFILES = $(CFA_BINDIR)/$(CFA_NAME) @CFA_PREFIX@/lib/${cc1lib_PROGRAMS} -
driver/Makefile.in
rc3a8ecd r7cd8827 92 92 build_triplet = @build@ 93 93 host_triplet = @host@ 94 @BUILD_NO_LIB_FALSE@am__append_1 = -DHAVE_LIBCFA95 @BUILD_DEBUG_TRUE@am__append_2 = -DHAVE_LIBCFA_DEBUG96 @BUILD_RELEASE_TRUE@am__append_3 = -DHAVE_LIBCFA_RELEASE97 94 noinst_PROGRAMS = cfa$(EXEEXT) 98 cc1lib_PROGRAMS = cc1$(EXEEXT) 99 aslib_PROGRAMS = as$(EXEEXT) 100 subdir = src/driver 95 cc1lib_PROGRAMS = as$(EXEEXT) cc1$(EXEEXT) 96 subdir = driver 101 97 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 102 am__aclocal_m4_deps = $(top_srcdir)/configure.ac 98 am__aclocal_m4_deps = $(top_srcdir)/automake/cfa.m4 \ 99 $(top_srcdir)/configure.ac 103 100 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 104 101 $(ACLOCAL_M4) … … 108 105 CONFIG_CLEAN_FILES = 109 106 CONFIG_CLEAN_VPATH_FILES = 110 am__installdirs = "$(DESTDIR)$( aslibdir)" "$(DESTDIR)$(cc1libdir)"111 PROGRAMS = $( aslib_PROGRAMS) $(cc1lib_PROGRAMS) $(noinst_PROGRAMS)107 am__installdirs = "$(DESTDIR)$(cc1libdir)" 108 PROGRAMS = $(cc1lib_PROGRAMS) $(noinst_PROGRAMS) 112 109 am_as_OBJECTS = as.$(OBJEXT) 113 110 as_OBJECTS = $(am_as_OBJECTS) … … 186 183 BACKEND_CC = @BACKEND_CC@ 187 184 BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@ 188 BUILD_IN_TREE_FLAGS_NOLIB = @BUILD_IN_TREE_FLAGS_NOLIB@189 185 CC = @CC@ 190 186 CCAS = @CCAS@ … … 217 213 EXEEXT = @EXEEXT@ 218 214 GREP = @GREP@ 215 HOST_FLAGS = @HOST_FLAGS@ 219 216 INSTALL = @INSTALL@ 220 217 INSTALL_DATA = @INSTALL_DATA@ … … 226 223 LEXLIB = @LEXLIB@ 227 224 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ 225 LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@ 226 LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@ 228 227 LIBOBJS = @LIBOBJS@ 229 228 LIBS = @LIBS@ 230 229 LTLIBOBJS = @LTLIBOBJS@ 231 MACHINE_TYPE = @MACHINE_TYPE@232 230 MAKEINFO = @MAKEINFO@ 233 231 MKDIR_P = @MKDIR_P@ … … 245 243 SHELL = @SHELL@ 246 244 STRIP = @STRIP@ 245 TARGET_HOSTS = @TARGET_HOSTS@ 247 246 VERSION = @VERSION@ 248 247 YACC = @YACC@ … … 300 299 top_builddir = @top_builddir@ 301 300 top_srcdir = @top_srcdir@ 301 AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names 302 302 303 303 # applies to both programs 304 AM_CXXFLAGS = -Wall -O2 -g -std=c++14 -I${abs_top_srcdir}/src \ 305 $(am__append_1) $(am__append_2) $(am__append_3) 304 AM_CXXFLAGS = @HOST_FLAGS@ -Wall -O2 -g -std=c++14 -I${abs_top_srcdir}/src 306 305 cfa_SOURCES = cfa.cc 307 306 308 307 # put into lib for now 309 308 cc1libdir = ${CFA_LIBDIR} 309 as_SOURCES = as.cc 310 310 cc1_SOURCES = cc1.cc 311 aslibdir = ${CFA_LIBDIR}312 as_SOURCES = as.cc313 311 MAINTAINERCLEANFILES = $(CFA_BINDIR)/$(CFA_NAME) @CFA_PREFIX@/lib/${cc1lib_PROGRAMS} 314 312 all: all-am … … 325 323 esac; \ 326 324 done; \ 327 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/driver/Makefile'; \325 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign driver/Makefile'; \ 328 326 $(am__cd) $(top_srcdir) && \ 329 $(AUTOMAKE) --foreign src/driver/Makefile327 $(AUTOMAKE) --foreign driver/Makefile 330 328 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 331 329 @case '$?' in \ … … 345 343 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 346 344 $(am__aclocal_m4_deps): 347 install-aslibPROGRAMS: $(aslib_PROGRAMS)348 @$(NORMAL_INSTALL)349 @list='$(aslib_PROGRAMS)'; test -n "$(aslibdir)" || list=; \350 if test -n "$$list"; then \351 echo " $(MKDIR_P) '$(DESTDIR)$(aslibdir)'"; \352 $(MKDIR_P) "$(DESTDIR)$(aslibdir)" || exit 1; \353 fi; \354 for p in $$list; do echo "$$p $$p"; done | \355 sed 's/$(EXEEXT)$$//' | \356 while read p p1; do if test -f $$p \357 ; then echo "$$p"; echo "$$p"; else :; fi; \358 done | \359 sed -e 'p;s,.*/,,;n;h' \360 -e 's|.*|.|' \361 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \362 sed 'N;N;N;s,\n, ,g' | \363 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \364 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \365 if ($$2 == $$4) files[d] = files[d] " " $$1; \366 else { print "f", $$3 "/" $$4, $$1; } } \367 END { for (d in files) print "f", d, files[d] }' | \368 while read type dir files; do \369 if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \370 test -z "$$files" || { \371 echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(aslibdir)$$dir'"; \372 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(aslibdir)$$dir" || exit $$?; \373 } \374 ; done375 376 uninstall-aslibPROGRAMS:377 @$(NORMAL_UNINSTALL)378 @list='$(aslib_PROGRAMS)'; test -n "$(aslibdir)" || list=; \379 files=`for p in $$list; do echo "$$p"; done | \380 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \381 -e 's/$$/$(EXEEXT)/' \382 `; \383 test -n "$$list" || exit 0; \384 echo " ( cd '$(DESTDIR)$(aslibdir)' && rm -f" $$files ")"; \385 cd "$(DESTDIR)$(aslibdir)" && rm -f $$files386 387 clean-aslibPROGRAMS:388 -test -z "$(aslib_PROGRAMS)" || rm -f $(aslib_PROGRAMS)389 345 install-cc1libPROGRAMS: $(cc1lib_PROGRAMS) 390 346 @$(NORMAL_INSTALL) … … 557 513 all-am: Makefile $(PROGRAMS) 558 514 installdirs: 559 for dir in "$(DESTDIR)$( aslibdir)" "$(DESTDIR)$(cc1libdir)"; do \515 for dir in "$(DESTDIR)$(cc1libdir)"; do \ 560 516 test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 561 517 done … … 593 549 clean: clean-am 594 550 595 clean-am: clean- aslibPROGRAMS clean-cc1libPROGRAMS clean-generic\596 clean-noinstPROGRAMSmostlyclean-am551 clean-am: clean-cc1libPROGRAMS clean-generic clean-noinstPROGRAMS \ 552 mostlyclean-am 597 553 598 554 distclean: distclean-am … … 614 570 info-am: 615 571 616 install-data-am: install- aslibPROGRAMS install-cc1libPROGRAMS572 install-data-am: install-cc1libPROGRAMS 617 573 618 574 install-dvi: install-dvi-am … … 660 616 ps-am: 661 617 662 uninstall-am: uninstall- aslibPROGRAMS uninstall-cc1libPROGRAMS618 uninstall-am: uninstall-cc1libPROGRAMS 663 619 @$(NORMAL_INSTALL) 664 620 $(MAKE) $(AM_MAKEFLAGS) uninstall-hook … … 666 622 667 623 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ 668 clean-aslibPROGRAMS clean-cc1libPROGRAMS clean-generic \ 669 clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ 670 distclean-compile distclean-generic distclean-tags distdir dvi \ 671 dvi-am html html-am info info-am install install-am \ 672 install-aslibPROGRAMS install-cc1libPROGRAMS install-data \ 673 install-data-am install-dvi install-dvi-am install-exec \ 674 install-exec-am install-exec-hook install-html install-html-am \ 675 install-info install-info-am install-man install-pdf \ 676 install-pdf-am install-ps install-ps-am install-strip \ 677 installcheck installcheck-am installdirs maintainer-clean \ 678 maintainer-clean-generic mostlyclean mostlyclean-compile \ 679 mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ 680 uninstall-am uninstall-aslibPROGRAMS uninstall-cc1libPROGRAMS \ 624 clean-cc1libPROGRAMS clean-generic clean-noinstPROGRAMS \ 625 cscopelist-am ctags ctags-am distclean distclean-compile \ 626 distclean-generic distclean-tags distdir dvi dvi-am html \ 627 html-am info info-am install install-am install-cc1libPROGRAMS \ 628 install-data install-data-am install-dvi install-dvi-am \ 629 install-exec install-exec-am install-exec-hook install-html \ 630 install-html-am install-info install-info-am install-man \ 631 install-pdf install-pdf-am install-ps install-ps-am \ 632 install-strip installcheck installcheck-am installdirs \ 633 maintainer-clean maintainer-clean-generic mostlyclean \ 634 mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ 635 tags tags-am uninstall uninstall-am uninstall-cc1libPROGRAMS \ 681 636 uninstall-hook 682 637 -
driver/cfa.cc
rc3a8ecd r7cd8827 21 21 #include <string.h> // strcmp 22 22 23 #include <sys/types.h> 24 #include <sys/stat.h> 25 23 26 #include "Common/SemanticError.h" 24 27 #include "config.h" // configure info … … 66 69 } // shuffle 67 70 71 static inline bool dirExists(const string & path) { 72 struct stat info; 73 if(stat( path.c_str(), &info ) != 0) 74 return false; 75 else if(info.st_mode & S_IFDIR) 76 return true; 77 else 78 return false; 79 } //dirExists 80 68 81 69 82 #define str(s) #s … … 73 86 string Major( str( CFA_VERSION_MAJOR ) ), Minor( str( CFA_VERSION_MINOR ) ), Patch( str( CFA_VERSION_PATCH ) ); 74 87 75 string installincdir( CFA_INCDIR ); // fixed location of include files 76 string installlibdir( CFA_LIBDIR ); // fixed location of cc1 and cfa-cpp commands 88 string installincdir( CFA_INCDIR ); // fixed location of include files 89 string installlibdir( CFA_LIBDIR ); // fixed location of cc1 and cfa-cpp commands when installed 90 string srcdriverdir ( TOP_BUILDDIR "driver"); // fixed location of cc1 and cfa-cpp commands when in tree 77 91 78 92 string heading; // banner printed at start of cfa compilation … … 96 110 bool xflag = false; // user supplied -x flag 97 111 bool debugging __attribute(( unused )) = false; // -g flag 112 bool m32 = false; // -m32 flag 113 bool m64 = false; // -m64 flag 114 bool intree = false; 98 115 99 116 const char *args[argc + 100]; // cfa command line values, plus some space for additional flags … … 154 171 } else if ( arg == "-no-include-stdhdr" ) { 155 172 noincstd_flag = true; // strip the no-include-stdhdr flag 173 } else if ( arg == "-in-tree" ) { 174 intree = true; 156 175 } else if ( arg == "-compiler" ) { 157 176 // use the user specified compiler … … 258 277 libs[nlibs] = argv[i]; 259 278 nlibs += 1; 279 } else if ( arg == "-m32" ) { 280 m32 = true; 281 m64 = false; 282 args[nargs] = argv[i]; 283 nargs += 1; 284 } else if ( arg == "-m64" ) { 285 m64 = true; 286 m32 = false; 287 args[nargs] = argv[i]; 288 nargs += 1; 260 289 } else { 261 290 // concatenate any other arguments … … 309 338 310 339 // add the CFA include-library paths, which allow direct access to header files without directory qualification 311 args[nargs] = "-I" CFA_INCDIR; 312 nargs += 1; 313 if ( ! noincstd_flag ) { // do not use during build 314 args[nargs] = "-I" CFA_INCDIR "/stdhdr"; 315 nargs += 1; 316 } // if 317 args[nargs] = "-I" CFA_INCDIR "/concurrency"; 318 nargs += 1; 319 args[nargs] = "-I" CFA_INCDIR "/containers"; 320 nargs += 1; 340 if( !intree ) { 341 args[nargs] = "-I" CFA_INCDIR; 342 nargs += 1; 343 if ( ! noincstd_flag ) { // do not use during build 344 args[nargs] = "-I" CFA_INCDIR "/stdhdr"; 345 nargs += 1; 346 } // if 347 args[nargs] = "-I" CFA_INCDIR "/concurrency"; 348 nargs += 1; 349 args[nargs] = "-I" CFA_INCDIR "/containers"; 350 nargs += 1; 351 } else { 352 args[nargs] = "-I" TOP_SRCDIR "libcfa/src"; 353 nargs += 1; 354 if ( ! noincstd_flag ) { // do not use during build 355 args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/stdhdr"; 356 nargs += 1; 357 } // if 358 args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/concurrency"; 359 nargs += 1; 360 args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/containers"; 361 nargs += 1; 362 } 321 363 322 364 // add stdbool to get defines for bool/true/false … … 326 368 nargs += 1; 327 369 328 #ifdef HAVE_LIBCFA 370 string libbase; 371 if( !intree ) { 372 libbase = CFA_LIBDIR; 373 } else { 374 libbase = TOP_BUILDDIR "libcfa/"; 375 args[nargs] = "-D__CFA_FLAG__=-t"; 376 nargs += 1; 377 } 378 379 const char * const arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU); 380 const char * config = debug ? "debug": "nodebug"; 381 string libdir = libbase + arch + "-" + config; 382 if( !dirExists(libdir) ) { 383 cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl; 384 cerr << "Was looking for " << libdir << endl; 385 libdir = libbase + arch + "-" + "nolib"; 386 } 387 388 if( !dirExists(libdir) ) { 389 cerr << argv[0] << " internal error, cannot find prelude directory." << endl; 390 cerr << "Was looking for " << libdir << endl; 391 exit( EXIT_FAILURE ); 392 } 393 394 args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir + (intree ? "/prelude" : "")) ).c_str(); 395 nargs += 1; 396 329 397 if ( link ) { 330 #if ! defined(HAVE_LIBCFA_RELEASE)331 if ( ! debug ) {332 cerr << "error: Option -nodebug is unavailable, libcfa was not installed." << endl;333 exit( EXIT_FAILURE );334 } // if335 #endif336 #if ! defined(HAVE_LIBCFA_DEBUG)337 if ( debug ) {338 cerr << "error: Option -debug is unavailable, libcfa-d was not installed." << endl;339 exit( EXIT_FAILURE );340 } // if341 #endif342 343 398 args[nargs] = "-Xlinker"; 344 399 nargs += 1; … … 359 414 360 415 // include the cfa library in case it's needed 361 args[nargs] = "-L" CFA_LIBDIR; 362 nargs += 1; 363 if ( debug ) { 364 args[nargs] = "-lcfa-d"; 365 } else { 366 args[nargs] = "-lcfa"; 367 } // if 416 args[nargs] = ( *new string( string("-L" ) + libdir + (intree ? "/src" : "")) ).c_str(); 417 nargs += 1; 418 args[nargs] = "-lcfa"; 368 419 nargs += 1; 369 420 args[nargs] = "-lpthread"; … … 374 425 nargs += 1; 375 426 } // if 376 #endif // HAVE_LIBCFA377 427 378 428 // Add exception flags (unconditionally) … … 420 470 421 471 if ( Bprefix.length() == 0 ) { 422 Bprefix = installlibdir;472 Bprefix = !intree ? installlibdir : srcdriverdir; 423 473 args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str(); 424 474 nargs += 1; 425 475 } // if 426 476 427 args[nargs] = "-Xlinker"; // used by backtrace428 nargs += 1;429 args[nargs] = "-export-dynamic";430 nargs += 1;477 args[nargs] = "-Xlinker"; // used by backtrace 478 nargs += 1; 479 args[nargs] = "-export-dynamic"; 480 nargs += 1; 431 481 432 482 // execute the compilation command
Note:
See TracChangeset
for help on using the changeset viewer.