[cfe-commits] r39356 - in /cfe/cfe/trunk: AST/Sema.h Driver/clang.cpp Sema/Sema.h

snaroff at cs.uiuc.edu snaroff at cs.uiuc.edu
Wed Jul 11 09:43:33 PDT 2007


Author: snaroff
Date: Wed Jul 11 11:43:32 2007
New Revision: 39356

URL: http://llvm.org/viewvc/llvm-project?rev=39356&view=rev
Log:
Bug #:
Submitted by:
Reviewed by:
This is a "small" checkin.  #include_next wasn't working properly on
Leopard. This is because the driver has some hard coded paths that
don't work on Leopard. The real fix is to derive them, however I don't
think we need to solve this now. At this point, anyone working on clang
should be able to use Leopard. This fix removed 11 errors processing
"carbon.h". The bug that bubbles up to the top is in MergeFunctionDecl().
As part of digging into this part of Sema, I rearranged some methods
(and changed the visibility).

Modified:
    cfe/cfe/trunk/AST/Sema.h
    cfe/cfe/trunk/Driver/clang.cpp
    cfe/cfe/trunk/Sema/Sema.h

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

==============================================================================
--- cfe/cfe/trunk/AST/Sema.h (original)
+++ cfe/cfe/trunk/AST/Sema.h Wed Jul 11 11:43:32 2007
@@ -72,28 +72,14 @@
   virtual DeclTy *isTypeName(const IdentifierInfo &II, Scope *S) const;
   virtual DeclTy *ParseDeclarator(Scope *S, Declarator &D, ExprTy *Init,
                                   DeclTy *LastInGroup);
-  VarDecl *ParseParamDeclarator(DeclaratorChunk &FI, unsigned ArgNo,
-                                Scope *FnBodyScope);
   virtual DeclTy *ParseStartOfFunctionDef(Scope *S, Declarator &D);
   virtual DeclTy *ParseFunctionDefBody(DeclTy *Decl, StmtTy *Body);
   virtual void PopScope(SourceLocation Loc, Scope *S);
-  Decl *LookupScopedDecl(IdentifierInfo *II, unsigned NSI, SourceLocation IdLoc,
-                         Scope *S);
-  
-  Decl *LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, Scope *S);
-  
-  TypedefDecl *ParseTypedefDecl(Scope *S, Declarator &D);
-  TypedefDecl *MergeTypeDefDecl(TypedefDecl *New, Decl *Old);
-  FunctionDecl *MergeFunctionDecl(FunctionDecl *New, Decl *Old);
-  VarDecl *MergeVarDecl(VarDecl *New, Decl *Old);
 
   /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
   /// no declarator (e.g. "struct foo;") is parsed.
   virtual DeclTy *ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS);  
   
-  Decl *ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,
-                                 Scope *S);
-  
   virtual DeclTy *ParseTag(Scope *S, unsigned TagType, TagKind TK,
                            SourceLocation KWLoc, IdentifierInfo *Name,
                            SourceLocation NameLoc);
@@ -106,10 +92,25 @@
                                     SourceLocation EqualLoc, ExprTy *Val);
   virtual void ParseEnumBody(SourceLocation EnumLoc, DeclTy *EnumDecl,
                              DeclTy **Elements, unsigned NumElements);
+private:
+  /// Subroutines of ParseDeclarator()...
+  TypedefDecl *ParseTypedefDecl(Scope *S, Declarator &D);
+  TypedefDecl *MergeTypeDefDecl(TypedefDecl *New, Decl *Old);
+  FunctionDecl *MergeFunctionDecl(FunctionDecl *New, Decl *Old);
+  VarDecl *MergeVarDecl(VarDecl *New, Decl *Old);
+  
+  /// More parsing and symbol table subroutines...
+  VarDecl *ParseParamDeclarator(DeclaratorChunk &FI, unsigned ArgNo,
+                                Scope *FnBodyScope);
+  Decl *LookupScopedDecl(IdentifierInfo *II, unsigned NSI, SourceLocation IdLoc,
+                         Scope *S);  
+  Decl *LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, Scope *S);
+  Decl *ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,
+                                 Scope *S);
   
   //===--------------------------------------------------------------------===//
   // Statement Parsing Callbacks: SemaStmt.cpp.
