diff options
| author | Steve Naroff <snaroff@apple.com> | 2008-04-02 14:35:35 +0000 | 
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2008-04-02 14:35:35 +0000 | 
| commit | 2fc93f5c432287fc10a48c58debf46c19fcc2024 (patch) | |
| tree | 7721dd4b1dbb40ec009a9736731f6eaea37dafea /clang/lib/Sema/Sema.h | |
| parent | d12d21c0008261f5039d2cb62a8dc9098d0b60ef (diff) | |
| download | bcm5719-llvm-2fc93f5c432287fc10a48c58debf46c19fcc2024.tar.gz bcm5719-llvm-2fc93f5c432287fc10a48c58debf46c19fcc2024.zip | |
Two changes to Sema::LookupDecl() interface. 
(1) Remove IdLoc (it's never used). 
(2) Add a bool to enable/disable lazy builtin creaation (defaults to true).
This enables us to use LookupDecl() in Sema::isTypeName(), which is also part of this commit.
To make this work, I changed isTypeName() to be a non-const member function. I'm not happy with this, however I fiddled with making LookupDecl() and friends const and it got ugly pretty quickly. We can certainly add it back if/when someone has time to fiddle with it. For now, I thought this simplification was more important than retaining the const-ness. 
llvm-svn: 49087
Diffstat (limited to 'clang/lib/Sema/Sema.h')
| -rw-r--r-- | clang/lib/Sema/Sema.h | 9 | 
1 files changed, 5 insertions, 4 deletions
| diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index a91d3da720d..e98d9b59a7f 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -198,7 +198,7 @@ private:    //===--------------------------------------------------------------------===//    // Symbol table / Decl tracking callbacks: SemaDecl.cpp.    // -  virtual DeclTy *isTypeName(const IdentifierInfo &II, Scope *S) const; +  virtual DeclTy *isTypeName(const IdentifierInfo &II, Scope *S);    virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup);    void AddInitializerToDecl(DeclTy *dcl, ExprTy *init);    virtual DeclTy *FinalizeDeclaratorGroup(Scope *S, DeclTy *Group); @@ -249,10 +249,11 @@ private:    /// More parsing and symbol table subroutines...    ParmVarDecl *ActOnParamDeclarator(struct DeclaratorChunk::ParamInfo &PI,                                       Scope *FnBodyScope);   -  Decl *LookupDecl(IdentifierInfo *II, unsigned NSI,  -                   SourceLocation IdLoc, Scope *S); +  Decl *LookupDecl(const IdentifierInfo *II, unsigned NSI, Scope *S, +                   bool enableLazyBuiltinCreation = true);    ObjCInterfaceDecl *getObjCInterfaceDecl(IdentifierInfo *Id); -  ScopedDecl *LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, Scope *S); +  ScopedDecl *LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID,  +                                  Scope *S);    ScopedDecl *ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II,                                   Scope *S);    // Decl attributes - this routine is the top level dispatcher.  | 

