diff options
author | Gaius Mulley <gaiusmod2@gmail.com> | 2023-04-30 02:53:23 +0100 |
---|---|---|
committer | Gaius Mulley <gaiusmod2@gmail.com> | 2023-04-30 02:53:23 +0100 |
commit | d5e2694e82591d734008982bafdc9ce6da65c0b0 (patch) | |
tree | 0efdc9a2d1ecb6d1e64dfac87b2de1a9dceafec4 /libcpp | |
parent | 8eb1e39441723b0c38b13d300912a281b41fbd80 (diff) | |
download | gcc-d5e2694e82591d734008982bafdc9ce6da65c0b0.zip gcc-d5e2694e82591d734008982bafdc9ce6da65c0b0.tar.gz gcc-d5e2694e82591d734008982bafdc9ce6da65c0b0.tar.bz2 |
Remove duplicate constants created between passes
There is no need to re-create constant literals between passes.
This patch creates a constant pool and reuses a constant literal
providing it is created at the same location. This in turn avoids
generating duplicate overflow error messages when encountering an
out of range constant literal.
gcc/m2/ChangeLog:
* gm2-compiler/SymbolTable.mod (ConstLitPoolEntry): New
pointer to record.
(ConstLitSym): New field RangeError.
(ConstLitPoolTree): New SymbolTree representing name to
index.
(ConstLitArray): New dynamic array containing pointers
to a ConstLitPoolEntry.
(CreateConstLit): New procedure function.
(LookupConstLitPoolEntry): New procedure function.
(AddConstLitPoolEntry): New procedure function.
(MakeConstLit): Re-implemented to check the constant lit
pool before calling CreateConstLit.
* m2.flex: Add ability to decode binary constant literals.
gcc/testsuite/ChangeLog:
* gm2/pim/run/pass/constlitbase.mod: New test.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions