summaryrefslogtreecommitdiff
path: root/gcc/ada/frontend.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-06 10:28:20 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-06 10:28:20 +0000
commit10084566be31ecd52f2e12b8fcd96a50a1280190 (patch)
treedf83e6dc366f99ae70040eaadf579657a8c0ee80 /gcc/ada/frontend.adb
parent378089464983e017bc55756470c487ac25fa4c55 (diff)
downloadgcc-10084566be31ecd52f2e12b8fcd96a50a1280190.tar.gz
2007-04-20 Vincent Celier <celier@adacore.com>
Robert Dewar <dewar@adacore.com> * frontend.adb (Frontend): Return immediately if the main source could not be parsed, because of preprocessing errors. * gnat1drv.adb (gnat1drv): Handle RE_Not_Available gracefully. (Gnat1drv): Exit with errors if the main source could not be parsed, because of preprocessing errors. (Check_Rep_Info): New procedure git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125411 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/frontend.adb')
-rw-r--r--gcc/ada/frontend.adb22
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/ada/frontend.adb b/gcc/ada/frontend.adb
index 361f45a9eaa..cc5c2cb849f 100644
--- a/gcc/ada/frontend.adb
+++ b/gcc/ada/frontend.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -24,7 +24,7 @@
-- --
------------------------------------------------------------------------------
-with GNAT.Strings; use GNAT.Strings;
+with System.Strings; use System.Strings;
with Atree; use Atree;
with Checks;
@@ -34,7 +34,6 @@ with Elists;
with Exp_Dbug;
with Fmap;
with Fname.UF;
-with Hostparm; use Hostparm;
with Inline; use Inline;
with Lib; use Lib;
with Lib.Load; use Lib.Load;
@@ -56,6 +55,7 @@ with Sem_Warn; use Sem_Warn;
with Sinfo; use Sinfo;
with Sinput; use Sinput;
with Sinput.L; use Sinput.L;
+with Targparm; use Targparm;
with Tbuild; use Tbuild;
with Types; use Types;
@@ -107,6 +107,12 @@ begin
Lib.Load.Load_Main_Source;
+ -- Return immediately if the main source could not be parsed
+
+ if Sinput.Main_Source_File = No_Source_File then
+ return;
+ end if;
+
-- Read and process configuration pragma files if present
declare
@@ -208,6 +214,12 @@ begin
Opt.Register_Opt_Config_Switches;
+ -- Check for file which contains No_Body pragma
+
+ if Source_File_Is_No_Body (Source_Index (Main_Unit)) then
+ Change_Main_Unit_To_Spec;
+ end if;
+
-- Initialize the scanner. Note that we do this after the call to
-- Create_Standard, which uses the scanner in its processing of
-- floating-point bounds.
@@ -318,11 +330,11 @@ begin
end if;
-- Qualify all entity names in inner packages, package bodies, etc.,
- -- except when compiling for the JVM back end, which depends on
+ -- except when compiling for the VM back-ends, which depend on
-- having unqualified names in certain cases and handles the
-- generation of qualified names when needed.
- if not Java_VM then
+ if VM_Target = No_VM then
Exp_Dbug.Qualify_All_Entity_Names;
end if;