ClangImporter: Initializer type for imported ctors

Update the Clang importer to setInitializerType on the ConstructorDecls it creates.

Swift SVN r3863
This commit is contained in:
Joe Groff
2013-01-25 17:50:53 +00:00
parent 008c296c6f
commit 4f73bd5cb6

View File

@@ -745,8 +745,9 @@ namespace {
type = FunctionType::get(type->castTo<FunctionType>()->getInput(),
thisTy, Impl.SwiftContext);
// Add the 'this' parameter to the function type.
type = FunctionType::get(thisMetaTy, type, Impl.SwiftContext);
// Add the 'this' parameter to the function types.
Type allocType = FunctionType::get(thisMetaTy, type, Impl.SwiftContext);
Type initType = FunctionType::get(thisTy, type, Impl.SwiftContext);
VarDecl *thisVar = new (Impl.SwiftContext) VarDecl(SourceLoc(),
thisName, thisTy, dc);
@@ -758,7 +759,8 @@ namespace {
thisVar,
/*GenericParams=*/0,
dc);
result->setType(type);
result->setType(allocType);
result->setInitializerType(initType);
thisVar->setDeclContext(result);
setVarDeclContexts(argPatterns, result);
setVarDeclContexts(bodyPatterns, result);