Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 1 | //===--- CodeGenTypes.h - Type translation for LLVM CodeGen -----*- C++ -*-===// |
| 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 code that handles AST -> LLVM type lowering. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef CODEGEN_CODEGENTYPES_H |
| 15 | #define CODEGEN_CODEGENTYPES_H |
| 16 | |
Anders Carlsson | c9e2091 | 2007-08-21 00:21:21 +0000 | [diff] [blame] | 17 | #include "llvm/ADT/DenseMap.h" |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 18 | #include <vector> |
| 19 | |
| 20 | namespace llvm { |
Anders Carlsson | 4e53328 | 2007-08-17 22:00:32 +0000 | [diff] [blame] | 21 | class Module; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 22 | class Type; |
| 23 | } |
| 24 | |
| 25 | namespace clang { |
Chris Lattner | d2d2a11 | 2007-07-14 01:29:45 +0000 | [diff] [blame] | 26 | class ASTContext; |
Anders Carlsson | c9e2091 | 2007-08-21 00:21:21 +0000 | [diff] [blame] | 27 | class TagDecl; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 28 | class TargetInfo; |
| 29 | class QualType; |
| 30 | class FunctionTypeProto; |
| 31 | |
| 32 | namespace CodeGen { |
| 33 | |
| 34 | /// CodeGenTypes - This class organizes the cross-module state that is used |
| 35 | /// while lowering AST types to LLVM types. |
| 36 | class CodeGenTypes { |
Chris Lattner | d2d2a11 | 2007-07-14 01:29:45 +0000 | [diff] [blame] | 37 | ASTContext &Context; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 38 | TargetInfo &Target; |
Anders Carlsson | 4e53328 | 2007-08-17 22:00:32 +0000 | [diff] [blame] | 39 | llvm::Module& TheModule; |
Anders Carlsson | c9e2091 | 2007-08-21 00:21:21 +0000 | [diff] [blame] | 40 | |
| 41 | llvm::DenseMap<const TagDecl*, llvm::Type*> TagDeclTypes; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 42 | public: |
Anders Carlsson | 4e53328 | 2007-08-17 22:00:32 +0000 | [diff] [blame] | 43 | CodeGenTypes(ASTContext &Ctx, llvm::Module &M); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 44 | |
| 45 | TargetInfo &getTarget() const { return Target; } |
| 46 | |
| 47 | const llvm::Type *ConvertType(QualType T); |
| 48 | void DecodeArgumentTypes(const FunctionTypeProto &FTP, |
| 49 | std::vector<const llvm::Type*> &ArgTys); |
| 50 | }; |
Chris Lattner | a7674d8 | 2007-07-13 22:13:22 +0000 | [diff] [blame] | 51 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 52 | } // end namespace CodeGen |
| 53 | } // end namespace clang |
| 54 | |
| 55 | #endif |