diff --git a/clang/lib/AST/Interp/Interp.cpp b/clang/lib/AST/Interp/Interp.cpp index c3503f4a07895..cf9e5b8ea6bd2 100644 --- a/clang/lib/AST/Interp/Interp.cpp +++ b/clang/lib/AST/Interp/Interp.cpp @@ -496,14 +496,6 @@ bool CheckFloatResult(InterpState &S, CodePtr OpPC, APFloat::opStatus Status) { return true; } -bool CastFP(InterpState &S, CodePtr OpPC, const llvm::fltSemantics *Sem, - llvm::RoundingMode RM) { - Floating F = S.Stk.pop(); - Floating Result = F.toSemantics(Sem, RM); - S.Stk.push(Result); - return true; -} - bool Interpret(InterpState &S, APValue &Result) { // The current stack frame when we started Interpret(). // This is being used by the ops to determine wheter diff --git a/clang/lib/AST/Interp/Interp.h b/clang/lib/AST/Interp/Interp.h index f179c0486bdbd..d70b732f6fd86 100644 --- a/clang/lib/AST/Interp/Interp.h +++ b/clang/lib/AST/Interp/Interp.h @@ -1421,9 +1421,13 @@ template bool Cast(InterpState &S, CodePtr OpPC) { /// 1) Pops a Floating from the stack. /// 2) Pushes a new floating on the stack that uses the given semantics. -/// Not templated, so implemented in Interp.cpp. -bool CastFP(InterpState &S, CodePtr OpPC, const llvm::fltSemantics *Sem, - llvm::RoundingMode RM); +inline bool CastFP(InterpState &S, CodePtr OpPC, const llvm::fltSemantics *Sem, + llvm::RoundingMode RM) { + Floating F = S.Stk.pop(); + Floating Result = F.toSemantics(Sem, RM); + S.Stk.push(Result); + return true; +} template ::T> bool CastIntegralFloating(InterpState &S, CodePtr OpPC,