diff options
author | Viljar Indus <indus@adacore.com> | 2024-09-16 12:14:00 +0300 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-11-26 10:49:34 +0100 |
commit | 7cdb07a77bac31dc39f8eea2e7eaabf99bbd00ab (patch) | |
tree | 2cd6ffe453d67771b3bc54623f9ca322c5b4cb16 /gcc/ada/diagnostics.adb | |
parent | 92e782e7758b068a6399c97f8b8e1972d67b0739 (diff) | |
download | gcc-7cdb07a77bac31dc39f8eea2e7eaabf99bbd00ab.zip gcc-7cdb07a77bac31dc39f8eea2e7eaabf99bbd00ab.tar.gz gcc-7cdb07a77bac31dc39f8eea2e7eaabf99bbd00ab.tar.bz2 |
ada: Simplify code
gcc/ada/ChangeLog:
* diagnostics-converter.adb: Remove uses of Info_Warning type. Use
common constructors to simplify implementation.
* diagnostics-pretty_emitter.adb: Remove Info_Warning type.
* diagnostics-utils.adb: Remove uses of Info_Warning.
* diagnostics.adb: Simplify implementation of Primary_Location.
* diagnostics.ads: Remove Info_Warning type.
Diffstat (limited to 'gcc/ada/diagnostics.adb')
-rw-r--r-- | gcc/ada/diagnostics.adb | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/gcc/ada/diagnostics.adb b/gcc/ada/diagnostics.adb index 8acc915..c9c5483 100644 --- a/gcc/ada/diagnostics.adb +++ b/gcc/ada/diagnostics.adb @@ -119,19 +119,8 @@ package body Diagnostics is function Primary_Location (Diagnostic : Sub_Diagnostic_Type) return Labeled_Span_Type is - use Labeled_Span_Lists; - Loc : Labeled_Span_Type; - - It : Iterator := Iterate (Diagnostic.Locations); begin - while Has_Next (It) loop - Next (It, Loc); - if Loc.Is_Primary then - return Loc; - end if; - end loop; - - return (others => <>); + return Get_Primary_Labeled_Span (Diagnostic.Locations); end Primary_Location; ------------------ |