@@ -130,7 +130,6 @@ struct BuiltinTypeMethodBuilder {
130130 StorageClass SC;
131131 llvm::SmallVector<Param> Params;
132132 llvm::SmallVector<Stmt *> StmtsList;
133- llvm::SmallVector<VarDecl *> LocalVars;
134133
135134 // Argument placeholders, inspired by std::placeholder. These are the indices
136135 // of arguments to forward to `callBuiltin` and other method builder methods.
@@ -139,16 +138,7 @@ struct BuiltinTypeMethodBuilder {
139138 // LastStmt - refers to the last statement in the method body; referencing
140139 // LastStmt will remove the statement from the method body since
141140 // it will be linked from the new expression being constructed.
142- enum class PlaceHolder {
143- _0,
144- _1,
145- _2,
146- _3,
147- _4,
148- LocalVar_0 = 64 ,
149- Handle = 128 ,
150- LastStmt
151- };
141+ enum class PlaceHolder { _0, _1, _2, _3, _4, Handle = 128 , LastStmt };
152142
153143 Expr *convertPlaceholder (PlaceHolder PH);
154144 Expr *convertPlaceholder (LocalVar &Var);
@@ -365,17 +355,6 @@ Expr *BuiltinTypeMethodBuilder::convertPlaceholder(PlaceHolder PH) {
365355 }
366356
367357 ASTContext &AST = DeclBuilder.SemaRef .getASTContext ();
368- if (PH >= PlaceHolder::LocalVar_0) {
369- unsigned Index = static_cast <unsigned >(PH) -
370- static_cast <unsigned >(PlaceHolder::LocalVar_0);
371- assert (Index < LocalVars.size () && " local var index out of range" );
372- VarDecl *VD = LocalVars[Index];
373- return DeclRefExpr::Create (
374- AST, NestedNameSpecifierLoc (), SourceLocation (), VD, false ,
375- DeclarationNameInfo (VD->getDeclName (), SourceLocation ()), VD->getType (),
376- VK_LValue);
377- }
378-
379358 ParmVarDecl *ParamDecl = Method->getParamDecl (static_cast <unsigned >(PH));
380359 return DeclRefExpr::Create (
381360 AST, NestedNameSpecifierLoc (), SourceLocation (), ParamDecl, false ,
0 commit comments