diff --git a/clang/lib/AST/Interp/Function.cpp b/clang/lib/AST/Interp/Function.cpp index 357aff7fe6229b..69ab1e57b63301 100644 --- a/clang/lib/AST/Interp/Function.cpp +++ b/clang/lib/AST/Interp/Function.cpp @@ -48,9 +48,3 @@ bool Function::isVirtual() const { return M->isVirtual(); return false; } - -bool Function::needsRuntimeArgPop(const ASTContext &Ctx) const { - if (!isBuiltin()) - return false; - return Ctx.BuiltinInfo.hasCustomTypechecking(getBuiltinID()); -} diff --git a/clang/lib/AST/Interp/Function.h b/clang/lib/AST/Interp/Function.h index be9b1733635f72..94eb2a611771b0 100644 --- a/clang/lib/AST/Interp/Function.h +++ b/clang/lib/AST/Interp/Function.h @@ -179,10 +179,6 @@ class Function final { bool isBuiltin() const { return F->getBuiltinID() != 0; } - /// Does this function need its arguments to be classified at runtime - /// rather than at bytecode-compile-time? - bool needsRuntimeArgPop(const ASTContext &Ctx) const; - unsigned getNumParams() const { return ParamTypes.size(); } unsigned getParamOffset(unsigned ParamIndex) const { diff --git a/clang/lib/AST/Interp/Interp.cpp b/clang/lib/AST/Interp/Interp.cpp index 144b674451e353..5fe9cf80fc9470 100644 --- a/clang/lib/AST/Interp/Interp.cpp +++ b/clang/lib/AST/Interp/Interp.cpp @@ -131,20 +131,6 @@ void cleanupAfterFunctionCall(InterpState &S, CodePtr OpPC) { const Function *CurFunc = S.Current->getFunction(); assert(CurFunc); - // Certain builtin functions are declared as func-name(...), so the - // parameters are checked in Sema and only available through the CallExpr. - // The interp::Function we create for them has 0 parameters, so we need to - // remove them from the stack by checking the CallExpr. - // FIXME: This is potentially just a special case and could be handled more - // generally with the code just below? - if (CurFunc->needsRuntimeArgPop(S.getCtx())) { - const auto *CE = cast(S.Current->getExpr(OpPC)); - for (int32_t I = CE->getNumArgs() - 1; I >= 0; --I) { - popArg(S, CE->getArg(I)); - } - return; - } - if (S.Current->Caller && CurFunc->isVariadic()) { // CallExpr we're look for is at the return PC of the current function, i.e. // in the caller.