[cfe-commits] r39166 - in /cfe/cfe/trunk: AST/ASTContext.cpp AST/Sema.h AST/SemaDecl.cpp AST/SemaType.cpp AST/Type.cpp README.txt Sema/Sema.h Sema/SemaDecl.cpp Sema/SemaType.cpp clang.xcodeproj/project.pbxproj include/clang/AST/Type.h

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:40:21 PDT 2007


Author: sabre
Date: Wed Jul 11 11:40:21 2007
New Revision: 39166

URL: http://llvm.org/viewvc/llvm-project?rev=39166&view=rev
Log:
restructure code to build the framework for creating types from declarators.

Added:
    cfe/cfe/trunk/AST/SemaType.cpp   (with props)
    cfe/cfe/trunk/AST/Type.cpp   (with props)
    cfe/cfe/trunk/Sema/SemaType.cpp   (with props)
Modified:
    cfe/cfe/trunk/AST/ASTContext.cpp
    cfe/cfe/trunk/AST/Sema.h
    cfe/cfe/trunk/AST/SemaDecl.cpp
    cfe/cfe/trunk/README.txt
    cfe/cfe/trunk/Sema/Sema.h
    cfe/cfe/trunk/Sema/SemaDecl.cpp
    cfe/cfe/trunk/clang.xcodeproj/project.pbxproj
    cfe/cfe/trunk/include/clang/AST/Type.h

Modified: cfe/cfe/trunk/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/ASTContext.cpp?rev=39166&r1=39165&r2=39166&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/ASTContext.cpp (original)
+++ cfe/cfe/trunk/AST/ASTContext.cpp Wed Jul 11 11:40:21 2007
@@ -16,56 +16,8 @@
 using namespace llvm;
 using namespace clang;
 
-
-
-
-
-
-
-namespace {
-  /// BuiltinType - This class is used for builtin types like 'int'.  Builtin
-  /// types are always canonical and have a literal name field.
-  class BuiltinType : public Type {
-    const char *Name;
-  public:
-    BuiltinType(const char *name) : Name(name) {}
-  };
-}
-
 ASTContext::ASTContext(Preprocessor &pp)
   : PP(pp), Target(pp.getTargetInfo()) {
-
-  // C99 6.2.5p19.
-  VoidTy = new BuiltinType("void");
-    
-  // C99 6.2.5p2.
-  BoolTy = new BuiltinType("_Bool");
-  // C99 6.2.5p3.
-  CharTy = new BuiltinType("char");
-  // C99 6.2.5p4.
-  SignedCharTy = new BuiltinType("signed char");
-  ShortTy = new BuiltinType("short");
-  IntTy = new BuiltinType("int");
-  LongTy = new BuiltinType("long");
-  LongLongTy = new BuiltinType("long long");
-
-  // C99 6.2.5p6.
-  UnsignedCharTy = new BuiltinType("unsigned char");
-  UnsignedShortTy = new BuiltinType("unsigned short");
-  UnsignedIntTy = new BuiltinType("unsigned int");
-  UnsignedLongTy = new BuiltinType("unsigned long");
-  UnsignedLongLongTy = new BuiltinType("unsigned long long");
-  
-  // C99 6.2.5p10.
-  FloatTy = new BuiltinType("float");
-  DoubleTy = new BuiltinType("double");
-  LongDoubleTy = new BuiltinType("long double");
-
-  // C99 6.2.5p11.
-  FloatComplexTy = new BuiltinType("float _Complex");
-  DoubleComplexTy = new BuiltinType("double _Complex");
-  LongDoubleComplexTy = new BuiltinType("long double _Complex");
-  
 }
 
 

Modified: cfe/cfe/trunk/AST/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Sema.h?rev=39166&r1=39165&r2=39166&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Sema.h (original)
+++ cfe/cfe/trunk/AST/Sema.h Wed Jul 11 11:40:21 2007
@@ -24,6 +24,7 @@
   class ASTContext;
   class Preprocessor;
   class Decl;
