summaryrefslogtreecommitdiffstats
path: root/clang/include/clang/AST/ASTContext.h
blob: ecbcf7343ee373ecd696489ca81c76f26eb6f1e9 (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
48
49
50
51
52
53
54
55
56
57
58
59
//===--- ASTContext.h - Context to hold long-lived AST nodes ----*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by Chris Lattner and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//  This file defines the ASTContext interface.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_AST_ASTCONTEXT_H
#define LLVM_CLANG_AST_ASTCONTEXT_H

#include "clang/AST/Type.h"
#include <vector>

namespace llvm {
namespace clang {
  class Preprocessor;
  class TargetInfo;
  
/// ASTContext - This class holds long-lived AST nodes (such as types and
/// decls) that can be referred to throughout the semantic analysis of a file.
class ASTContext {
  // FIXME: This is a stupid data structure.
  std::vector<TypeRef> Types;
public:
  Preprocessor &PP;
  TargetInfo &Target;

  
  // Builtin Types.
  TypeRef VoidTy;
  TypeRef BoolTy;
  TypeRef CharTy;
  TypeRef SignedCharTy, ShortTy, IntTy, LongTy, LongLongTy;
  TypeRef UnsignedCharTy, UnsignedShortTy, UnsignedIntTy, UnsignedLongTy;
  TypeRef UnsignedLongLongTy;
  TypeRef FloatTy, DoubleTy, LongDoubleTy;
  TypeRef FloatComplexTy, DoubleComplexTy, LongDoubleComplexTy;
  
  ASTContext(Preprocessor &pp);
  
  
  /// getPointerType - Return the uniqued reference to the type for a pointer to
  /// the specified type.
  TypeRef getPointerType(const TypeRef &T);
  
private:
  void InitBuiltinTypes();
};
  
}  // end namespace clang
}  // end namespace llvm

#endif
OpenPOWER on IntegriCloud