diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp index 1eae838ed99c..83cc45b7fa83 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp @@ -8057,9 +8057,10 @@ void CGOpenMPRuntime::emitDoacrossOrdered(CodeGenFunction &CGF, CGF.EmitRuntimeCall(RTLFn, Args); } -void CGOpenMPRuntime::emitCall(CodeGenFunction &CGF, llvm::Value *Callee, - ArrayRef Args, - SourceLocation Loc) const { +void CGOpenMPRuntime::emitCall(CodeGenFunction &CGF, SourceLocation Loc, + llvm::Value *Callee, + ArrayRef Args) const { + assert(Loc.isValid() && "Outlined function call location must be valid."); auto DL = ApplyDebugLocation::CreateDefaultArtificial(CGF, Loc); if (auto *Fn = dyn_cast(Callee)) { @@ -8074,8 +8075,7 @@ void CGOpenMPRuntime::emitCall(CodeGenFunction &CGF, llvm::Value *Callee, void CGOpenMPRuntime::emitOutlinedFunctionCall( CodeGenFunction &CGF, SourceLocation Loc, llvm::Value *OutlinedFn, ArrayRef Args) const { - assert(Loc.isValid() && "Outlined function call location must be valid."); - emitCall(CGF, OutlinedFn, Args, Loc); + emitCall(CGF, Loc, OutlinedFn, Args); } Address CGOpenMPRuntime::getParameterAddress(CodeGenFunction &CGF, diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h index e1ba8334368e..046228e7e248 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/lib/CodeGen/CGOpenMPRuntime.h @@ -251,9 +251,8 @@ protected: virtual StringRef getOutlinedHelperName() const { return ".omp_outlined."; } /// Emits \p Callee function call with arguments \p Args with location \p Loc. - void emitCall(CodeGenFunction &CGF, llvm::Value *Callee, - ArrayRef Args = llvm::None, - SourceLocation Loc = SourceLocation()) const; + void emitCall(CodeGenFunction &CGF, SourceLocation Loc, llvm::Value *Callee, + ArrayRef Args = llvm::None) const; private: /// \brief Default const ident_t object used for initialization of all other