Fix PR31029 by attaching an artificial debug location to msabi thunks.
This was a latent bug that was recently uncovered by r286400.
llvm-svn: 287134
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index 9f6022f..2722985 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -3840,8 +3840,11 @@
FunctionArgs.push_back(&IsMostDerived);
// Start defining the function.
+ auto NL = ApplyDebugLocation::CreateEmpty(CGF);
CGF.StartFunction(GlobalDecl(), FnInfo.getReturnType(), ThunkFn, FnInfo,
FunctionArgs, CD->getLocation(), SourceLocation());
+ // Create a scope with an artificial location for the body of this function.
+ auto AL = ApplyDebugLocation::CreateArtificial(CGF);
EmitThisParam(CGF);
llvm::Value *This = getThisValue(CGF);