mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ClangImporter] Use new CXXThisExpr::Create function
The constructor takes a new arg which `Create` now handles. Use it instead.
This commit is contained in:
@@ -264,8 +264,8 @@ instantiateTemplatedOperator(ClangImporter::Implementation &impl,
|
||||
|
||||
clang::UnresolvedSet<1> ops;
|
||||
auto qualType = clang::QualType(classDecl->getTypeForDecl(), 0);
|
||||
auto arg = new (clangCtx)
|
||||
clang::CXXThisExpr(clang::SourceLocation(), qualType, false);
|
||||
auto arg = clang::CXXThisExpr::Create(clangCtx, clang::SourceLocation(),
|
||||
qualType, false);
|
||||
arg->setType(clang::QualType(classDecl->getTypeForDecl(), 0));
|
||||
|
||||
clang::OverloadedOperatorKind opKind =
|
||||
|
||||
@@ -5211,9 +5211,9 @@ static clang::CXXMethodDecl *synthesizeCxxBaseGetterAccessorMethod(
|
||||
|
||||
// Returns the expression that accesses the base field from derived type.
|
||||
auto createFieldAccess = [&]() -> clang::Expr * {
|
||||
auto *thisExpr = new (clangCtx)
|
||||
clang::CXXThisExpr(clang::SourceLocation(), newMethod->getThisType(),
|
||||
/*IsImplicit=*/false);
|
||||
auto *thisExpr = clang::CXXThisExpr::Create(
|
||||
clangCtx, clang::SourceLocation(), newMethod->getThisType(),
|
||||
/*IsImplicit=*/false);
|
||||
clang::QualType baseClassPtr = clangCtx.getRecordType(baseClass);
|
||||
baseClassPtr.addConst();
|
||||
baseClassPtr = clangCtx.getPointerType(baseClassPtr);
|
||||
|
||||
@@ -2114,8 +2114,9 @@ clang::CXXMethodDecl *SwiftDeclSynthesizer::synthesizeCXXForwardingMethod(
|
||||
auto diagState = clangSema.DelayedDiagnostics.push(diagPool);
|
||||
|
||||
// Construct the method's body.
|
||||
clang::Expr *thisExpr = new (clangCtx) clang::CXXThisExpr(
|
||||
clang::SourceLocation(), newMethod->getThisType(), /*IsImplicit=*/false);
|
||||
clang::Expr *thisExpr = clang::CXXThisExpr::Create(
|
||||
clangCtx, clang::SourceLocation(), newMethod->getThisType(),
|
||||
/*IsImplicit=*/false);
|
||||
if (castThisToNonConstThis) {
|
||||
auto baseClassPtr =
|
||||
clangCtx.getPointerType(clangCtx.getRecordType(derivedClass));
|
||||
|
||||
Reference in New Issue
Block a user