diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2008-08-26 06:08:30 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2008-08-26 06:08:30 +0000 |
| commit | e36c39f3bf94ce9959ef0da56900edc6b313a359 (patch) | |
| tree | 7abf3ceef8b7cc53fd46df0a8ff940658e3de11f /clang/lib | |
| parent | 279d1ccc57cc416c37e78c0fa8d2495258437c48 (diff) | |
| download | bcm5719-llvm-e36c39f3bf94ce9959ef0da56900edc6b313a359.tar.gz bcm5719-llvm-e36c39f3bf94ce9959ef0da56900edc6b313a359.zip | |
Missed a file; part of:
Move implicit Obj-C param creation into ObjCMethodDecl.
- Add ObjCMethodDecl::createImplicitParams.
- Remove ObjCMethodDecl::set{Self,Cmd}Decl
- Remove Sema::CreateImplicitParameter
No (intended) functionality change.
llvm-svn: 55357
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index a7805f376cb..9da6dafb98d 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -220,6 +220,31 @@ ObjCPropertyDecl *ObjCPropertyDecl::Create(ASTContext &C, // Objective-C Decl Implementation //===----------------------------------------------------------------------===// +void ObjCMethodDecl::createImplicitParams(ASTContext &Context) { + QualType selfTy; + if (isInstance()) { + // There may be no interface context due to error in declaration + // of the interface (which has been reported). Recover gracefully. + if (ObjCInterfaceDecl *OID = getClassInterface()) { + selfTy = Context.getObjCInterfaceType(OID); + selfTy = Context.getPointerType(selfTy); + } else { + selfTy = Context.getObjCIdType(); + } + } else // we have a factory method. + selfTy = Context.getObjCClassType(); + + SelfDecl = ImplicitParamDecl::Create(Context, this, + SourceLocation(), + &Context.Idents.get("self"), + selfTy, 0); + + CmdDecl = ImplicitParamDecl::Create(Context, this, + SourceLocation(), + &Context.Idents.get("_cmd"), + Context.getObjCSelType(), 0); +} + void ObjCMethodDecl::setMethodParams(ParmVarDecl **NewParamInfo, unsigned NumParams) { assert(ParamInfo == 0 && "Already has param info!"); |