+  class TypeRef;
   
 /// Sema - This implements semantic analysis and AST building for C.
 class Sema : public Action {
@@ -36,12 +37,21 @@
   std::vector<Decl*> &LastInGroupList;
 public:
   Sema(ASTContext &ctx, std::vector<Decl*> &prevInGroup)
-    : Context(ctx), LastInGroupList(prevInGroup) {}
+    : Context(ctx), LastInGroupList(prevInGroup) {
+    InitializeBuiltinTypes();
+  }
   
   void Diag(SourceLocation Loc, unsigned DiagID,
             const std::string &Msg = std::string());
   
   //===--------------------------------------------------------------------===//
+  // Type Analysis / Processing: SemaType.cpp.
+  //
+  void InitializeBuiltinTypes();
+  TypeRef GetTypeForDeclarator(Declarator &D, Scope *S);
+  
+  
+  //===--------------------------------------------------------------------===//
   // Symbol table / Decl tracking callbacks: SemaDecl.cpp.
   //
   virtual bool isTypeName(const IdentifierInfo &II, Scope *S) const;

Modified: cfe/cfe/trunk/AST/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/SemaDecl.cpp?rev=39166&r1=39165&r2=39166&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/SemaDecl.cpp (original)
+++ cfe/cfe/trunk/AST/SemaDecl.cpp Wed Jul 11 11:40:21 2007
@@ -13,6 +13,7 @@
 
 #include "Sema.h"
 #include "clang/AST/Decl.h"
+#include "clang/AST/Type.h"
 #include "clang/Parse/Scope.h"
 #include "clang/Lex/IdentifierTable.h"
 using namespace llvm;
@@ -27,6 +28,13 @@
 Action::DeclTy *
 Sema::ParseDeclarator(Scope *S, Declarator &D, ExprTy *Init, 
                       DeclTy *LastInGroup) {
+  TypeRef DeclaratorType = GetTypeForDeclarator(D, S);
+  
+  // FIXME: Temporary.
+  if (!DeclaratorType.isNull())
+    DeclaratorType->dump();
+    
+  
   IdentifierInfo *II = D.getIdentifier();
   Decl *PrevDecl = II ? II->getFETokenInfo<Decl>() : 0;
   

Added: cfe/cfe/trunk/AST/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/SemaType.cpp?rev=39166&view=auto

==============================================================================
--- cfe/cfe/trunk/AST/SemaType.cpp (added)
+++ cfe/cfe/trunk/AST/SemaType.cpp Wed Jul 11 11:40:21 2007
@@ -0,0 +1,78 @@
+//===--- SemaType.cpp - Semantic Analysis for Types -----------------------===//
+//
+//                     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 implements type-related semantic analysis.
+//
+//===----------------------------------------------------------------------===//
+
+#include "Sema.h"
+#include "clang/AST/ASTContext.h"
+#include "clang/AST/Decl.h"
+using namespace llvm;
+using namespace clang;
+
+namespace {
+  /// BuiltinType - This class is used for builtin types like 'int'.  Builtin
+  /// types are always canonical and have a literal name field.
+  class BuiltinType : public Type {
+    const char *Name;
+  public:
+    BuiltinType(const char *name) : Name(name) {}
+    
+    virtual void dump() const;
+  };
+}
+
+// FIXME: REMOVE
+#include <iostream>
+
+void BuiltinType::dump() const {
+  std::cerr << Name;
+}
+
+
+void Sema::InitializeBuiltinTypes() {
+  assert(Context.VoidTy.isNull() && "Context reinitialized?");
+  
+  // C99 6.2.5p19.
+  Context.VoidTy = new BuiltinType("void");
+  
+  // C99 6.2.5p2.
+  Context.BoolTy = new BuiltinType("_Bool");
+  // C99 6.2.5p3.
+  Context.CharTy = new BuiltinType("char");
+  // C99 6.2.5p4.
+  Context.SignedCharTy = new BuiltinType("signed char");
+  Context.ShortTy = new BuiltinType("short");
+  Context.IntTy = new BuiltinType("int");
+  Context.LongTy = new BuiltinType("long");
+  Context.LongLongTy = new BuiltinType("long long");
+  
+  // C99 6.2.5p6.
+  Context.UnsignedCharTy = new BuiltinType("unsigned char");
+  Context.UnsignedShortTy = new BuiltinType("unsigned short");
+  Context.UnsignedIntTy = new BuiltinType("unsigned int");
+  Context.UnsignedLongTy = new BuiltinType("unsigned long");
+  Context.UnsignedLongLongTy = new BuiltinType("unsigned long long");
+  
+  // C99 6.2.5p10.
+  Context.FloatTy = new BuiltinType("float");
+  Context.DoubleTy = new BuiltinType("double");
+  Context.LongDoubleTy = new BuiltinType("long double");
+  
+  // C99 6.2.5p11.
+  Context.FloatComplexTy = new BuiltinType("float _Complex");
+  Context.DoubleComplexTy = new BuiltinType("double _Complex");
+  Context.LongDoubleComplexTy = new BuiltinType("long double _Complex");
+}
+
+
+TypeRef Sema::GetTypeForDeclarator(Declarator &D, Scope *S) {
+  return TypeRef();
+}

Propchange: cfe/cfe/trunk/AST/SemaType.cpp

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/cfe/trunk/AST/SemaType.cpp

------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: cfe/cfe/trunk/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Type.cpp?rev=39166&view=auto

==============================================================================
--- cfe/cfe/trunk/AST/Type.cpp (added)
+++ cfe/cfe/trunk/AST/Type.cpp Wed Jul 11 11:40:21 2007
@@ -0,0 +1,20 @@
+//===--- Type.cpp - Type representation and manipulation ------------------===//
+//
+//                     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 implements type-related functionality.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/AST/Type.h"
+using namespace llvm;
+using namespace clang;
+
+Type::~Type() {}
+
+

Propchange: cfe/cfe/trunk/AST/Type.cpp

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/cfe/trunk/AST/Type.cpp

------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: cfe/cfe/trunk/README.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/README.txt?rev=39166&r1=39165&r2=39166&view=diff

==============================================================================
--- cfe/cfe/trunk/README.txt (original)
+++ cfe/cfe/trunk/README.txt Wed Jul 11 11:40:21 2007
@@ -133,6 +133,7 @@
  * #assert/#unassert
  * #line / #file directives (currently accepted and ignored).
  * MSExtension: "L#param" stringizes to a wide string literal.
+ * Charize extension: "#define F(o) #@o  F(a)"  -> 'a'.
  * Consider merging the parser's expression parser into the preprocessor to
    eliminate duplicate code.
  * Add support for -M*

Modified: cfe/cfe/trunk/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/Sema.h?rev=39166&r1=39165&r2=39166&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/Sema.h (original)
+++ cfe/cfe/trunk/Sema/Sema.h Wed Jul 11 11:40:21 2007
@@ -24,6 +24,7 @@
   class ASTContext;
   class Preprocessor;
   class Decl;
+  class TypeRef;
   
 /// Sema - This implements semantic analysis and AST building for C.
 class Sema : public Action {
@@ -36,12 +37,21 @@
   std::vector<Decl*> &LastInGroupList;
 public:
   Sema(ASTContext &ctx, std::vector<Decl*> &prevInGroup)
-    : Context(ctx), LastInGroupList(prevInGroup) {}
+    : Context(ctx), LastInGroupList(prevInGroup) {
+    InitializeBuiltinTypes();
+  }
   
   void Diag(SourceLocation Loc, unsigned DiagID,
             const std::string &Msg = std::string());
   
   //===--------------------------------------------------------------------===//
+  // Type Analysis / Processing: SemaType.cpp.
+  //
+  void InitializeBuiltinTypes();
+  TypeRef GetTypeForDeclarator(Declarator &D, Scope *S);
+  
+  
+  //===--------------------------------------------------------------------===//
   // Symbol table / Decl tracking callbacks: SemaDecl.cpp.
   //
   virtual bool isTypeName(const IdentifierInfo &II, Scope *S) const;

Modified: cfe/cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaDecl.cpp?rev=39166&r1=39165&r2=39166&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaDecl.cpp Wed Jul 11 11:40:21 2007
@@ -13,6 +13,7 @@
 
 #include "Sema.h"
 #include "clang/AST/Decl.h"
+#include "clang/AST/Type.h"
 #include "clang/Parse/Scope.h"
 #include "clang/Lex/IdentifierTable.h"
 using namespace llvm;
@@ -27,6 +28,13 @@
 Action::DeclTy *
 Sema::ParseDeclarator(Scope *S, Declarator &D, ExprTy *Init, 
                       DeclTy *LastInGroup) {
+  TypeRef DeclaratorType = GetTypeForDeclarator(D, S);
+  
+  // FIXME: Temporary.
+  if (!DeclaratorType.isNull())
+    DeclaratorType->dump();
+    
+  
   IdentifierInfo *II = D.getIdentifier();
   Decl *PrevDecl = II ? II->getFETokenInfo<Decl>() : 0;
   

Added: cfe/cfe/trunk/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaType.cpp?rev=39166&view=auto

==============================================================================
--- cfe/cfe/trunk/Sema/SemaType.cpp (added)
+++ cfe/cfe/trunk/Sema/SemaType.cpp Wed Jul 11 11:40:21 2007
@@ -0,0 +1,78 @@
+//===--- SemaType.cpp - Semantic Analysis for Types -----------------------===//
+//
+//                     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 implements type-related semantic analysis.
+//
+//===----------------------------------------------------------------------===//
+
+#include "Sema.h"
+#include "clang/AST/ASTContext.h"
+#include "clang/AST/Decl.h"
+using namespace llvm;
+using namespace clang;
+
+namespace {
+  /// BuiltinType - This class is used for builtin types like 'int'.  Builtin
+  /// types are always canonical and have a literal name field.
+  class BuiltinType : public Type {
+    const char *Name;
+  public:
+    BuiltinType(const char *name) : Name(name) {}
+    
+    virtual void dump() const;
+  };
+}
+
+// FIXME: REMOVE
+#include <iostream>
+
+void BuiltinType::dump() const {
+  std::cerr << Name;
+}
+
+
+void Sema::InitializeBuiltinTypes() {
+  assert(Context.VoidTy.isNull() && "Context reinitialized?");
+  
+  // C99 6.2.5p19.
+  Context.VoidTy = new BuiltinType("void");
+  
+  // C99 6.2.5p2.
+  Context.BoolTy = new BuiltinType("_Bool");
+  // C99 6.2.5p3.
+  Context.CharTy = new BuiltinType("char");
+  // C99 6.2.5p4.
+  Context.SignedCharTy = new BuiltinType("signed char");
+  Context.ShortTy = new BuiltinType("short");
+  Context.IntTy = new BuiltinType("int");
+  Context.LongTy = new BuiltinType("long");
+  Context.LongLongTy = new BuiltinType("long long");
+  
+  // C99 6.2.5p6.
+  Context.UnsignedCharTy = new BuiltinType("unsigned char");
+  Context.UnsignedShortTy = new BuiltinType("unsigned short");
+  Context.UnsignedIntTy = new BuiltinType("unsigned int");
+  Context.UnsignedLongTy = new BuiltinType("unsigned long");
+  Context.UnsignedLongLongTy = new BuiltinType("unsigned long long");
+  
+  // C99 6.2.5p10.
+  Context.FloatTy = new BuiltinType("float");
+  Context.DoubleTy = new BuiltinType("double");
+  Context.LongDoubleTy = new BuiltinType("long double");
+  
+  // C99 6.2.5p11.
+  Context.FloatComplexTy = new BuiltinType("float _Complex");
+  Context.DoubleComplexTy = new BuiltinType("double _Complex");
+  Context.LongDoubleComplexTy = new BuiltinType("long double _Complex");
+}
+
+
+TypeRef Sema::GetTypeForDeclarator(Declarator &D, Scope *S) {
+  return TypeRef();
+}

Propchange: cfe/cfe/trunk/Sema/SemaType.cpp

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/cfe/trunk/Sema/SemaType.cpp

------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: cfe/cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=39166&r1=39165&r2=39166&view=diff

==============================================================================
--- cfe/cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/cfe/trunk/clang.xcodeproj/project.pbxproj Wed Jul 11 11:40:21 2007
@@ -13,6 +13,7 @@
 		DE06E8140A8FF9330050E87E /* Action.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE06E8130A8FF9330050E87E /* Action.h */; };
 		DE0FCA630A95859D00248FD5 /* Expr.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE0FCA620A95859D00248FD5 /* Expr.h */; };
 		DE0FCB340A9C21F100248FD5 /* Expr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE0FCB330A9C21F100248FD5 /* Expr.cpp */; };
+		DE1733000B068B700080B521 /* ASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE1732FF0B068B700080B521 /* ASTContext.cpp */; };
 		DE1F22030A7D852A00FBF588 /* Parser.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE1F22020A7D852A00FBF588 /* Parser.h */; };
 		DE2E60610B04461800F3FAFE /* SemaExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE2E60600B04461800F3FAFE /* SemaExpr.cpp */; };
 		DE344AB80AE5DF6D00DBC861 /* HeaderSearch.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE344AB70AE5DF6D00DBC861 /* HeaderSearch.h */; };
