summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGIORuntime.h
blob: 1bebc559b365025a064cc01aa1f8fb0236375ac3 (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
//===----- CGIORuntime.h - Interface to IO Runtimes -------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This provides an abstract class for IO statements code generation.
//
//===----------------------------------------------------------------------===//

#ifndef FLANG_CODEGEN_IORUNTIME_H
#define FLANG_CODEGEN_IORUNTIME_H

#include "flang/AST/Stmt.h"

namespace flang {
namespace CodeGen {

class CodeGenFunction;
class CodeGenModule;

class CGIORuntime {
protected:
  CodeGenModule &CGM;

public:
  CGIORuntime(CodeGenModule &cgm) : CGM(cgm) {}
  virtual ~CGIORuntime();

  virtual void EmitWriteStmt(CodeGenFunction &CGF, const WriteStmt *S) = 0;
  virtual void EmitPrintStmt(CodeGenFunction &CGF, const PrintStmt *S) = 0;
};

/// Creates an instance of a Libflang IO runtime class.
CGIORuntime *CreateLibflangIORuntime(CodeGenModule &CGM);

}
}  // end namespace flang

#endif