projects
/
platform
/
upstream
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca290f1
)
[Ada] Simplify returning from Enclosing_Comp_Unit_Node
author
Piotr Trojanek
<trojanek@adacore.com>
Tue, 11 May 2021 11:01:35 +0000
(13:01 +0200)
committer
Pierre-Marie de Rodat
<derodat@adacore.com>
Tue, 6 Jul 2021 14:46:57 +0000
(14:46 +0000)
gcc/ada/
* sem_util.adb (Enclosing_Comp_Unit_Node): When the loop exits
the Current_Node is either an N_Compilation_Unit node or Empty,
so simply return it without redundant checks.
gcc/ada/sem_util.adb
patch
|
blob
|
history
diff --git
a/gcc/ada/sem_util.adb
b/gcc/ada/sem_util.adb
index
cfb3293
..
9d54309
100644
(file)
--- a/
gcc/ada/sem_util.adb
+++ b/
gcc/ada/sem_util.adb
@@
-8037,11
+8037,7
@@
package body Sem_Util is
Current_Node := Parent (Current_Node);
end loop;
- if Nkind (Current_Node) /= N_Compilation_Unit then
- return Empty;
- else
- return Current_Node;
- end if;
+ return Current_Node;
end Enclosing_Comp_Unit_Node;
--------------------------