- Timestamp:
- Aug 9, 2018, 6:35:02 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:
- ea5b7d6
- Parents:
- fb975a50 (diff), 0c827019 (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:
-
- 1 added
- 4 moved
-
Makefile.am (moved) (moved from src/driver/Makefile.am ) (2 diffs)
-
Makefile.in (moved) (moved from src/driver/Makefile.in ) (12 diffs)
-
as.cc (added)
-
cc1.cc (moved) (moved from src/driver/cc1.cc )
-
cfa.cc (moved) (moved from src/driver/cfa.cc ) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
driver/Makefile.am
rfb975a50 r455a7d5 11 11 ## Created On : Sun May 31 08:49:31 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Mon Apr 30 17:44:17201814 ## Update Count : 1 113 ## Last Modified On : Thu Aug 2 12:18:25 2018 14 ## Update Count : 14 15 15 ############################################################################### 16 16 17 17 # applies to both programs 18 18 AM_CXXFLAGS = -Wall -O2 -g -std=c++14 -I${abs_top_srcdir}/src 19 if BUILD_NO_LIB20 else21 AM_CXXFLAGS += -DHAVE_LIBCFA22 endif23 if BUILD_DEBUG24 AM_CXXFLAGS += -DHAVE_LIBCFA_DEBUG25 endif26 if BUILD_RELEASE27 AM_CXXFLAGS += -DHAVE_LIBCFA_RELEASE28 endif29 19 30 20 # don't install cfa directly … … 45 35 # put into lib for now 46 36 cc1libdir = ${CFA_LIBDIR} 47 cc1lib_PROGRAMS = cc1 37 cc1lib_PROGRAMS = as cc1 38 as_SOURCES = as.cc 48 39 cc1_SOURCES = cc1.cc 49 40 -
driver/Makefile.in
rfb975a50 r455a7d5 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 subdir = src/driver95 cc1lib_PROGRAMS = as$(EXEEXT) cc1$(EXEEXT) 96 subdir = driver 100 97 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 101 am__aclocal_m4_deps = $(top_srcdir)/configure.ac 98 am__aclocal_m4_deps = $(top_srcdir)/automake/cfa.m4 \ 99 $(top_srcdir)/configure.ac 102 100 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 103 101 $(ACLOCAL_M4) … … 109 107 am__installdirs = "$(DESTDIR)$(cc1libdir)" 110 108 PROGRAMS = $(cc1lib_PROGRAMS) $(noinst_PROGRAMS) 109 am_as_OBJECTS = as.$(OBJEXT) 110 as_OBJECTS = $(am_as_OBJECTS) 111 as_LDADD = $(LDADD) 111 112 am_cc1_OBJECTS = cc1.$(OBJEXT) 112 113 cc1_OBJECTS = $(am_cc1_OBJECTS) … … 144 145 am__v_CXXLD_0 = @echo " CXXLD " $@; 145 146 am__v_CXXLD_1 = 146 SOURCES = $( cc1_SOURCES) $(cfa_SOURCES)147 DIST_SOURCES = $( cc1_SOURCES) $(cfa_SOURCES)147 SOURCES = $(as_SOURCES) $(cc1_SOURCES) $(cfa_SOURCES) 148 DIST_SOURCES = $(as_SOURCES) $(cc1_SOURCES) $(cfa_SOURCES) 148 149 am__can_run_installinfo = \ 149 150 case $$AM_UPDATE_INFO_DIR in \ … … 181 182 AWK = @AWK@ 182 183 BACKEND_CC = @BACKEND_CC@ 184 BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@ 183 185 CC = @CC@ 184 186 CCAS = @CCAS@ … … 186 188 CCASFLAGS = @CCASFLAGS@ 187 189 CCDEPMODE = @CCDEPMODE@ 190 CFACC = @CFACC@ 191 CFACPP = @CFACPP@ 188 192 CFA_BACKEND_CC = @CFA_BACKEND_CC@ 189 193 CFA_BINDIR = @CFA_BINDIR@ … … 202 206 DEFS = @DEFS@ 203 207 DEPDIR = @DEPDIR@ 208 DRIVER_DIR = @DRIVER_DIR@ 204 209 ECHO_C = @ECHO_C@ 205 210 ECHO_N = @ECHO_N@ … … 217 222 LEXLIB = @LEXLIB@ 218 223 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ 224 LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@ 225 LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@ 219 226 LIBOBJS = @LIBOBJS@ 220 227 LIBS = @LIBS@ 221 228 LTLIBOBJS = @LTLIBOBJS@ 222 MACHINE_TYPE = @MACHINE_TYPE@223 229 MAKEINFO = @MAKEINFO@ 224 230 MKDIR_P = @MKDIR_P@ … … 236 242 SHELL = @SHELL@ 237 243 STRIP = @STRIP@ 244 TARGET_HOSTS = @TARGET_HOSTS@ 238 245 VERSION = @VERSION@ 239 246 YACC = @YACC@ … … 293 300 294 301 # applies to both programs 295 AM_CXXFLAGS = -Wall -O2 -g -std=c++14 -I${abs_top_srcdir}/src \ 296 $(am__append_1) $(am__append_2) $(am__append_3) 302 AM_CXXFLAGS = -Wall -O2 -g -std=c++14 -I${abs_top_srcdir}/src 297 303 cfa_SOURCES = cfa.cc 298 304 299 305 # put into lib for now 300 306 cc1libdir = ${CFA_LIBDIR} 307 as_SOURCES = as.cc 301 308 cc1_SOURCES = cc1.cc 302 309 MAINTAINERCLEANFILES = $(CFA_BINDIR)/$(CFA_NAME) @CFA_PREFIX@/lib/${cc1lib_PROGRAMS} … … 314 321 esac; \ 315 322 done; \ 316 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/driver/Makefile'; \323 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign driver/Makefile'; \ 317 324 $(am__cd) $(top_srcdir) && \ 318 $(AUTOMAKE) --foreign src/driver/Makefile325 $(AUTOMAKE) --foreign driver/Makefile 319 326 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 320 327 @case '$?' in \ … … 380 387 -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) 381 388 389 as$(EXEEXT): $(as_OBJECTS) $(as_DEPENDENCIES) $(EXTRA_as_DEPENDENCIES) 390 @rm -f as$(EXEEXT) 391 $(AM_V_CXXLD)$(CXXLINK) $(as_OBJECTS) $(as_LDADD) $(LIBS) 392 382 393 cc1$(EXEEXT): $(cc1_OBJECTS) $(cc1_DEPENDENCIES) $(EXTRA_cc1_DEPENDENCIES) 383 394 @rm -f cc1$(EXEEXT) … … 394 405 -rm -f *.tab.c 395 406 407 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/as.Po@am__quote@ 396 408 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cc1.Po@am__quote@ 397 409 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfa.Po@am__quote@ -
driver/cfa.cc
rfb975a50 r455a7d5 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; 321 322 #ifdef HAVE_LIBCFA 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 } 363 364 string libbase; 365 if( !intree ) { 366 libbase = CFA_LIBDIR; 367 } else { 368 libbase = TOP_BUILDDIR "libcfa/"; 369 args[nargs] = "-D__CFA_FLAG__=-t"; 370 nargs += 1; 371 } 372 373 const char * const arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU); 374 const char * config = debug ? "debug": "nodebug"; 375 string libdir = libbase + arch + "-" + config; 376 if( !dirExists(libdir) ) { 377 cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl; 378 cerr << "Was looking for " << libdir << endl; 379 libdir = libbase + arch + "-" + "nolib"; 380 } 381 382 if( !dirExists(libdir) ) { 383 cerr << argv[0] << " internal error, cannot find prelude directory." << endl; 384 cerr << "Was looking for " << libdir << endl; 385 exit( EXIT_FAILURE ); 386 } 387 388 args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir + (intree ? "/prelude" : "")) ).c_str(); 389 nargs += 1; 390 323 391 if ( link ) { 324 #if ! defined(HAVE_LIBCFA_RELEASE)325 if ( ! debug ) {326 cerr << "error: Option -nodebug is unavailable, libcfa was not installed." << endl;327 exit( EXIT_FAILURE );328 } // if329 #endif330 #if ! defined(HAVE_LIBCFA_DEBUG)331 if ( debug ) {332 cerr << "error: Option -debug is unavailable, libcfa-d was not installed." << endl;333 exit( EXIT_FAILURE );334 } // if335 #endif336 337 392 args[nargs] = "-Xlinker"; 338 393 nargs += 1; … … 347 402 args[nargs] = "--undefined=__cfaabi_appready_startup"; 348 403 nargs += 1; 404 args[nargs] = "-Xlinker"; 405 nargs += 1; 406 args[nargs] = "--undefined=__cfaabi_dbg_record"; 407 nargs += 1; 349 408 350 409 // include the cfa library in case it's needed 351 args[nargs] = "-L" CFA_LIBDIR; 352 nargs += 1; 353 if ( debug ) { 354 args[nargs] = "-lcfa-d"; 355 } else { 356 args[nargs] = "-lcfa"; 357 } // if 410 args[nargs] = ( *new string( string("-L" ) + libdir + (intree ? "/src" : "")) ).c_str(); 411 nargs += 1; 412 args[nargs] = "-lcfa"; 358 413 nargs += 1; 359 414 args[nargs] = "-lpthread"; … … 364 419 nargs += 1; 365 420 } // if 366 #endif // HAVE_LIBCFA367 421 368 422 // Add exception flags (unconditionally) … … 410 464 411 465 if ( Bprefix.length() == 0 ) { 412 Bprefix = installlibdir;466 Bprefix = !intree ? installlibdir : srcdriverdir; 413 467 args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str(); 414 468 nargs += 1; 415 469 } // if 416 470 417 args[nargs] = "-Xlinker"; // used by backtrace418 nargs += 1;419 args[nargs] = "-export-dynamic";420 nargs += 1;471 args[nargs] = "-Xlinker"; // used by backtrace 472 nargs += 1; 473 args[nargs] = "-export-dynamic"; 474 nargs += 1; 421 475 422 476 // execute the compilation command
Note:
See TracChangeset
for help on using the changeset viewer.