aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate/translation.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-12-29 08:20:50 +0100
committerTristan Gingold <tgingold@free.fr>2014-12-29 08:20:50 +0100
commit17082aaf70426f2204b4259e45b1ca6e315bd439 (patch)
treee92e12bf92c6b6c4e52d92981ce75d430750d225 /src/vhdl/translate/translation.adb
parentf77be8349e5c0d5924222af0c5fc059c6ae5b271 (diff)
downloadghdl-17082aaf70426f2204b4259e45b1ca6e315bd439.tar.gz
ghdl-17082aaf70426f2204b4259e45b1ca6e315bd439.tar.bz2
ghdl-17082aaf70426f2204b4259e45b1ca6e315bd439.zip
Rework string literals: store literals position.
Diffstat (limited to 'src/vhdl/translate/translation.adb')
-rw-r--r--src/vhdl/translate/translation.adb12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/vhdl/translate/translation.adb b/src/vhdl/translate/translation.adb
index 7ba0085e1..164a2e5a4 100644
--- a/src/vhdl/translate/translation.adb
+++ b/src/vhdl/translate/translation.adb
@@ -22,6 +22,7 @@ with Ada.Text_IO;
with Types; use Types;
with Errorout; use Errorout;
with Name_Table; -- use Name_Table;
+with Str_Table;
with Files_Map;
with Iirs_Utils; use Iirs_Utils;
with Std_Package; use Std_Package;
@@ -76,14 +77,13 @@ package body Translation is
Spec := Get_Attribute_Specification (Attr);
Expr := Get_Expression (Spec);
case Get_Kind (Expr) is
- when Iir_Kind_String_Literal =>
+ when Iir_Kind_String_Literal8 =>
declare
- Ptr : String_Fat_Acc;
+ Id : constant String8_Id := Get_String8_Id (Expr);
begin
- Ptr := Get_String_Fat_Acc (Expr);
Name_Length := Natural (Get_String_Length (Expr));
for I in 1 .. Name_Length loop
- Name_Buffer (I) := Ptr (Nat32 (I));
+ Name_Buffer (I) := Str_Table.Char_String8 (Id, Pos32 (I));
end loop;
end;
when Iir_Kind_Simple_Aggregate =>
@@ -104,10 +104,6 @@ package body Translation is
Character'Val (Get_Enum_Pos (El));
end loop;
end;
- when Iir_Kind_Bit_String_Literal =>
- Error_Msg_Sem
- ("value of FOREIGN attribute cannot be a bit string", Expr);
- Name_Length := 0;
when others =>
if Get_Expr_Staticness (Expr) /= Locally then
Error_Msg_Sem