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
This commit is contained in:
Daniel Dunbar 2008-08-26 06:08:30 +00:00
parent 279d1ccc57
commit e36c39f3bf
1 changed files with 25 additions and 0 deletions

View File

@ -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!");