1 /* brig-label-handler.cc -- brig label directive handling
2 Copyright (C) 2016-2018 Free Software Foundation, Inc.
3 Contributed by Pekka Jaaskelainen <pekka.jaaskelainen@parmance.com>
4 for General Processor Tech.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 #include "brig-code-entry-handler.h"
25 brig_directive_label_handler::operator () (const BrigBase
*base
)
27 const BrigDirectiveLabel
*brig_label
= (const BrigDirectiveLabel
*) base
;
29 const BrigData
*label_name
= m_parent
.get_brig_data_entry (brig_label
->name
);
31 std::string
label_str ((const char *) (label_name
->bytes
),
32 label_name
->byteCount
);
34 m_parent
.m_cf
->start_new_bb ();
36 tree stmt
= build_stmt (LABEL_EXPR
, m_parent
.m_cf
->label (label_str
));
37 m_parent
.m_cf
->append_statement (stmt
);
39 return base
->byteCount
;