aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/errutil.adb
diff options
context:
space:
mode:
authorYannick Moy <moy@adacore.com>2022-10-27 12:54:22 +0200
committerMarc Poulhiès <poulhies@adacore.com>2022-11-14 14:46:49 +0100
commit04381a1bf49096ecc719bdf89a1f91a7554ca03a (patch)
treee8f29c356d78c6ff7d3d0550ccbbd225bb4b106a /gcc/ada/errutil.adb
parentc9d317bcd676256a4d982fa335f15a9fc7e39ade (diff)
downloadgcc-04381a1bf49096ecc719bdf89a1f91a7554ca03a.zip
gcc-04381a1bf49096ecc719bdf89a1f91a7554ca03a.tar.gz
gcc-04381a1bf49096ecc719bdf89a1f91a7554ca03a.tar.bz2
ada: Improve location of error messages in instantiations
When flag -gnatdF is used, source code lines are displayed to point the location of errors. The code of the instantiation was displayed in case of errors inside generic instances, which was not precise. Now the code inside the generic is displayed. gcc/ada/ * errout.adb (Error_Msg_Internal): Store span for Optr field, and adapt to new type of Optr. (Finalize. Output_JSON_Message, Remove_Warning_Messages): Adapt to new type of Optr. (Output_Messages): Use Optr instead of Sptr to display code snippet closer to error. * erroutc.adb (dmsg): Adapt to new type of Optr. * erroutc.ads (Error_Msg_Object): Make Optr a span like Sptr. * errutil.adb (Error_Msg): Likewise.
Diffstat (limited to 'gcc/ada/errutil.adb')
-rw-r--r--gcc/ada/errutil.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/errutil.adb b/gcc/ada/errutil.adb
index 921de31..887dc88 100644
--- a/gcc/ada/errutil.adb
+++ b/gcc/ada/errutil.adb
@@ -208,7 +208,7 @@ package body Errutil is
Prev => No_Error_Msg,
Sfile => Get_Source_File_Index (Sptr),
Sptr => To_Span (Sptr),
- Optr => Optr,
+ Optr => To_Span (Optr),
Insertion_Sloc => No_Location,
Line => Get_Physical_Line_Number (Sptr),
Col => Get_Column_Number (Sptr),