-
+public:
   virtual StmtResult ParseCompoundStmt(SourceLocation L, SourceLocation R,
                                        StmtTy **Elts, unsigned NumElts);
   virtual StmtResult ParseExprStmt(ExprTy *Expr) {

Modified: cfe/cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/clang.cpp?rev=39356&r1=39355&r2=39356&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/clang.cpp (original)
+++ cfe/cfe/trunk/Driver/clang.cpp Wed Jul 11 11:43:32 2007
@@ -733,11 +733,11 @@
     }
     
     AddPath("/usr/local/include", System, false, false, false, FM);
-    AddPath("/usr/lib/gcc/i686-apple-darwin8/4.0.1/include", System, 
+    AddPath("/usr/lib/gcc/i686-apple-darwin9/4.0.1/include", System, 
             false, false, false, FM);
-    AddPath("/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include", 
+    AddPath("/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include", 
             System, false, false, false, FM);
-    AddPath("/usr/lib/gcc/powerpc-apple-darwin8/"
+    AddPath("/usr/lib/gcc/powerpc-apple-darwin9/"
             "4.0.1/../../../../powerpc-apple-darwin8/include", 
             System, false, false, false, FM);
     AddPath("/usr/include", System, false, false, false, FM);

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

==============================================================================
--- cfe/cfe/trunk/Sema/Sema.h (original)
+++ cfe/cfe/trunk/Sema/Sema.h Wed Jul 11 11:43:32 2007
@@ -72,28 +72,14 @@
   virtual DeclTy *isTypeName(const IdentifierInfo &II, Scope *S) const;
   virtual DeclTy *ParseDeclarator(Scope *S, Declarator &D, ExprTy *Init,
                                   DeclTy *LastInGroup);
-  VarDecl *ParseParamDeclarator(DeclaratorChunk &FI, unsigned ArgNo,
-                                Scope *FnBodyScope);
   virtual DeclTy *ParseStartOfFunctionDef(Scope *S, Declarator &D);
   virtual DeclTy *ParseFunctionDefBody(DeclTy *Decl, StmtTy *Body);
   virtual void PopScope(SourceLocation Loc, Scope *S);
-  Decl *LookupScopedDecl(IdentifierInfo *II, unsigned NSI, SourceLocation IdLoc,
-                         Scope *S);
-  
-  Decl *LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, Scope *S);
-  
-  TypedefDecl *ParseTypedefDecl(Scope *S, Declarator &D);
-  TypedefDecl *MergeTypeDefDecl(TypedefDecl *New, Decl *Old);
-  FunctionDecl *MergeFunctionDecl(FunctionDecl *New, Decl *Old);
-  VarDecl *MergeVarDecl(VarDecl *New, Decl *Old);
 
   /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
   /// no declarator (e.g. "struct foo;") is parsed.
   virtual DeclTy *ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS);  
   
-  Decl *ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,
-                                 Scope *S);
-  
   virtual DeclTy *ParseTag(Scope *S, unsigned TagType, TagKind TK,
                            SourceLocation KWLoc, IdentifierInfo *Name,
                            SourceLocation NameLoc);
@@ -106,10 +92,25 @@
                                     SourceLocation EqualLoc, ExprTy *Val);
   virtual void ParseEnumBody(SourceLocation EnumLoc, DeclTy *EnumDecl,
                              DeclTy **Elements, unsigned NumElements);
+private:
+  /// Subroutines of ParseDeclarator()...
+  TypedefDecl *ParseTypedefDecl(Scope *S, Declarator &D);
+  TypedefDecl *MergeTypeDefDecl(TypedefDecl *New, Decl *Old);
+  FunctionDecl *MergeFunctionDecl(FunctionDecl *New, Decl *Old);
+  VarDecl *MergeVarDecl(VarDecl *New, Decl *Old);
+  
+  /// More parsing and symbol table subroutines...
+  VarDecl *ParseParamDeclarator(DeclaratorChunk &FI, unsigned ArgNo,
+                                Scope *FnBodyScope);
+  Decl *LookupScopedDecl(IdentifierInfo *II, unsigned NSI, SourceLocation IdLoc,
+                         Scope *S);  
+  Decl *LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, Scope *S);
+  Decl *ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,
+                                 Scope *S);
   
   //===--------------------------------------------------------------------===//
   // Statement Parsing Callbacks: SemaStmt.cpp.
-
+public:
   virtual StmtResult ParseCompoundStmt(SourceLocation L, SourceLocation R,
                                        StmtTy **Elts, unsigned NumElts);
   virtual StmtResult ParseExprStmt(ExprTy *Expr) {





More information about the cfe-commits mailing list