@@ -43,6 +44,7 @@
 		DE5932D40AD60FF400BC794C /* PrintPreprocessedOutput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE5932D00AD60FF400BC794C /* PrintPreprocessedOutput.cpp */; };
 		DE75ED190B0446470020CF81 /* SemaStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE75ED180B0446470020CF81 /* SemaStmt.cpp */; };
 		DE75ED290B044DC90020CF81 /* ASTContext.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE75ED280B044DC90020CF81 /* ASTContext.h */; };
+		DE75EDF10B06880E0020CF81 /* Type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE75EDF00B06880E0020CF81 /* Type.cpp */; };
 		DEAEE98B0A5A2B970045101B /* MultipleIncludeOpt.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */; };
 		DEAEED4B0A5AF89A0045101B /* NOTES.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEAEED4A0A5AF89A0045101B /* NOTES.txt */; };
 		DEC8D9910A9433CD00353FCA /* Decl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEC8D9900A9433CD00353FCA /* Decl.h */; };
@@ -140,6 +142,7 @@
 		DE06E8130A8FF9330050E87E /* Action.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Action.h; path = clang/Parse/Action.h; sourceTree = "<group>"; };
 		DE0FCA620A95859D00248FD5 /* Expr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Expr.h; path = clang/AST/Expr.h; sourceTree = "<group>"; };
 		DE0FCB330A9C21F100248FD5 /* Expr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Expr.cpp; path = AST/Expr.cpp; sourceTree = "<group>"; };
+		DE1732FF0B068B700080B521 /* ASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ASTContext.cpp; path = AST/ASTContext.cpp; sourceTree = "<group>"; };
 		DE1F22020A7D852A00FBF588 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Parser.h; path = clang/Parse/Parser.h; sourceTree = "<group>"; };
 		DE2E60600B04461800F3FAFE /* SemaExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = SemaExpr.cpp; path = AST/SemaExpr.cpp; sourceTree = "<group>"; };
 		DE344AB70AE5DF6D00DBC861 /* HeaderSearch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HeaderSearch.h; sourceTree = "<group>"; };
@@ -170,6 +173,7 @@
 		DE5932D00AD60FF400BC794C /* PrintPreprocessedOutput.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PrintPreprocessedOutput.cpp; path = Driver/PrintPreprocessedOutput.cpp; sourceTree = "<group>"; };
 		DE75ED180B0446470020CF81 /* SemaStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = SemaStmt.cpp; path = AST/SemaStmt.cpp; sourceTree = "<group>"; };
 		DE75ED280B044DC90020CF81 /* ASTContext.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ASTContext.h; path = clang/AST/ASTContext.h; sourceTree = "<group>"; };
+		DE75EDF00B06880E0020CF81 /* Type.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Type.cpp; path = AST/Type.cpp; sourceTree = "<group>"; };
 		DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MultipleIncludeOpt.h; sourceTree = "<group>"; };
 		DEAEED4A0A5AF89A0045101B /* NOTES.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = NOTES.txt; sourceTree = "<group>"; };
 		DEC8D9900A9433CD00353FCA /* Decl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Decl.h; path = clang/AST/Decl.h; sourceTree = "<group>"; };
@@ -317,10 +321,12 @@
 		DEC8D9920A9433F400353FCA /* AST */ = {
 			isa = PBXGroup;
 			children = (
+				DE1732FF0B068B700080B521 /* ASTContext.cpp */,
 				DEC8DAAC0A94400300353FCA /* ASTStreamer.cpp */,
 				DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */,
 				DE0FCB330A9C21F100248FD5 /* Expr.cpp */,
 				DE3452400AEF1A2D00DBC861 /* Stmt.cpp */,
+				DE75EDF00B06880E0020CF81 /* Type.cpp */,
 				DE34646D0B043E5B00DBC861 /* Sema.h */,
 				DE34644B0B043E0000DBC861 /* Sema.cpp */,
 				DE34633F0B02F0F800DBC861 /* SemaDecl.cpp */,
@@ -487,6 +493,8 @@
 				DE34644C0B043E0000DBC861 /* Sema.cpp in Sources */,
 				DE2E60610B04461800F3FAFE /* SemaExpr.cpp in Sources */,
 				DE75ED190B0446470020CF81 /* SemaStmt.cpp in Sources */,
+				DE75EDF10B06880E0020CF81 /* Type.cpp in Sources */,
+				DE1733000B068B700080B521 /* ASTContext.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: cfe/cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/Type.h?rev=39166&r1=39165&r2=39166&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/cfe/trunk/include/clang/AST/Type.h Wed Jul 11 11:40:21 2007
@@ -11,8 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_PARSE_TYPE_H
-#define LLVM_CLANG_PARSE_TYPE_H
+#ifndef LLVM_CLANG_AST_TYPE_H
+#define LLVM_CLANG_AST_TYPE_H
 
 #include "llvm/Support/DataTypes.h"
 #include <cassert>
@@ -107,8 +107,12 @@
 class Type {
   Type *CanonicalType;
 public:
+  virtual ~Type();
+  
   bool isCanonical() const { return CanonicalType == this; }
   Type *getCanonicalType() const { return CanonicalType; }
+  
+  virtual void dump() const = 0;
 };
 
 class PointerType : public Type {





More information about the cfe-commits mailing list