aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2021-09-27 19:33:37 -0700
committerDavid Blaikie <dblaikie@gmail.com>2021-09-28 10:44:35 -0700
commit85f612efeb352e759f120ee183bf31b1fd7e801a (patch)
tree49e37a7539567affd14e673a50471778b12567d5 /clang/lib/CodeGen/CodeGenFunction.cpp
parentab5e6e7434ebc67e89332d4401926978c8fb143b (diff)
downloadllvm-85f612efeb352e759f120ee183bf31b1fd7e801a.zip
llvm-85f612efeb352e759f120ee183bf31b1fd7e801a.tar.gz
llvm-85f612efeb352e759f120ee183bf31b1fd7e801a.tar.bz2
DebugInfo: Use sugared function type when emitting function declarations for call sites
Otherwise we're losing type information for these functions.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index fbb0688..da9a530 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -988,16 +988,9 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
// Reconstruct the type from the argument list so that implicit parameters,
// such as 'this' and 'vtt', show up in the debug info. Preserve the calling
// convention.
- CallingConv CC = CallingConv::CC_C;
- if (FD)
- if (const auto *SrcFnTy = FD->getType()->getAs<FunctionType>())
- CC = SrcFnTy->getCallConv();
- SmallVector<QualType, 16> ArgTypes;
- for (const VarDecl *VD : Args)
- ArgTypes.push_back(VD->getType());
- QualType FnType = getContext().getFunctionType(
- RetTy, ArgTypes, FunctionProtoType::ExtProtoInfo(CC));
- DI->emitFunctionStart(GD, Loc, StartLoc, FnType, CurFn, CurFuncIsThunk);
+ DI->emitFunctionStart(GD, Loc, StartLoc,
+ DI->getFunctionType(FD, RetTy, Args), CurFn,
+ CurFuncIsThunk);
}
if (ShouldInstrumentFunction()) {