summaryrefslogtreecommitdiff
path: root/frontends/verilog
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-12-05 12:53:49 +0100
committerClifford Wolf <clifford@clifford.at>2013-12-05 12:53:49 +0100
commit5c39948eadbcda58d0b880dc162572838dad01a2 (patch)
tree9b9559eb0fb352e776e7dd5984fac97d4bf20668 /frontends/verilog
parent853538d78b0207ca218524cb766fd5cdb165478d (diff)
Added AstNode::mkconst_str API
Diffstat (limited to 'frontends/verilog')
-rw-r--r--frontends/verilog/parser.y13
1 files changed, 1 insertions, 12 deletions
diff --git a/frontends/verilog/parser.y b/frontends/verilog/parser.y
index 01c9a009..f47d1785 100644
--- a/frontends/verilog/parser.y
+++ b/frontends/verilog/parser.y
@@ -1053,18 +1053,7 @@ basic_expr:
delete $1;
} |
TOK_STRING {
- std::string str = *$1;
- std::vector<RTLIL::State> data;
- data.reserve(str.size() * 8);
- for (size_t i = 0; i < str.size(); i++) {
- unsigned char ch = str[str.size() - i - 1];
- for (int j = 0; j < 8; j++) {
- data.push_back((ch & 1) ? RTLIL::S1 : RTLIL::S0);
- ch = ch >> 1;
- }
- }
- $$ = AstNode::mkconst_bits(data, false);
- $$->str = str;
+ $$ = AstNode::mkconst_str(*$1);
delete $1;
} |
hierarchical_id attr {