aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/runtime.h
blob: d8fb00c2725dac277d508cbf0491bfdd449dbaaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// runtime.h -- runtime functions called by generated code  -*- C++ -*-

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

#ifndef GO_RUNTIME_H
#define GO_RUNTIME_H

class Gogo;
class Type;
class Named_object;
class Call_expression;

class Runtime
{
 public:

  // The runtime functions which may be called by generated code.
  enum Function
  {

#define DEF_GO_RUNTIME(CODE, NAME, PARAMS, RESULTS) CODE ,

#include "runtime.def"

#undef DEF_GO_RUNTIME

    // Number of runtime functions.
    NUMBER_OF_FUNCTIONS
  };

  static Call_expression*
  make_call(Function, source_location, int, ...);

  static void
  convert_types(Gogo*);

  static Type*
  map_iteration_type();

 private:
  static Named_object*
  runtime_declaration(Function);
};

#endif // !defined(GO_BUILTINS_H)