00001 /* 00002 Copyright 2003, 2004, 2005, 2006 PathScale, Inc. All Rights Reserved. 00003 File modified June 20, 2003 by PathScale, Inc. to update Open64 C/C++ 00004 front-ends to GNU 3.2.2 release. 00005 */ 00006 00007 /* 00008 00009 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00010 00011 This program is free software; you can redistribute it and/or modify it 00012 under the terms of version 2 of the GNU General Public License as 00013 published by the Free Software Foundation. 00014 00015 This program is distributed in the hope that it would be useful, but 00016 WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00018 00019 Further, this software is distributed without any warranty that it is 00020 free of the rightful claim of any third person regarding infringement 00021 or the like. Any license provided herein, whether implied or 00022 otherwise, applies only to this software file. Patent licenses, if 00023 any, provided herein do not apply to combinations of this program with 00024 other software, or any other product whatsoever. 00025 00026 You should have received a copy of the GNU General Public License along 00027 with this program; if not, write the Free Software Foundation, Inc., 59 00028 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00029 00030 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00031 Mountain View, CA 94043, or: 00032 00033 http://www.sgi.com 00034 00035 For further information regarding this notice, see: 00036 00037 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00038 00039 */ 00040 00041 00042 /* main driver for front end */ 00043 #include <stdio.h> 00044 #include <stdlib.h> 00045 #include <cmplrs/rcodes.h> 00046 #include "wfe_misc.h" 00047 #include "glob.h" 00048 // #include "cmd_line.h" 00049 00050 // gnu_init returns file to compile, like t.i (not t.c!) 00051 extern char * gnu_init (INT argc, char **argv, char **envp); 00052 00053 extern void compile_file (const char *); 00054 extern void check_gnu_errors (INT *, INT *); 00055 00056 int 00057 main ( 00058 INT argc, /* Number of command line arguments */ 00059 char **argv, /* Array of command line arguments */ 00060 char **envp) /* Array of environment pointers */ 00061 { 00062 INT error_count, sorry_count; 00063 BOOL need_inliner; 00064 00065 Orig_Src_File_Name = gnu_init (argc, argv, envp); 00066 WFE_Init (argc, argv, envp); /* sgi initialization */ 00067 WFE_File_Init (argc, argv); /* inits per source file */ 00068 00069 if (Orig_Src_File_Name == NULL) { 00070 exit (RC_OKAY); 00071 } 00072 00073 compile_file (Orig_Src_File_Name); 00074 00075 WFE_File_Finish (); 00076 WFE_Finish (); 00077 00078 check_gnu_errors (&error_count, &sorry_count); 00079 if (error_count) 00080 exit (RC_USER_ERROR); 00081 if (sorry_count) 00082 exit (RC_USER_ERROR); 00083 00084 WFE_Check_Errors (&error_count, &sorry_count, &need_inliner); 00085 if (error_count) 00086 Terminate (RC_INTERNAL_ERROR) ; 00087 00088 if (sorry_count && warnings_are_errors) 00089 Terminate (RC_USER_ERROR) ; 00090 00091 if (need_inliner) 00092 exit ( RC_NEED_INLINER ); 00093 00094 exit (RC_OKAY); 00095 }
1.5.6