323 Commits

Author SHA1 Message Date
Vadim Godunko
a7bf353161 Use overlay object to convert simple types. 2025-01-24 16:39:26 +04:00
Vadim Godunko
8d94ecfee6 UC16-012 Generate pragma Warning to turn off warnings...
... about unnecessary with of ancestor package.

Change-Id: If8b6919e26b0a71290f899a09de6598cc7bc3e98
2021-12-31 00:05:48 +03:00
Vadim Godunko
09ce7d1465 UC16-012 Remove unnecessary pragma Unreferenced.
Change encoding of the files to UTF-8 to pass precommit check.

Change-Id: I45a5a795c6b131edfa0f6f16be84ab6a4bb502e5
2021-12-23 12:49:14 +03:00
Pascal Obry
909df49afa Remove superfluous with clauses.
Also kill redundant check for generated code from IDL.

This fixes compilation due to:

   warning: unnecessary with of ancestor [-gnatwr]

Change-Id: Iec9f29cdcc033afb4ba3d6f32d8aff7aacec6cfd
2021-12-15 11:36:46 +00:00
Eric Botcazou
f8504c3311 Fix build failure of PolyORB with GCC 11
This makes the test for introductory markers present in the preprocessed
output more robust.

[changelog]
	* compilers/iac/lexer.adb (Scan_Preprocessor_Directive): Skip all
	markers starting with line #0 in addition to special file names.

TN: U531-008
Change-Id: If5ee372bb662addf1b28054634604696e21ac7c5
2021-05-31 18:26:43 +02:00
Vadim Godunko
d81adbfd19 T825-011 Use Unchecked_Access to prevent fail of accessibility level checks
... in user's code.

Change-Id: Ifb9757f7f1e2ba1275e5e4d1594130252e9e3244
2020-09-01 17:17:02 +03:00
Bob Duff
9f1fd57d25 Disable new warning on allocators with anonymous access type
We might want to fix this in a "better" way someday (moving to named
access types).

Fixes S325-042
2019-06-06 16:41:36 +02:00
Thomas Quinot
36fd19d14c Fix regression caused by annotation application change
Skip_Annapp_Scan_Token must delegate error reporting to Scan_Token
for the error location to be properly displayed.
2018-07-11 11:06:26 +02:00
Oliver Kellogg
93153c2cd3 https://github.com/AdaCore/PolyORB/pull/1
- Move handling of annotation applications from lexer to parser:

compilers/iac/lexer.adb
- In procedure Scan_Token (Fatal : Boolean) case-statement decoding
  Buffer (Token_Location.Scan), reduce handling of '@' to just assign
  T_At to Token, i.e. do not advance the scan location over the
  annotation application.

compilers/iac/parser.adb
- New procedure Skip_Annapp_Scan_Token (T : Token_Type := T_Error) is
  similar to Scan_Token but skips any annotation applications that may
  exist at the scanner's current location.
  The optional parameter T is the expected token type.
  If left at its default (T_Error), no specific token type is expected.
- New procedure Skip_Annapp_Scan_Token (State : in out Location) is
  similar to the above but updates the given scanner state on skipping
  annotation applications.
- New function Skip_Annapp_Next_Token return Token_Type is similar to
  Next_Token but skip any annotation applications that may exist at the
  scanner's current location, advancing the scan location while this is
  the case.
- In function P_Attribute_Declaration replace initial Scan_Token call
  by Skip_Annapp_Scan_Token.
- In function P_Constant_Expression fix comment in loop `while not
  Is_Expression_Completed'.
- In function P_Definition replace initial Scan_Token call by
  Skip_Annapp_Scan_Token (State).
- In function P_Identifier replace call to Scan_Token (T_Identifier) by
  Skip_Annapp_Scan_Token (T_Identifier).
- In function P_Operation_Declaration replace initial calls to
  Scan_Token by calls to Skip_Annapp_Scan_Token (State).
- In function P_Simple_Type_Spec replace initial Next_Token call by
  Skip_Annapp_Next_Token.
- In function P_State_Member replace initial Scan_Token call by
  Skip_Annapp_Scan_Token (State).

testsuite/idls/annapp01/tin.idl
testsuite/idls/annapp01/test.out
testsuite/idls/MANIFEST
- Start testing annotation applications.
2018-06-18 10:22:09 +02:00
Oliver Kellogg
0df933e21d Followup to commit 2b691e0 (make IAC ignore IDL4 annotations):
Address review comment at https://github.com/AdaCore/PolyORB/pull/1,
> [...] the part between parentheses in an annotation application is a
> <const_expr>, which may itself contain nested parentheses.

compilers/iac/lexer.adb
- In procedure Scan_Token (Fatal : Boolean) case-statement decoding
  Buffer (Token_Location.Scan), at handling of '@' followed by '(',
  new counter `Parentheses' keeps track of opening/closing parentheses
  to account for embedded parentheses in the loop which skips to the
  ending ')' of the annotation application.
