aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/xref_lib.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2016-07-04 12:09:04 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2016-07-04 12:09:04 +0200
commit96df3ff4bd3b0f2ce63f519955f20f7d93612929 (patch)
tree9009e6f1cf9433a4d1de015b6f0b48fb40e0a7c9 /gcc/ada/xref_lib.adb
parent015f33d73ec6634c9b96637fff73c49ac5f0ba9f (diff)
downloadgcc-96df3ff4bd3b0f2ce63f519955f20f7d93612929.zip
gcc-96df3ff4bd3b0f2ce63f519955f20f7d93612929.tar.gz
gcc-96df3ff4bd3b0f2ce63f519955f20f7d93612929.tar.bz2
[multiple changes]
2016-07-04 Bob Duff <duff@adacore.com> * xref_lib.adb (Parse_X_Filename, Parse_Identifier_Info): Ignore unknown files. Check that File_Nr is in the range of files we know about. The previous code was checking the lower bound, but not the upper bound. 2016-07-04 Arnaud Charlet <charlet@adacore.com> * tracebak.c: Minor reformatting. 2016-07-04 Yannick Moy <moy@adacore.com> * sem_ch12.adb, sem_ch12.ads Update calls to Create_Instantiation_Source to use default argument. (Adjust_Inherited_Pragma_Sloc): New function to adjust sloc of inherited pragma. (Set_Copied_Sloc_For_Inherited_Pragma): New function that wraps call to Create_Instantiation_Source for copying an inherited pragma. (Set_Copied_Sloc_For_Inlined_Body): Update call to Create_Instantiation_Source with new arguments. * sem_prag.adb (Build_Pragma_Check_Equivalent): In the case of inherited pragmas, use the generic machinery to get chained locations for the pragma and its sub-expressions. * sinput-c.adb: Adapt to new type Source_File_Record. * sinput-l.adb, sinput-l.ads (Create_Instantiation_Source): Add parameter Inherited_Pragma and make parameter Inlined_Body optional. * sinput.adb, sinput.ads (Comes_From_Inherited_Pragma): New function to return when a location comes from an inherited pragma. (Inherited_Pragma): New function to detect when a location comes from an inherited pragma. (Source_File_Record): New component Inherited_Pragma. 2016-07-04 Yannick Moy <moy@adacore.com> * sem_elab.adb: Register existence of quickfix for error message. 2016-07-04 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Resolve_One_Call): In the context of a predicate function the formal and the actual in a call may have different views of the same type, because of the delayed analysis of predicates aspects. Extend the patch that handles this potential discrepancy to handle private and full views as well. * sem_ch8.adb (Find_Selected_Component): Refine predicate that produces additional error when an illegal selected component looks like a prefixed call whose first formal is untagged. From-SVN: r237963
Diffstat (limited to 'gcc/ada/xref_lib.adb')
-rw-r--r--gcc/ada/xref_lib.adb16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ada/xref_lib.adb b/gcc/ada/xref_lib.adb
index 2afec82..7cb7f10 100644
--- a/gcc/ada/xref_lib.adb
+++ b/gcc/ada/xref_lib.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2016, 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- --
@@ -890,8 +890,12 @@ package body Xref_Lib is
Parse_Token (Ali, Ptr, E_Name);
- -- Exit if the symbol does not match
- -- or if we have a local symbol and we do not want it
+ -- Exit if the symbol does not match or if we have a local
+ -- symbol and we do not want it or if the file is unknown.
+
+ if File.X_File = Empty_File then
+ return;
+ end if;
if (not Local_Symbols and not E_Global)
or else (Pattern.Initialized
@@ -1261,8 +1265,12 @@ package body Xref_Lib is
Ptr := Ptr + 1;
Parse_Number (Ali, Ptr, File_Nr);
- if File_Nr > 0 then
+ -- If the referenced file is unknown, we simply ignore it
+
+ if File_Nr in Dependencies_Tables.First .. Last (File.Dep) then
File.X_File := File.Dep.Table (File_Nr);
+ else
+ File.X_File := Empty_File;
end if;
Parse_EOL (Ali, Ptr);