aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorFelipe de Azevedo Piovezan <fpiovezan@apple.com>2023-01-16 13:05:22 -0300
committerFelipe de Azevedo Piovezan <fpiovezan@apple.com>2023-01-16 13:05:22 -0300
commitf2d301fe82869f881b86b51da7b4752972c66707 (patch)
treed6c3f02f0bc932661b316478a115a62a42dd09ba /clang/lib/CodeGen/CGDecl.cpp
parent9f1521b6da09a336c11c400506ea3200bf585210 (diff)
downloadllvm-f2d301fe82869f881b86b51da7b4752972c66707.zip
llvm-f2d301fe82869f881b86b51da7b4752972c66707.tar.gz
llvm-f2d301fe82869f881b86b51da7b4752972c66707.tar.bz2
Revert "[codegen] Store address of indirect arguments on the stack"
This reverts commit 7e4447a17db4a070f01c8f8a87505a4b2a1b0e3a.
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index a70997f..ceaddc4 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -2476,8 +2476,6 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, ParamValue Arg,
Address AllocaPtr = Address::invalid();
bool DoStore = false;
bool IsScalar = hasScalarEvaluationKind(Ty);
- bool UseIndirectDebugAddress = false;
-
// If we already have a pointer to the argument, reuse the input pointer.
if (Arg.isIndirect()) {
// If we have a prettier pointer type at this point, bitcast to that.
@@ -2489,19 +2487,6 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, ParamValue Arg,
auto AllocaAS = CGM.getASTAllocaAddressSpace();
auto *V = DeclPtr.getPointer();
AllocaPtr = DeclPtr;
-
- // For truly ABI indirect arguments -- those that are not `byval` -- store
- // the address of the argument on the stack to preserve debug information.
- ABIArgInfo ArgInfo = CurFnInfo->arguments()[ArgNo - 1].info;
- if (ArgInfo.isIndirect())
- UseIndirectDebugAddress = !ArgInfo.getIndirectByVal();
- if (UseIndirectDebugAddress) {
- auto PtrTy = getContext().getPointerType(Ty);
- AllocaPtr = CreateMemTemp(PtrTy, getContext().getTypeAlignInChars(PtrTy),
- D.getName() + ".indirect_addr");
- EmitStoreOfScalar(V, AllocaPtr, /* Volatile */ false, PtrTy);
- }
-
auto SrcLangAS = getLangOpts().OpenCL ? LangAS::opencl_private : AllocaAS;
auto DestLangAS =
getLangOpts().OpenCL ? LangAS::opencl_private : LangAS::Default;
@@ -2618,7 +2603,7 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, ParamValue Arg,
if (CGM.getCodeGenOpts().hasReducedDebugInfo() && !CurFuncIsThunk &&
!NoDebugInfo) {
llvm::DILocalVariable *DILocalVar = DI->EmitDeclareOfArgVariable(
- &D, AllocaPtr.getPointer(), ArgNo, Builder, UseIndirectDebugAddress);
+ &D, AllocaPtr.getPointer(), ArgNo, Builder);
if (const auto *Var = dyn_cast_or_null<ParmVarDecl>(&D))
DI->getParamDbgMappings().insert({Var, DILocalVar});
}