Skip to content

Commit 0b46175

Browse files
macro: Add source containing builtin definitions
Co-authored-by: philberty <philip.herron@embecosm.com>
1 parent 10de9cf commit 0b46175

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

gcc/rust/Make-lang.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ GRS_OBJS = \
7575
rust/rust-compile-resolve-path.o \
7676
rust/rust-macro-expand.o \
7777
rust/rust-macro-invoc-lexer.o \
78+
rust/rust-macro-builtins.o \
7879
rust/rust-hir-full-test.o \
7980
rust/rust-hir-map.o \
8081
rust/rust-attributes.o \
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (C) 2020-2022 Free Software Foundation, Inc.
2+
3+
// This file is part of GCC.
4+
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
8+
// version.
9+
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
13+
// for more details.
14+
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/>.
18+
19+
#include "rust-macro-builtins.h"
20+
#include "rust-diagnostics.h"
21+
22+
namespace Rust {
23+
AST::ASTFragment
24+
MacroBuiltin::assert (Location invoc_locus, AST::MacroInvocData &invoc)
25+
{
26+
rust_debug ("assert!() called");
27+
28+
return AST::ASTFragment::create_empty ();
29+
}
30+
} // namespace Rust

gcc/rust/expand/rust-macro-builtins.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright (C) 2020-2022 Free Software Foundation, Inc.
2+
3+
// This file is part of GCC.
4+
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
8+
// version.
9+
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
13+
// for more details.
14+
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/>.
18+
19+
#ifndef RUST_MACRO_BUILTINS_H
20+
#define RUST_MACRO_BUILTINS_H
21+
22+
#include "rust-ast.h"
23+
#include "rust-location.h"
24+
25+
namespace Rust {
26+
class MacroBuiltin
27+
{
28+
public:
29+
static AST::ASTFragment assert (Location invoc_locus,
30+
AST::MacroInvocData &invoc);
31+
};
32+
} // namespace Rust
33+
34+
#endif // RUST_MACRO_BUILTINS_H

0 commit comments

Comments
 (0)