2018-05-31 11:47:48 +02:00
Oliver Kellogg
2b691e0b96 Make IAC ignore IDL4 annotation applications:
compilers/iac/lexer.ads
- In Token_Type add T_At.

compilers/iac/lexer.adb
- In procedure Process, in then-part of `if not Initialized' add call
    New_Token (T_At, "@");
- In procedure Scan_Token (Fatal : Boolean) case-statement decoding
  Buffer (Token_Location.Scan) add handling of '@':
  - If the following token is an identifier then skip the identifier
    and whitespace that may follow it; if the following token is '('
    then seek ')' and increment Token_Location.Scan to the index after
    the ')'.  Do not modify the value of Token.
  - Otherwise set Token to T_At.
2018-05-26 22:30:16 +02:00
Thomas Quinot
dfc0063cdb Remove useless "use type" clause in Helpers generated code
Followup on PA07-083

Subversion-branch: /trunk/polyorb
Subversion-revision: 259585
2018-01-03 11:39:12 +00:00
Bob Duff
eac8338f79 The IDL-to-Ada compiler iac now ignores pragma javaPackage, as requested
by a customer. This is a convenience for those also using idlj
(idl-to-java), because idlj recognizes that pragma.

Fixes Q621-023

Subversion-branch: /trunk/polyorb
Subversion-revision: 257245
2017-08-11 21:00:17 +00:00
Thomas Quinot
f6b1d049af Remove unnecessary use-type and use-package clauses
These redundant clauses will be flagged by the compiler in the near
future (PA07-083).

Q725-034

Subversion-branch: /trunk/polyorb
Subversion-revision: 257110
2017-08-02 08:40:59 +00:00
Thomas Quinot
11cea37a26 Remove unnecessary duplicated code blocks
One suspicious case remains in
compilers/iac/backend-be_corba_ada-common.adb.

Q210-015

Subversion-branch: /trunk/polyorb
Subversion-revision: 254360
2017-02-10 19:54:47 +00:00
Thomas Quinot
8112d0c69c (Initialize_Routine): Fix reference to wrong TypeCode object
For an interface, we generate two typecode objects: one in
the enclosing scope, and one in the interface's own scope.
When initializing the object in the enclosing scope, do not
erroneously reference that in the interface scope.

Fixes P921-037

Subversion-branch: /trunk/polyorb
Subversion-revision: 251246
2016-09-21 20:29:37 +00:00
Thomas Quinot
622ebd9309 Remove command line limitations
N923-009

Subversion-branch: /trunk/polyorb
Subversion-revision: 232593
2014-09-23 11:17:17 +00:00
Thomas Quinot
bba5ae4fa9 (Push_Scope): When entering a scope, its identifiers must be
inserted in the homonyms chain in the order they were declared
so that later reopening of modules correctly override earlier
ones.

Further fix for N909-046

Subversion-branch: /trunk/polyorb
Subversion-revision: 232591
2014-09-23 10:34:50 +00:00
Thomas Quinot
0b79c46d5e Followup on previous change completing fix for regression introduced
by change for N723-007

Subversion-branch: /trunk/polyorb
Subversion-revision: 232451
2014-09-17 10:05:27 +00:00
Thomas Quinot
37880c9045 (Scan_Preprocessor_Directive): If a line number has been read, subtract
1
from it to compensate for incrementation by Skip_Line.

Fixes regression introduced by change for N723-007

Subversion-branch: /trunk/polyorb
Subversion-revision: 232397
2014-09-16 08:37:54 +00:00
Thomas Quinot
999661ef02 (Scopes.Push_Scope): Need to update Potential_Scope of identifiers when
reopening a module so that they are correctly visible further on.

In backends, ignore instances of a module that has been reopened further
on, to prevent duplicate processing.

Fix for N909-046

Subversion-branch: /trunk/polyorb
Subversion-revision: 232364
2014-09-15 16:42:03 +00:00
Thomas Quinot
784e850113 Minor reformatting
Subversion-branch: /trunk/polyorb
Subversion-revision: 232363
2014-09-15 16:37:20 +00:00
Thomas Quinot
641d24aa32 Minor reformatting
Subversion-branch: /trunk/polyorb
Subversion-revision: 232362
2014-09-15 16:36:31 +00:00
Thomas Quinot
dff91099bb If a preprocessor line has a filename with an incorrect suffix, ignore
the
entire line.
Part of N723-007

Subversion-branch: /trunk/polyorb
Subversion-revision: 230843
2014-07-23 10:46:42 +00:00
Bob Duff
bee6c5ed4a Fix incorrect parsing of unary minus when it appears to the left of ".."
in a
pragma range, as in:
#pragma range X -1 .. 10
MB27-043

Subversion-branch: /trunk/polyorb
Subversion-revision: 223388
2014-02-14 23:18:35 +00:00