]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/rust/ast/rust-macro.cc
1 // Copyright (C) 2020-2024 Free Software Foundation, Inc.
3 // This file is part of GCC.
5 // GCC is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU General Public License as published by the Free
7 // Software Foundation; either version 3, or (at your option) any later
10 // GCC is distributed in the hope that it will be useful, but WITHOUT ANY
11 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 // You should have received a copy of the GNU General Public License
16 // along with GCC; see the file COPYING3. If not see
17 // <http://www.gnu.org/licenses/>.
19 #include "rust-macro.h"
25 builtin_macro_from_string (const std::string
&identifier
)
27 if (identifier
== "assert")
28 return BuiltinMacro::Assert
;
30 if (identifier
== "file")
31 return BuiltinMacro::File
;
33 if (identifier
== "line")
34 return BuiltinMacro::Line
;
36 if (identifier
== "column")
37 return BuiltinMacro::Column
;
39 if (identifier
== "include_bytes")
40 return BuiltinMacro::IncludeBytes
;
42 if (identifier
== "include_str")
43 return BuiltinMacro::IncludeStr
;
45 if (identifier
== "compile_error")
46 return BuiltinMacro::CompileError
;
48 if (identifier
== "concat")
49 return BuiltinMacro::Concat
;
51 if (identifier
== "env")
52 return BuiltinMacro::Env
;
54 if (identifier
== "cfg")
55 return BuiltinMacro::Cfg
;
57 if (identifier
== "include")
58 return BuiltinMacro::Include
;