Coverage Report

Created: 2023-12-11 06:17

/proc/self/cwd/src/ir/operator.h
Line
Count
Source (jump to first uncovered line)
1
//-----------------------------------------------------------------------------
2
// Copyright 2021 Google LLC
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License");
5
// you may not use this file except in compliance with the License.
6
// You may obtain a copy of the License at
7
//
8
//     https://www.apache.org/licenses/LICENSE-2.0
9
//
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
// See the License for the specific language governing permissions and
14
// limitations under the License.
15
//----------------------------------------------------------------------------
16
#ifndef SRC_IR_OPERATOR_H_
17
#define SRC_IR_OPERATOR_H_
18
19
#include <cstdint>
20
#include <string>
21
22
#include "absl/strings/string_view.h"
23
24
namespace raksha::ir {
25
26
// Signature of an operator. An operator could be simple operators (e.g., `+`,
27
// `-`) or complex operators (e.g., particle, function) that is compose of other
28
// operations.
29
class Operator {
30
 public:
31
0
  Operator(absl::string_view name) : name_(name), number_of_return_values_(1) {}
32
  Operator(absl::string_view name, uint64_t number_of_return_values)
33
0
      : name_(name), number_of_return_values_(number_of_return_values) {}
34
0
  absl::string_view name() const { return name_; }
35
0
  uint64_t number_of_return_values() const { return number_of_return_values_; }
36
37
 private:
38
  std::string name_;
39
  uint64_t number_of_return_values_;
40
};
41
42
}  // namespace raksha::ir
43
44
#endif  // SRC_IR_OPERATOR_H_