forked from OSchip/llvm-project
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). llvm-svn: 39356
This commit is contained in:
parent
b7d4924eb1
commit
3273c22863
|
@ -72,28 +72,14 @@ public:
|
|||
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 @@ public:
|
|||
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) {
|
||||
|
|
|
@ -733,11 +733,11 @@ static void InitializeIncludePaths(HeaderSearch &Headers, FileManager &FM,
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
|
@ -72,28 +72,14 @@ public:
|
|||
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 @@ public:
|
|||
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) {
|
||||
|
|
Loading…
Reference in New Issue