blob: e7b1a05ebcc29d0bb638fd523c2a59b718af8141 [file] [log] [blame]
Chris Lattnerbed31442007-05-28 01:07:47 +00001//===--- CodeGenFunction.h - Per-Function state for LLVM CodeGen ----------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Chris Lattner and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This is the internal per-function state used for llvm translation.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef CODEGEN_CODEGENFUNCTION_H
15#define CODEGEN_CODEGENFUNCTION_H
16
17namespace llvm {
18 class Module;
Chris Lattnerd1af2d22007-05-29 23:17:50 +000019 class Type;
Chris Lattnerbed31442007-05-28 01:07:47 +000020namespace clang {
21 class ASTContext;
22 class FunctionDecl;
Chris Lattnerd1af2d22007-05-29 23:17:50 +000023 class QualType;
24 class SourceLocation;
25 class TargetInfo;
Chris Lattnerbed31442007-05-28 01:07:47 +000026
27namespace CodeGen {
28 class CodeGenModule;
29
30/// CodeGenFunction - This class organizes the per-function state that is used
31/// while generating LLVM code.
32class CodeGenFunction {
33 CodeGenModule &CGM; // Per-module state.
Chris Lattnerd1af2d22007-05-29 23:17:50 +000034 TargetInfo &Target;
Chris Lattnerbed31442007-05-28 01:07:47 +000035public:
Chris Lattnerd1af2d22007-05-29 23:17:50 +000036 CodeGenFunction(CodeGenModule &cgm);
Chris Lattnerbed31442007-05-28 01:07:47 +000037
Chris Lattnerd1af2d22007-05-29 23:17:50 +000038 const llvm::Type *ConvertType(QualType T, SourceLocation Loc);
39
40 void GenerateCode(FunctionDecl *FD);
Chris Lattnerbed31442007-05-28 01:07:47 +000041};
42} // end namespace CodeGen
43} // end namespace clang
44} // end namespace llvm
45
46#endif